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

:root {
    /* Pure sharp white - 更锐利的纯白色 */
    --bg-primary: #FFFFFF;
    --bg-secondary: #FFFFFF;
    --text-primary: #000000;
    --text-secondary: rgba(0, 0, 0, 0.5);
    --text-muted: rgba(0, 0, 0, 0.4);
    --border-color: rgba(0, 0, 0, 0.06);
    --border-strong: rgba(0, 0, 0, 0.08);
    --accent-color: #007AFF;
    --accent-blue: #007AFF;
    --hover-bg: rgba(0, 0, 0, 0.01);
    --active-bg: rgba(0, 0, 0, 0.02);
    --danger-color: #FF3B30;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ===== TOP BAR ===== */
#top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    background: var(--bg-primary);
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}

/* iPad Safe Area Support for Top Bar */
.ios-ipad #top-bar {
    padding-top: var(--safe-area-top);
    height: calc(52px + var(--safe-area-top));
    box-sizing: border-box;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 240px;
}

/* Hamburger menu button */
.hamburger-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px;
    transition: opacity 0.15s;
}

.hamburger-btn:hover {
    opacity: 0.7;
}

.hamburger-btn span {
    display: block;
    width: 18px;
    height: 1px;
    background: var(--accent-blue);
    transition: all 0.15s;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

.close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 16px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
}

.close-btn:hover {
    color: var(--text-primary);
}

.breadcrumb {
    font-size: 13px;
    font-weight: 300;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb-space {
    color: var(--text-primary);
}

.breadcrumb-separator {
    color: var(--text-muted);
    font-size: 10px;
}

.breadcrumb-map {
    color: var(--text-secondary);
}

.breadcrumb-layer-info {
    color: var(--text-muted);
    font-size: 11px;
    margin-left: 4px;
}

.top-bar-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-group {
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
}

.tab-btn {
    padding: 14px 22px;
    border: none;
    background: transparent;
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 2px;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: color 0.25s ease, font-weight 0.15s ease;
}

.tab-btn:hover {
    color: rgba(0, 0, 0, 0.65);
}

.tab-btn.active {
    color: var(--accent-blue);
    font-weight: 500;
}

/* Animated underline indicator */
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    right: 50%;
    height: 1.5px;
    background: var(--accent-blue);
    transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
                right 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.2s ease;
    opacity: 0;
}

.tab-btn.active::after {
    left: 22px;
    right: 22px;
    opacity: 1;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 240px;
    justify-content: flex-end;
}

.icon-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: opacity 0.15s;
    font-size: 14px;
}

.icon-btn:hover {
    opacity: 0.8;
}

/* Zara Style Icon Button */
.zara-icon-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    opacity: 0.4;
    transition: all 0.2s ease;
    border-radius: 0;
}

.zara-icon-btn:hover {
    opacity: 1;
}

.zara-icon-btn:active {
    transform: scale(0.92);
}

.zara-icon-btn.active {
    opacity: 1;
    color: var(--accent-blue);
    background: transparent;
}

.zara-icon-btn svg {
    width: 15px;
    height: 15px;
}

/* Language Selector */
.language-selector {
    position: relative;
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-primary);
    border: 0.5px solid var(--border-light);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    min-width: 120px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.2s ease;
}

.language-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s;
}

.language-option:hover {
    background: var(--active-bg);
}

.language-option.active {
    font-weight: 500;
    background: var(--active-bg);
}

/* ===== Settings Sidebar (Unified Design) ===== */
.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.settings-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 360px; /* Match node detail panel width */
    max-width: 100vw;
    background: #ffffff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08); /* Match node detail shadow */
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Match standard transition */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-left: none;
}

.settings-overlay.visible .settings-panel {
    transform: translateX(0);
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px; /* Match detail-header padding */
    border-bottom: 0.5px solid var(--border-color); /* Match detail-header border */
    flex-shrink: 0;
    height: auto; /* Reset height */
    min-height: auto;
}

.settings-title {
    font-size: 9px; /* Match detail-title */
    font-weight: 500;
    letter-spacing: 2px;
    color: var(--text-secondary); /* Match detail-title color */
    text-transform: uppercase;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; /* Reset font */
}

.settings-close {
    width: 28px; /* Match detail-close */
    height: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    opacity: 1; /* Reset opacity */
}

.settings-close:hover {
    color: var(--text-primary);
    transform: none; /* Remove rotation */
}

.settings-body {
    padding: 24px; /* Match detail-body padding */
    overflow-y: auto;
    flex: 1;
}

.settings-body::-webkit-scrollbar {
    width: 0;
}

.settings-section {
    margin-bottom: 40px; /* Standard spacing */
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section-title {
    font-size: 9px; /* Match small labels */
    font-weight: 500;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 16px;
    padding-bottom: 0;
    border-bottom: none;
    font-family: inherit;
}

/* Storage Mode Selector */
.storage-mode-selector {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.02);
}

.storage-mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.storage-mode-btn + .storage-mode-btn {
    border-left: 1px solid rgba(0, 0, 0, 0.06);
}

.storage-mode-btn:hover:not(.active) {
    background: rgba(0, 0, 0, 0.03);
}

.storage-mode-btn.active {
    background: #007AFF;
    color: #fff;
}

.storage-mode-btn svg {
    opacity: 0.5;
    flex-shrink: 0;
}

.storage-mode-btn.active svg {
    opacity: 1;
    stroke: #fff;
}

/* Hide storage mode selector on iOS — iOS uses cloud (Firebase) only */
html.ios-iphone .storage-mode-selector,
html.ios-ipad .storage-mode-selector {
    display: none;
}

/* Hide breadcrumb (space·map name) on iPhone — top bar too narrow */
html.ios-iphone .breadcrumb {
    display: none;
}

/* Storage Switch Status */
.storage-switch-status {
    padding: 8px 12px;
    margin-bottom: 12px;
    background: rgba(0, 122, 255, 0.06);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.3px;
    color: #007AFF;
    text-align: center;
}

.settings-storage-info {
    padding: 0;
    margin-bottom: 20px;
    border: none;
    background: transparent;
}

.storage-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.storage-icon {
    display: none;
}

.storage-label {
    font-family: inherit;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.3px;
    color: var(--text-primary);
    text-transform: none;
    font-style: normal;
}

.storage-path, .storage-stats {
    font-size: 10px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-family: inherit;
    letter-spacing: 0.5px;
    text-transform: none;
}

.path-label, .stats-label {
    color: var(--text-muted);
    font-weight: 400;
    margin-right: 4px;
    text-transform: uppercase;
}

.settings-storage-actions, .settings-backup-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-btn {
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    border: 0.5px solid var(--border-color);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 11px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: auto;
    border-radius: 0;
    text-decoration: none;
}

.settings-btn svg {
    display: none;
}

.settings-btn:hover {
    background: var(--active-bg);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

#choose-folder-btn {
    background: transparent;
    color: var(--text-primary);
    border: 0.5px solid var(--border-color);
    text-decoration: none;
}
#choose-folder-btn:hover {
    background: var(--active-bg);
    border-color: var(--text-muted);
}

.settings-language-grid {
    display: flex;
    flex-direction: column;
    gap: 0; /* List style */
}

.settings-lang-btn {
    background: transparent;
    border: none;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    position: relative;
    width: 100%;
    text-transform: none;
    border-radius: 4px;
}

.settings-lang-btn:hover {
    color: var(--text-primary);
    background: var(--hover-bg);
    padding-left: 12px;
}

.settings-lang-btn.active {
    color: var(--accent-blue);
    font-style: normal;
    padding-left: 12px;
    font-weight: 500;
    background: rgba(0, 122, 255, 0.08);
}

.settings-lang-btn.active::before {
    display: none;
}

.settings-about {
    margin-top: 0;
}

.about-item {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    border-bottom: none;
    padding-bottom: 0;
}

.about-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.about-value {
    font-family: inherit;
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.backup-note {
    margin-top: 8px;
    font-size: 10px;
    color: var(--text-muted);
    font-style: normal;
    font-family: inherit;
    text-transform: none;
    letter-spacing: 0.3px;
}

/* ===== Account Section ===== */
.account-status {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 0;
    margin-bottom: 16px;
}

.account-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--hover-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.account-avatar svg {
    color: var(--text-muted);
}

.account-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.account-info {
    flex: 1;
    min-width: 0;
}

.account-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: 0.3px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-email {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-auth-form {
    margin-top: 8px;
}

.auth-form-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    border-bottom: 0.5px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px 0;
    font-family: inherit;
    font-size: 11px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.auth-tab:hover {
    color: var(--text-primary);
}

.auth-tab.active {
    color: var(--text-primary);
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -0.5px;
    left: 0;
    right: 0;
    height: 1.5px;
    background: var(--text-primary);
}

.auth-tab-content {
    padding-top: 4px;
}

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

.auth-input {
    width: 100%;
    padding: 12px 14px;
    background: var(--hover-bg);
    border: 0.5px solid transparent;
    font-family: inherit;
    font-size: 12px;
    color: var(--text-primary);
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

.auth-input::placeholder {
    color: var(--text-muted);
}

.auth-input:focus {
    border-color: var(--text-muted);
    background: transparent;
}

.auth-link-btn {
    background: transparent;
    border: none;
    padding: 8px 0;
    font-family: inherit;
    font-size: 10px;
    color: var(--text-muted);
    cursor: pointer;
    text-align: center;
    width: 100%;
    transition: color 0.2s ease;
    letter-spacing: 0.3px;
}

.auth-link-btn:hover {
    color: var(--text-primary);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 0.5px;
    background: var(--border-color);
}

.auth-divider span {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.google-btn svg {
    display: block !important;
    width: 16px;
    height: 16px;
}

.account-upgrade {
    padding: 16px;
    background: rgba(0, 122, 255, 0.05);
    border: 0.5px solid rgba(0, 122, 255, 0.15);
    margin-bottom: 16px;
}

.upgrade-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
}

.upgrade-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.upgrade-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    letter-spacing: 0.3px;
}

.account-actions {
    margin-top: 16px;
}

.auth-error {
    padding: 10px 12px;
    background: rgba(255, 59, 48, 0.08);
    border: 0.5px solid rgba(255, 59, 48, 0.2);
    color: #FF3B30;
    font-size: 11px;
    letter-spacing: 0.3px;
    margin-top: 12px;
}

.auth-success {
    padding: 10px 12px;
    background: rgba(52, 199, 89, 0.08);
    border: 0.5px solid rgba(52, 199, 89, 0.2);
    color: #34C759;
    font-size: 11px;
    letter-spacing: 0.3px;
    margin-top: 12px;
}

.settings-btn.primary {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
}

.settings-btn.primary:hover {
    background: var(--text-secondary);
    border-color: var(--text-secondary);
}

.account-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 11px;
    letter-spacing: 0.5px;
}

.account-loading::after {
    content: '';
    width: 14px;
    height: 14px;
    border: 1.5px solid var(--border-color);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    margin-left: 10px;
    animation: spin 0.8s linear infinite;
}

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

/* ===== SUBSCRIPTION STYLES (Zara Design) ===== */

/* Status Card */
.sub-status-card {
    text-align: center;
    padding: 32px 24px;
    background: var(--hover-bg);
}

/* Countdown Display */
.sub-countdown {
    margin-bottom: 24px;
}

.countdown-number {
    font-size: 64px;
    font-weight: 200;
    color: var(--text-primary);
    letter-spacing: -2px;
    line-height: 1;
}

.countdown-unit {
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 4px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Progress Bar */
.sub-progress {
    margin-bottom: 24px;
}

.sub-progress-bar {
    height: 1px;
    background: var(--border-color);
    width: 100%;
    overflow: hidden;
}

.sub-progress-fill {
    height: 100%;
    background: var(--text-primary);
    transition: width 0.3s ease;
}

/* Pricing */
.sub-pricing {
    margin-bottom: 24px;
}

.sub-price {
    font-size: 24px;
    font-weight: 300;
    color: var(--text-primary);
}

.sub-price-period {
    font-size: 12px;
    font-weight: 300;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

/* Subscription Buttons - Zara Style */
.sub-btn-blue {
    width: 100%;
    padding: 16px 24px;
    background: transparent;
    border: 0.5px solid var(--accent-blue, #007AFF);
    font-family: inherit;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--accent-blue, #007AFF);
}

.sub-btn-blue:hover {
    background: var(--accent-blue, #007AFF);
    color: white;
}

.sub-btn-outline {
    width: 100%;
    padding: 12px 24px;
    background: transparent;
    border: 0.5px solid var(--text-muted, #999);
    font-family: inherit;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-muted, #999);
}

.sub-btn-outline:hover {
    border-color: var(--text-primary, #333);
    color: var(--text-primary, #333);
}

/* Subscription Test Panel */
.sub-test-panel {
    margin-top: 20px;
    padding: 16px;
    border: 1px dashed var(--border-color, #ddd);
    border-radius: 8px;
    background: var(--bg-secondary, #f9f9f9);
}

.sub-test-title {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--text-secondary, #999);
    margin-bottom: 12px;
}

.sub-test-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sub-test-btn {
    padding: 10px 12px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 6px;
    background: white;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    color: var(--text-primary, #333);
}

.sub-test-btn:hover {
    border-color: var(--brand-blue, #4A90D9);
    background: rgba(74, 144, 217, 0.05);
}

.sub-test-btn:active {
    transform: scale(0.98);
}

.sub-test-btn.sub-test-success {
    border-left: 3px solid #34C759;
}

.sub-test-btn.sub-test-danger {
    border-left: 3px solid #FF3B30;
}

.sub-test-btn.sub-test-warning {
    border-left: 3px solid #FF9500;
}

.sub-test-log {
    margin-top: 10px;
    font-size: 11px;
    color: var(--text-secondary, #999);
    font-family: 'SF Mono', monospace;
    line-height: 1.6;
    max-height: 120px;
    overflow-y: auto;
}

/* Active Subscription Card - Zara Minimal */
.sub-active-card {
    text-align: center;
    padding: 24px 0;
}

.sub-pro-label {
    font-size: 13px;
    font-weight: 300;
    letter-spacing: 3px;
    color: var(--text-primary);
}

.sub-active-renewal {
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.sub-active-renewal:empty {
    display: none;
}

.sub-pro-label + .sub-active-renewal:not(:empty) + .sub-active-buttons {
    margin-top: 24px;
}

.sub-pro-label + .sub-active-renewal:empty + .sub-active-buttons,
.sub-pro-label + .sub-active-buttons {
    margin-top: 24px;
}

/* Minimal Button - Zara Style */
.sub-btn-minimal {
    width: 100%;
    padding: 14px 24px;
    background: transparent;
    border: 0.5px solid var(--border-color);
    font-family: inherit;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.sub-btn-minimal:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

/* Active subscription buttons */
.sub-active-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Cancel button - Zara minimal danger */
.sub-btn-cancel {
    flex: 1;
    padding: 14px 24px;
    background: transparent;
    border: 0.5px solid var(--border-color);
    font-family: inherit;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-muted);
}

.sub-btn-cancel:hover {
    border-color: var(--danger-color);
    color: var(--danger-color);
}

/* Active subscription info */
.sub-active-info {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    letter-spacing: 0.5px;
}

/* Cancelled Subscription Card */
.sub-cancelled-card {
    text-align: center;
    padding: 24px;
}

.sub-cancelled-countdown {
    font-size: 24px;
    font-weight: 300;
    letter-spacing: 2px;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-variant-numeric: tabular-nums;
}

.sub-cancelled-countdown .countdown-label {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    margin-top: 4px;
    text-transform: uppercase;
}

.sub-cancelled-price {
    margin-bottom: 16px;
}

.sub-cancelled-price .sub-price {
    font-size: 32px;
    font-weight: 300;
    letter-spacing: -1px;
}

.sub-cancelled-price .sub-price-period {
    font-size: 12px;
    color: var(--text-secondary);
}

.sub-active-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
}

.active-check {
    color: #34C759;
    font-size: 16px;
}

.active-label {
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 4px;
    color: var(--text-primary);
}

.sub-active-price {
    margin-bottom: 8px;
}

.sub-active-price .price-amount {
    font-size: 32px;
    font-weight: 200;
    color: var(--text-primary);
}

.sub-active-price .price-period {
    font-size: 12px;
    font-weight: 300;
    color: var(--text-muted);
}

.active-renewal {
    font-size: 11px;
    font-weight: 300;
    color: var(--text-muted);
    margin-bottom: 24px;
    letter-spacing: 0.3px;
}

.subscription-error {
    padding: 12px 16px;
    background: rgba(255, 59, 48, 0.05);
    border-left: 2px solid #FF3B30;
    color: #FF3B30;
    font-size: 12px;
    font-weight: 300;
    letter-spacing: 0.3px;
    margin-top: 16px;
}

/* Subscription Test Panel (Dev) */
.sub-test-panel {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 0.5px solid var(--border-color);
}

.sub-test-label {
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 3px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.sub-test-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.sub-test-btn {
    padding: 6px 12px;
    font-family: inherit;
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: transparent;
    border: 0.5px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.sub-test-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.sub-test-log {
    font-size: 10px;
    font-family: monospace;
    color: var(--text-muted);
    max-height: 120px;
    overflow-y: auto;
    line-height: 1.6;
}

.sub-test-log div {
    padding: 2px 0;
    border-bottom: 0.5px solid var(--border-color);
}

.add-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--accent-blue);
    color: white;
    font-size: 18px;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s;
}

.add-btn:hover {
    background: #0066DD;
}

/* ===== MAIN CONTAINER ===== */
#main-container {
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
}

.ios-ipad #main-container {
    top: calc(52px + var(--safe-area-top));
}

/* ===== LEFT SIDEBAR (Navigation) ===== */
#left-sidebar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 180px;
    background: var(--bg-primary);
    border-right: none;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.08);
    z-index: 1000; /* 高于透视容器 */
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.ios-ipad #left-sidebar {
    padding-bottom: var(--safe-area-bottom);
}

#left-sidebar.hidden {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 28px 0;
}

.sidebar-item {
    padding: 18px 28px;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 2px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.15s, background-color 0.15s;
}

.sidebar-item:hover {
    color: var(--text-primary);
    background: var(--hover-bg);
}

.sidebar-item.active {
    color: var(--accent-blue);
    font-weight: 500;
    background: rgba(0, 122, 255, 0.08);
}

/* ===== LEFT PANEL (Content) ===== */
#left-panel {
    position: absolute;
    top: 0;
    left: 180px;  /* 紧跟在 sidebar 右边 */
    bottom: 0;
    width: 280px;
    background: var(--bg-primary);
    border-right: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.08);
    z-index: 999; /* 高于透视容器，低于 sidebar */
    transition: transform 0.25s ease, opacity 0.25s ease;
}

#left-panel.collapsed {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
}

/* 当侧边栏隐藏时，左侧面板也隐藏 */
#left-sidebar.hidden ~ #left-panel {
    transform: translateX(-460px);
    opacity: 0;
    pointer-events: none;
}

.panel-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.panel-header {
    padding: 24px 24px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.panel-title {
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 2px;
    color: var(--text-secondary);
}

.panel-count {
    font-size: 9px;
    font-weight: 300;
    color: var(--text-muted);
}

/* Panel Search - Zara Style (matches map manager search) */
.panel-search {
    padding: 16px 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.panel-search input {
    flex: 1;
    border: none;
    border-bottom: 0.5px solid var(--text-muted);
    background: transparent;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 1.5px;
    padding: 8px 0;
    outline: none;
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.panel-search input::placeholder {
    color: var(--text-primary);
    opacity: 0.5;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-size: 10px;
}

.panel-search input:focus {
    border-bottom-color: var(--accent-blue);
}

.panel-add-btn {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    font-size: 18px;
    font-weight: 300;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-add-btn:hover {
    color: var(--text-primary);
}

/* Node List Items - Compact Zara Style */
.node-list-item {
    padding: 12px 24px;
    cursor: pointer;
    transition: opacity 0.15s;
}

.node-list-item:hover {
    opacity: 0.6;
}

.node-list-item.active {
    background: transparent;
}

.node-list-item.active .node-list-title {
    font-weight: 500;
}

.node-list-title {
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.3px;
    color: var(--text-primary);
    line-height: 1.4;
}

.node-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.node-list-map {
    font-size: 9px;
    font-weight: 300;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 4px;
    display: block;
}

.node-refs-badge {
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Node list item dragging */
.node-list-item[draggable="true"] {
    cursor: grab;
}

.node-list-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

/* Canvas drag-over state */
.canvas-wrapper.drag-over,
.split-right-pane.drag-over {
    background: rgba(0, 0, 0, 0.02);
}

.canvas-wrapper.drag-over::after,
.split-right-pane.drag-over::after {
    content: '';
    position: absolute;
    inset: 8px;
    border: 1px dashed var(--text-muted);
    border-radius: 4px;
    pointer-events: none;
    opacity: 0.5;
}

/* Map Selection Modal */
.map-selection-list {
    display: flex;
    flex-direction: column;
}

.map-selection-item {
    padding: 14px 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 0.5px solid var(--border-color);
    transition: opacity 0.15s;
}

.map-selection-item:last-child {
    border-bottom: none;
}

.map-selection-item:hover {
    opacity: 0.6;
}

.map-selection-name {
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.map-selection-space {
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.panel-body {
    flex: 1;
    overflow-y: auto;
}

.panel-footer {
    padding: 16px 24px;
    border-top: 0.5px solid var(--border-color);
    flex-shrink: 0;
}

.panel-action-btn {
    width: 100%;
    padding: 12px;
    border: 0.5px solid var(--accent-blue);
    background: transparent;
    font-size: 10px;
    font-weight: 300;
    color: var(--accent-blue);
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: background-color 0.15s;
}

.panel-action-btn:hover {
    background: var(--active-bg);
}

/* ===== PANEL TOP BAR (Search + Add) - Zara Style ===== */
.panel-top-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 20px 16px;
    flex-shrink: 0;
    background: var(--bg-primary);
}

/* Zara-style Search Box */
.search-box-zara {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
}

.search-box-zara input {
    width: 100%;
    border: none;
    border-bottom: 0.5px solid var(--text-muted);
    background: transparent;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 1.5px;
    padding: 8px 24px 8px 0;
    outline: none;
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.search-box-zara input::placeholder {
    color: var(--text-primary);
    opacity: 0.6;
    letter-spacing: 1.5px;
}

.search-box-zara input:focus {
    border-bottom-color: var(--accent-blue);
}

.search-clear-zara {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0.5;
    transition: opacity 0.15s;
}

.search-clear-zara:hover {
    opacity: 1;
}

/* Zara-style Add Button */
.add-btn-zara {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: opacity 0.15s;
    flex-shrink: 0;
    padding: 0;
}

.add-btn-zara:hover {
    opacity: 1;
}

.add-btn-zara:active {
    opacity: 0.7;
}

.add-btn-zara svg {
    width: 14px;
    height: 14px;
}

/* ===== MAP LIST SECTIONS - Zara Style ===== */
.map-section-header {
    padding: 32px 24px 12px;
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 3px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    gap: 16px;
}

.no-results-icon {
    font-size: 48px;
    opacity: 0.1;
}

.no-results-title {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.no-results-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== LIST ITEMS - Zara Style ===== */
.list-item {
    padding: 16px 24px;
    border-bottom: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    transition: opacity 0.15s;
}

.list-item:hover {
    background: transparent;
    opacity: 0.6;
}

.list-item.active {
    background: transparent;
}

.list-item-title {
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.list-item-subtitle {
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.list-item-indicator {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 5px;
    color: var(--text-primary);
}

.list-item-actions {
    display: none !important;
}

.list-item:hover .list-item-actions {
    display: none !important;
}

.list-item:hover .list-item-indicator {
    display: block;
}

.list-item-right {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
}

.list-item:hover .list-item-right {
    display: flex;
}

.pin-icon {
    font-size: 10px;
    opacity: 0.4;
}



/* ===== EMPTY STATE ===== */
.empty-state {
    padding: 60px 24px;
    text-align: center;
    font-size: 12px;
    font-weight: 300;
    color: var(--text-muted);
}

/* ===== MINDMAP CONTAINER ===== */
#mindmap-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: var(--bg-primary);
    /* 侧边栏是悬浮的，不占用布局空间，所以 mindmap-container 始终是全宽 */
    width: 100%;
}

/* ===== CANVAS 2D RENDERER ===== */
#mindmap-canvas,
#mindmap-canvas-right {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    /* Canvas 渲染层在最底层，但在背景之上 */
}

#connections-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
    z-index: 5;
    /* Above nodes layer so connections are visible over text */
}

#nodes-layer {
    position: absolute;
    top: 0;
    left: 0;
    /* 
     * 无限画布策略 (Viewport Rendering + Virtualization):
     * 1. 容器固定为视口大小，永远不移动
     * 2. 每个节点独立使用 transform 定位到屏幕坐标
     * 3. 视口外的节点直接从 DOM 移除（虚拟化）
     * 4. 彻底绕过 GPU 纹理限制 (16384px)
     */
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 2;
    pointer-events: none; /* 让事件穿透到节点 */
    /* ❌ 不要添加 transform，容器永远静止 */
}

/* ===== SPLIT VIEW ===== */
#canvas-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    transition: right 0.3s ease;
}

#mindmap-container.split-view #canvas-wrapper {
    right: 50%;
    border-right: none; /* Divider handles the border now */
}

/* Split View Divider - Draggable */
.split-divider {
    position: absolute;
    top: 40px; /* Below split-view-controls */
    bottom: 0;
    left: 50%;
    width: 1px;
    background: rgba(0, 0, 0, 0.08);
    cursor: col-resize;
    z-index: 100;
    transform: translateX(-50%);
    transition: background 0.15s ease, width 0.15s ease;
}

.split-divider::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -4px;
    width: 9px; /* Larger hit area for easier grabbing */
    cursor: col-resize;
}

.split-divider:hover,
.split-divider.dragging {
    background: var(--accent-blue);
    width: 2px;
}

.split-divider.dragging {
    transition: none; /* No transition while dragging */
}

.split-right-pane {
    position: absolute;
    top: 0;
    left: 50%;
    right: 0;
    bottom: 0;
    overflow: hidden;
    background: var(--bg-primary);
}

#connections-layer-right,
#nodes-layer-right {
    position: absolute;
    top: 0;
    left: 0;
}

#connections-layer-right {
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
    z-index: 5;
}

#nodes-layer-right {
    /* 
     * 无限画布策略 (Viewport Rendering):
     * 与 #nodes-layer 相同的策略，用于右侧分屏面板
     */
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 2;
    pointer-events: none;
}

/* Split View Controls - Zara Style */
.split-view-controls {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    z-index: 1000;
    padding: 0 20px;
}

#mindmap-container.split-view #canvas-wrapper,
#mindmap-container.split-view .split-right-pane {
    top: 40px;
}

.split-control-left,
.split-control-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.split-pane-label {
    font-size: 10px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.3);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: color 0.15s ease;
}

.split-pane-label.active {
    color: #007AFF;
    font-weight: 600;
}

.split-selector-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.split-select {
    font-size: 12px;
    font-weight: 400;
    font-family: inherit;
    color: #000;
    background: transparent;
    border: none;
    padding: 6px 24px 6px 10px;
    min-width: 120px;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23000' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    transition: all 0.15s ease;
}

.split-select:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.split-select:focus {
    background-color: rgba(0, 0, 0, 0.05);
}

.split-select option {
    font-size: 13px;
    padding: 8px 12px;
}

.split-separator {
    width: 1px;
    height: 16px;
    background: rgba(0, 0, 0, 0.1);
    margin: 0 4px;
}

.split-swap-btn {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.5);
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
}

.split-swap-btn:hover {
    color: #000;
    border-color: rgba(0, 0, 0, 0.3);
    background: rgba(0, 0, 0, 0.02);
}

/* Split View Button Active State */
.split-view-btn.active svg {
    stroke: var(--accent-blue);
}

/* Split Pane Focus Indicator */
.split-right-pane {
    transition: box-shadow 0.2s ease;
}

.split-right-pane.focused {
    box-shadow: inset 0 0 0 2px rgba(0, 122, 255, 0.3);
}

#canvas-wrapper.focused {
    box-shadow: inset 0 0 0 2px rgba(0, 122, 255, 0.3);
}

/* Right pane nodes need same styling */
#nodes-layer-right .node {
    cursor: pointer;
}

#nodes-layer-right .node:hover {
    border-color: rgba(0, 0, 0, 0.2);
}

#nodes-layer-right .node.selected {
    border-color: var(--accent-blue);
    background: rgba(0, 122, 255, 0.05);
}

/* ===== RIGHT SIDEBAR ===== */
#right-sidebar {
    width: 320px;
    background: var(--bg-primary);
    border-left: none;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    box-shadow: -2px 0 16px rgba(0, 0, 0, 0.06);
    z-index: 5;
}

.sidebar-header {
    padding: 24px 28px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-title {
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 2px;
    color: var(--text-secondary);
}

.sidebar-count {
    font-size: 9px;
    font-weight: 300;
    color: var(--text-muted);
}

.spaces-list {
    flex: 1;
    overflow-y: auto;
}

.space-item {
    padding: 22px 28px;
    border-top: 0.5px solid var(--border-color);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    transition: background-color 0.15s;
}

.space-item:hover {
    background: var(--hover-bg);
}

.space-item.active {
    background: var(--active-bg);
}

.space-name {
    font-size: 13px;
    font-weight: 300;
    letter-spacing: 1.5px;
    color: var(--text-primary);
}

.space-maps {
    font-size: 9px;
    font-weight: 300;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.space-indicator {
    position: absolute;
    right: 28px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 6px;
    color: var(--text-primary);
}

/* ===== MIND MAP NODES - Sharp & Clean ===== */
.node {
    position: absolute;
    top: 0;
    left: 0;
    min-width: 80px;
    max-width: 700px;
    user-select: none;
    -webkit-user-select: none;
    cursor: default;
    padding: 14px 22px;
    background: #FFFFFF;
    border: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.3px;
    will-change: transform;
    transform-origin: 0 0;
    pointer-events: auto;
}

.node * {
    cursor: default;
}

.node:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10), 0 2px 6px rgba(0, 0, 0, 0.06);
}

.node.selected {
    box-shadow: 0 0 0 2px var(--accent-blue), 0 6px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    background: #FFFFFF;
}

/* Multi-selected nodes - clean blue outline */
.node.multi-selected {
    outline: 1.5px solid var(--accent-blue) !important;
    outline-offset: 3px;
}

/* Selection box for multi-select - fixed position */
.selection-box {
    position: fixed;
    border: 1px solid var(--accent-blue);
    background: rgba(0, 122, 255, 0.08);
    pointer-events: none;
    z-index: 10000;
}

.node.text-node {
    background: #FFF8E1;
    border: none;
    font-size: 11px;
    color: #000000;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
}

.node-content {
    outline: none;
    text-align: center;
    min-width: 40px;
    color: var(--text-primary);
    word-break: break-word;
    /* Prevent text selection during drag - allow when focused for editing */
    user-select: none;
    -webkit-user-select: none;
    cursor: default;
}

.node-content:focus {
    user-select: text;
    -webkit-user-select: text;
    cursor: text;
}

/* Node Image */
.node-image-container {
    margin-bottom: 8px;
    border-radius: 4px;
    overflow: visible;
    order: -1; /* Ensure image appears above text */
    position: relative;
}

.node-image {
    width: 180px;
    height: auto;
    display: block;
    object-fit: contain;
    border-radius: 4px;
    user-select: none;
    -webkit-user-drag: none;
}

/* Image resize handle */
.node-image-resize-handle {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 12px;
    height: 12px;
    background: var(--bg-primary);
    border: 1.5px solid var(--border-strong);
    border-radius: 2px;
    cursor: nwse-resize;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease;
    z-index: 10;
}

.node-image-container:hover .node-image-resize-handle,
.node-image-resize-handle.active {
    opacity: 1;
}

.node-image-resize-handle:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.node-image-resize-handle.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

/* Corner resize cursors for image edges */
.node-image-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
    z-index: 5;
}

/* ===== IMAGE VIEWER OVERLAY (for full preview) ===== */
.image-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    cursor: pointer;
}

.image-viewer-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.image-viewer-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.image-viewer-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    user-select: none;
    -webkit-user-drag: none;
}

.image-viewer-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    z-index: 10001;
}

.image-viewer-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.image-viewer-controls {
    display: none;
}

.image-viewer-hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    letter-spacing: 1px;
    pointer-events: none;
}

.node-tags {
    position: absolute;
    bottom: -18px;
    left: 0;
    display: flex;
    gap: 4px;
    font-size: 8px;
}

.node-tag {
    padding: 2px 6px;
    background: var(--active-bg);
    border-radius: 2px;
    color: var(--text-secondary);
}

.add-child-btn {
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background: transparent;
    color: var(--text-secondary);
    border: 0.5px solid var(--border-strong);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s, border-color 0.15s;
    font-size: 12px;
    font-weight: 200;
}

.add-child-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

.node:hover .add-child-btn {
    opacity: 1;
}

.delete-btn {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 16px;
    height: 16px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    border: 0.5px solid var(--border-strong);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    font-size: 10px;
    transition: opacity 0.15s, color 0.15s, border-color 0.15s;
}

.delete-btn:hover {
    color: var(--danger-color);
    border-color: var(--danger-color);
}

.node:hover .delete-btn {
    opacity: 1;
}

/* ===== NODE DETAIL PANEL ===== */
#node-detail-panel {
    position: fixed;
    right: 0;
    top: 52px;
    bottom: 0;
    width: 360px;
    background: var(--bg-primary);
    border-left: none;
    z-index: 500;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
}

.detail-header {
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 0.5px solid var(--border-color);
}

.detail-title {
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 2px;
    color: var(--text-secondary);
}

.detail-close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-secondary);
}

.detail-close:hover {
    color: var(--text-primary);
}

.detail-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.detail-field {
    margin-bottom: 24px;
}

.detail-field label {
    display: block;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.detail-field textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 0.5px solid var(--border-strong);
    background: transparent;
    font-size: 13px;
    font-weight: 300;
    resize: vertical;
    outline: none;
}

.detail-field textarea:focus {
    border-color: var(--text-primary);
}

.detail-field input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 0.5px solid var(--border-strong);
    background: transparent;
    font-size: 12px;
    outline: none;
}

.detail-field input[type="color"] {
    width: 44px;
    height: 32px;
    border: 0.5px solid var(--border-strong);
    padding: 0;
    cursor: pointer;
}

#node-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.tag-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--active-bg);
    border-radius: 2px;
    font-size: 10px;
}

.tag-chip button {
    width: 14px;
    height: 14px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 10px;
    color: var(--text-secondary);
}

.tag-chip button:hover {
    color: var(--danger-color);
}

.detail-actions {
    padding-top: 20px;
    border-top: 0.5px solid var(--border-color);
}

.btn-delete {
    width: 100%;
    padding: 10px;
    border: 0.5px solid var(--danger-color);
    background: transparent;
    color: var(--danger-color);
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background-color 0.15s;
}

.btn-delete:hover {
    background: rgba(255, 59, 48, 0.1);
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(2px);
}

.modal {
    background: var(--bg-primary);
    min-width: 440px;
    max-width: 540px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
}

.modal-header {
    padding: 24px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 0.5px solid var(--border-color);
}

.modal-title {
    font-size: 13px;
    font-weight: 300;
    letter-spacing: 2px;
}

.modal-close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-secondary);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 28px;
}

.modal-input {
    width: 100%;
    padding: 14px;
    border: 0.5px solid var(--border-strong);
    background: transparent;
    font-size: 13px;
    font-weight: 300;
    outline: none;
}

.modal-input:focus {
    border-color: var(--text-primary);
}

.modal-footer {
    padding: 20px 28px;
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    border-top: 0.5px solid var(--border-color);
}

.modal-btn {
    padding: 12px 28px;
    border: 0.5px solid var(--border-strong);
    background: transparent;
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background-color 0.15s;
}

.modal-btn:hover {
    background: var(--hover-bg);
}

.modal-btn.primary {
    background: var(--accent-blue);
    color: #FFFFFF;
    border-color: var(--accent-blue);
}

.modal-btn.primary:hover {
    background: #0066DD;
}

.modal-btn.danger {
    background: var(--danger-color);
    color: #FFFFFF;
    border-color: var(--danger-color);
}

.modal-btn.danger:hover {
    background: #E6352B;
    border-color: #E6352B;
}

/* ===== CHAT INPUT ===== */
.chat-input-container {
    padding: 16px 24px;
    border-top: 0.5px solid var(--border-color);
    display: flex;
    gap: 12px;
}

.chat-input-container input {
    flex: 1;
    padding: 12px 14px;
    border: 0.5px solid var(--border-strong);
    background: transparent;
    font-size: 13px;
    font-weight: 300;
    outline: none;
}

.chat-input-container button {
    padding: 12px 20px;
    border: 0.5px solid var(--text-primary);
    background: transparent;
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 1px;
    cursor: pointer;
}

/* ===== CONTEXT MENU - Zara Style ===== */
.context-menu {
    position: fixed;
    background: var(--bg-primary);
    border: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 6px 0;
    z-index: 2000;
    min-width: 160px;
    max-width: 220px;
    opacity: 0;
    transform: translateY(-4px);
    animation: contextMenuIn 0.15s ease forwards;
}

@keyframes contextMenuIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.context-menu-item {
    padding: 10px 20px;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.3px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color 0.1s, opacity 0.1s;
    opacity: 0.7;
    white-space: nowrap;
}

.context-menu-item:hover {
    background: var(--active-bg);
    opacity: 1;
}

.context-menu-item.danger {
    color: var(--danger-color);
    opacity: 0.8;
}

.context-menu-item.danger:hover {
    background: rgba(255, 59, 48, 0.08);
    opacity: 1;
}

.context-menu-item.disabled {
    color: var(--text-muted);
    cursor: default;
    opacity: 0.4;
}

.context-menu-item.disabled:hover {
    background: transparent;
    opacity: 0.4;
}

.context-menu-divider {
    height: 1px;
    background: var(--border-light);
    margin: 4px 16px;
    opacity: 0.5;
}

/* ===== PENDING INDICATOR ===== */
#pending-indicator {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* ===== NODE STATES ===== */
.node.pending-source {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
}

.node.pending-target {
    cursor: crosshair;
}

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* ===== HIDDEN STATE ===== */
.hidden {
    display: none !important;
}

/* ===== LAYOUT CONTROLS (已移除) ===== */

.auto-layout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border: none;
    background: var(--bg-primary);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-primary);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.auto-layout-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.auto-layout-btn:hover {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
}

.auto-layout-btn:active {
    transform: scale(0.98);
}

.auto-layout-btn.animating {
    pointer-events: none;
    opacity: 0.6;
}

/* ===== ZOOM CONTROLS ===== */
/* 缩放控件现在位于每个画布的右下角 */
.pane-zoom-controls,
#zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(255, 255, 255, 0.95);
    padding: 4px 8px;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
    z-index: 50;
    backdrop-filter: blur(8px);
    border: 0.5px solid rgba(0, 0, 0, 0.06);
}

.ios-ipad .pane-zoom-controls,
.ios-ipad #zoom-controls {
    bottom: calc(20px + var(--safe-area-bottom));
}

#zoom-level,
#zoom-level-right,
#outline-zoom-level {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: center;
    letter-spacing: 0.3px;
}

.zoom-btn {
    width: 26px;
    height: 26px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 300;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    transition: all 0.15s;
}

.zoom-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

.zoom-btn:active {
    transform: scale(0.95);
}

/* ===== BACK TO OUTLINE BUTTON ===== */
.back-to-outline-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 60;
    background: #fff;
    border: 0.5px solid rgba(0, 0, 0, 0.08);
    color: var(--text-primary, #1a1a1a);
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1.2px;
    padding: 7px 14px;
    cursor: pointer;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(8px);
    transition: all 0.15s;
}

.back-to-outline-btn:hover {
    background: #007AFF;
    color: #fff;
    border-color: #007AFF;
}

.back-to-outline-btn:active {
    transform: scale(0.97);
}

/* ===== LAYOUT ANIMATION ===== */
.node.layout-animating {
    transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                top 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== CONNECTION PATHS ===== */
.connection-path {
    fill: none;
    stroke: rgba(0, 0, 0, 0.15);
    stroke-width: 1;
    transition: stroke 0.15s;
}

.connection-path.parent-child {
    stroke: rgba(0, 0, 0, 0.15);
}

.connection-path.arrow {
    stroke: var(--accent-blue);
    stroke-width: 1.5;
}

.connection-path.link {
    stroke: #FF9500;
    stroke-dasharray: 4 2;
}

.connection-path.cross-map {
    stroke: #AF52DE;
    stroke-width: 2;
    stroke-dasharray: 6 3;
}

.connection-path:hover {
    stroke-width: 1.5;
    stroke: rgba(0, 0, 0, 0.3);
}

.connection-arrowhead {
    fill: var(--accent-blue);
}

/* ===== LAYOUT TOOLTIP ===== */
.layout-tooltip {
    position: absolute;
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 6px 10px;
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 0.5px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.15s, transform 0.15s;
    white-space: nowrap;
    z-index: 1000;
}

.layout-btn:hover + .layout-tooltip,
.layout-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== PERSPECTIVE MODE ===== */
.perspective-btn {
    position: relative;
}

.perspective-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.perspective-btn.active {
    background: var(--text-primary) !important;
    color: white !important;
    opacity: 1 !important;
    border-radius: 4px;
}

/* Perspective Related Maps Panel */
#perspective-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-primary);
    border: 0.5px solid var(--border-strong);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border-radius: 0;
    z-index: 1500;
    min-width: 440px;
    max-width: 640px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
}

.perspective-header {
    padding: 24px 28px;
    border-bottom: 0.5px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.perspective-title {
    font-size: 13px;
    font-weight: 300;
    letter-spacing: 2px;
    color: var(--text-primary);
}

.perspective-subtitle {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 6px;
}

.perspective-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    transition: all 0.15s;
}

.perspective-close:hover {
    background: var(--active-bg);
    color: var(--text-primary);
}

.perspective-body {
    padding: 20px 28px;
    overflow-y: auto;
    flex: 1;
}

.perspective-layer {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    margin-bottom: 10px;
    background: var(--hover-bg);
    border-radius: 0;
    cursor: pointer;
    transition: all 0.15s;
}

.perspective-layer:hover {
    background: var(--active-bg);
}

.layer-depth {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--text-primary);
    color: white;
    font-size: 11px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.layer-depth.current {
    background: var(--text-primary);
}

.layer-depth.depth-1 {
    background: rgba(0, 0, 0, 0.6);
}

.layer-depth.depth-2 {
    background: rgba(0, 0, 0, 0.45);
}

.layer-depth.depth-3 {
    background: rgba(0, 0, 0, 0.3);
}

.layer-info {
    flex: 1;
}

.layer-name {
    font-size: 13px;
    font-weight: 300;
    letter-spacing: 1px;
    color: var(--text-primary);
}

.layer-meta {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.layer-connections {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 400;
}

.perspective-empty {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-secondary);
}

.perspective-empty-icon {
    font-size: 48px;
    opacity: 0.2;
    margin-bottom: 20px;
}

.perspective-empty-text {
    font-size: 13px;
    font-weight: 300;
    letter-spacing: 1px;
}

.perspective-empty-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 10px;
}

.perspective-footer {
    padding: 20px 28px;
    border-top: 0.5px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 14px;
}

.perspective-action-btn {
    padding: 12px 24px;
    border: 0.5px solid var(--border-strong);
    background: transparent;
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 0;
    transition: all 0.15s;
}

.perspective-action-btn:hover {
    background: var(--hover-bg);
}

.perspective-action-btn.primary {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.perspective-action-btn.primary:hover {
    background: #0066DD;
}

/* ===== 透视模式 - 沉浸式文件箱 ===== */
#perspective-container {
    /* 绝对定位，填满父容器 (#mindmap-container) */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 30%, #555c69 0%, #2b303b 100%);
    z-index: 900;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* perspective-actions removed - using system top bar instead */

.perspective-stage {
    position: relative;
    width: 100%;
    height: 100%;
    /* 不居中，让内容完全填满 */
}

.perspective-stack {
    position: absolute;
    top: 0;
    left: 0;
    /* 全屏填满 */
    width: 100%; 
    height: 100%;
    transform-style: preserve-3d;
}

/* 每一层文件夹/导图卡片 - 全屏 */
.perspective-folder-layer {
    position: absolute;
    top: 0;
    left: 0;
    /* 全屏填满 */
    width: 100%;
    height: 100%;
    /* 半透明玻璃质感 */
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(6px);
    border: none;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.2);
    transform-origin: center center;
    /* No CSS transition — JS physics engine handles 60fps interpolation */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* folder-header-tab removed - using system top bar instead */

/* 导图内容区域 - 使用相对定位容纳绝对定位的节点 */
.folder-canvas-area {
    flex: 1;
    position: relative;
    background: transparent;
    overflow: hidden;
}

/* 透视模式的 Canvas 图层 */
.perspective-layer-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* 焦点图层的 Canvas 可交互 */
.perspective-folder-layer.focused .perspective-layer-canvas {
    pointer-events: auto;
}

/* 节点容器 - 和正常导图一样的定位方式 */
.folder-nodes-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* 透视模式下克隆的节点样式调整 */
.folder-nodes-container .node {
    pointer-events: none;
    cursor: default;
}

.folder-nodes-container .node .node-content {
    pointer-events: none;
    cursor: default;
    user-select: none;
}

.folder-nodes-container .node .add-child-btn,
.folder-nodes-container .node .delete-node-btn {
    display: none;
}

/* 移除透视模式下节点的悬停效果 */
.folder-nodes-container .node:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* 透视模式下的连接线 */
.folder-connections-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

/* 交互覆盖层 - 用于非焦点图层的点击跳转 */
.folder-click-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    background: transparent;
    z-index: 20;
    transition: background 0.2s;
    pointer-events: none;
}

.folder-click-overlay:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* 焦点图层高亮 - Zara 极简风格 */
.perspective-folder-layer.focused {
    box-shadow: 
        inset 0 0 0 0.5px rgba(255, 255, 255, 0.15),
        0 20px 60px rgba(0, 0, 0, 0.25);
}

/* 非焦点图层：覆盖层启用点击，阻挡节点 */
.perspective-folder-layer:not(.focused) .folder-click-overlay {
    pointer-events: auto;
}

/* 焦点图层：覆盖层完全禁用，让节点可交互 */
.perspective-folder-layer.focused .folder-click-overlay {
    pointer-events: none;
    z-index: 1;
}

/* 焦点图层的节点可交互 */
.perspective-folder-layer.focused .folder-nodes-container {
    z-index: 10;
}

.perspective-folder-layer.focused .folder-nodes-container .node {
    pointer-events: auto !important;
    cursor: pointer;
}

/* scroll hint removed - using system top bar instead */

/* 图层指示器（右侧） */
.perspective-indicators {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2000;
}

.layer-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.2s;
}

.layer-indicator:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.2);
}

.layer-indicator.active {
    background: white;
    border-color: white;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* focus name moved to system breadcrumb */

/* 透视视图底部控制按钮组 */
.perspective-bottom-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 2000;
}

.perspective-ctrl-btn {
    width: 26px;
    height: 26px;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.perspective-ctrl-btn:hover {
    color: rgba(255, 255, 255, 0.9);
}

.perspective-ctrl-btn:active {
    transform: scale(0.95);
}

.perspective-ctrl-btn.active {
    color: rgba(120, 180, 255, 1);
    background: rgba(120, 180, 255, 0.15);
    border-radius: 4px;
}

/* ===== Perspective Highlight Effects ===== */

/* 高亮模式：所有节点默认虚化 */
.perspective-highlight-mode .folder-nodes-container .node {
    opacity: 0.15 !important;
    filter: blur(2px) !important;
    transition: opacity 0.3s ease, filter 0.3s ease !important;
}

/* 高亮模式：被标记的节点保持清晰 */
.perspective-highlight-mode .folder-nodes-container .node.perspective-highlighted {
    opacity: 1 !important;
    filter: none !important;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6), 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}

/* 高亮模式下连接线也虚化 */
.perspective-highlight-mode .folder-connections-svg {
    opacity: 0.1;
    transition: opacity 0.3s ease;
}

/* ===== LIST VIEW (任务/想法管理界面) - Zara Design System ===== */

/* ZaraStyle CSS Variables */
:root {
    --zara-bg: #FFFFFF;
    --zara-text: #000000;
    --zara-text-secondary: rgba(0, 0, 0, 0.6);
    --zara-text-tertiary: rgba(0, 0, 0, 0.4);
    --zara-divider: rgba(0, 0, 0, 0.08);
    --zara-border: rgba(0, 0, 0, 0.15);
    --zara-hover-bg: rgba(0, 0, 0, 0.02);
    --zara-selected-bg: rgba(0, 0, 0, 0.04);
    --zara-padding-h: 20px;
    --zara-padding-v: 16px;
    --zara-divider-height: 0.5px;
}

#list-view-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--zara-bg);
    z-index: 800;
    display: flex;
    flex-direction: row;
    overflow: hidden;
}

/* Projects Sidebar (Left) - Zara Style - Same width as Tasks/Ideas columns */
.list-projects-sidebar {
    width: 320px;
    min-width: 320px;
    max-width: 320px;
    flex-shrink: 0;
    border-right: var(--zara-divider-height) solid var(--zara-divider);
    display: flex;
    flex-direction: column;
    background: var(--zara-bg);
}

.list-projects-header {
    padding: 14px var(--zara-padding-h);
    min-height: 52px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--zara-bg);
}

.list-projects-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.list-projects-icon {
    font-size: 11px;
    font-weight: 200;
    color: var(--zara-text-tertiary);
}

.list-projects-title {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 2px;
    color: var(--zara-text-tertiary);
    text-transform: uppercase;
}

.list-projects-add-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    font-size: 11px;
    font-weight: 200;
    color: var(--zara-text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.list-projects-add-btn:hover {
    color: var(--zara-text);
}

.list-projects-divider {
    height: var(--zara-divider-height);
    background: var(--zara-divider);
}

.list-projects-body {
    flex: 1;
    overflow-y: auto;
}

.list-projects-empty {
    padding: 24px var(--zara-padding-h);
    text-align: center;
}

.list-projects-empty-text {
    font-size: 9px;
    font-weight: 300;
    letter-spacing: 1px;
    color: var(--zara-text-tertiary);
}

.list-project-item {
    padding: 16px var(--zara-padding-h);
    cursor: pointer;
    transition: background 0.15s;
    background: transparent;
    border-bottom: var(--zara-divider-height) solid var(--zara-divider);
}

.list-project-item:last-child {
    border-bottom: none;
}

.list-project-item:hover {
    background: var(--zara-hover-bg);
}

.list-project-item.active {
    background: var(--zara-selected-bg);
}

.list-project-name {
    font-size: 13px;
    font-weight: 300;
    color: var(--zara-text);
    margin-bottom: 4px;
    letter-spacing: 0.2px;
}

.list-project-count {
    font-size: 9px;
    font-weight: 300;
    letter-spacing: 1px;
    color: var(--zara-text-tertiary);
    text-transform: uppercase;
}

/* Project Detail Panel - Zara Style */
.project-detail-panel {
    background: #fff;
}

.project-detail-count {
    font-size: 9px;
    font-weight: 300;
    letter-spacing: 1px;
    color: var(--zara-text-tertiary);
    text-transform: uppercase;
}

.project-detail-body {
    padding: 0;
}

.project-detail-section {
    background: transparent;
    margin: 0;
    border-radius: 0;
    overflow: visible;
}

.project-detail-section.ideas-section {
    background: transparent;
    border-top: var(--zara-divider-height) solid var(--zara-divider);
}

.project-detail-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px var(--zara-padding-h);
    background: transparent;
}

.project-detail-section-title {
    font-size: 9px;
    font-weight: 300;
    letter-spacing: 1px;
    color: var(--zara-text-tertiary);
    text-transform: uppercase;
}

.project-detail-score-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.3px;
    color: #fff;
    background: #b066d4;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

.project-detail-score-btn:hover {
    background: #9b4fc0;
}

.project-detail-score-btn svg {
    width: 12px;
    height: 12px;
    fill: #fff;
}

.project-detail-tasks {
    padding: 0;
}

.project-detail-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px var(--zara-padding-h);
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: var(--zara-divider-height) solid var(--zara-divider);
}

.project-detail-item:last-child {
    border-bottom: none;
}

.project-detail-item:hover {
    background: var(--zara-hover-bg);
}

.project-detail-item-checkbox {
    width: 14px;
    height: 14px;
    border: 1px solid var(--zara-border);
    flex-shrink: 0;
    position: relative;
}

.project-detail-item-checkbox.checked {
    background: var(--zara-text);
    border-color: var(--zara-text);
}

.project-detail-item-checkbox.checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 1px 1px 0;
    transform: rotate(45deg);
}

.project-detail-item-title {
    flex: 1;
    font-size: 13px;
    font-weight: 300;
    color: var(--zara-text);
    letter-spacing: 0.2px;
}

.project-detail-item-title.completed {
    color: var(--zara-text-tertiary);
    text-decoration: line-through;
}

.project-detail-item-delete {
    opacity: 0;
    padding: 4px;
    background: none;
    border: none;
    color: var(--zara-text-tertiary);
    cursor: pointer;
    transition: opacity 0.15s, color 0.15s;
}

.project-detail-item:hover .project-detail-item-delete {
    opacity: 1;
}

.project-detail-item-delete:hover {
    color: var(--zara-text);
}

/* Project Detail Ideas */
.project-detail-ideas {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
}

.project-detail-idea {
    background: transparent;
    padding: 16px var(--zara-padding-h);
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: var(--zara-divider-height) solid var(--zara-divider);
}

.project-detail-idea:last-child {
    border-bottom: none;
}

.project-detail-idea:hover {
    background: var(--zara-hover-bg);
}

.project-detail-idea-title {
    font-size: 13px;
    font-weight: 300;
    color: var(--zara-text);
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}

.project-detail-idea-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.project-detail-idea-created {
    font-size: 9px;
    font-weight: 300;
    letter-spacing: 0.5px;
    color: var(--zara-text-tertiary);
}

.project-detail-idea-date {
    font-size: 9px;
    font-weight: 300;
    letter-spacing: 0.5px;
    color: var(--zara-text-tertiary);
}

.project-detail-idea-tags {
    display: none;
}

.project-detail-idea-tag {
    display: none;
}

.project-detail-idea-no-tags {
    display: none;
}

.list-project-divider {
    height: var(--zara-divider-height);
    background: var(--zara-divider);
    margin: 0 var(--zara-padding-h);
}

/* Main Content Area (Tasks + Ideas side by side) */
.list-main-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

/* Column Container (Tasks or Ideas) - Zara Style - Fixed width 320px each */
.list-column {
    width: 320px;
    min-width: 320px;
    max-width: 320px;
    flex-shrink: 0;
    border-right: var(--zara-divider-height) solid var(--zara-divider);
    display: flex;
    flex-direction: column;
    background: var(--zara-bg);
}

.list-column:last-child {
    border-right: none;
}

/* Column Header - Zara Style */
.list-column-header {
    padding: 14px var(--zara-padding-h);
    min-height: 52px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--zara-bg);
    flex-shrink: 0;
}

.list-column-add-btn {
    width: 24px;
    height: 24px;
    border: 0.5px solid var(--border-color);
    background: transparent;
    font-size: 14px;
    font-weight: 300;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.list-column-add-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.list-column-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.list-column-icon {
    font-size: 11px;
    font-weight: 200;
    color: var(--zara-text-tertiary);
}

.list-column-title {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 2px;
    color: var(--zara-text-tertiary);
    text-transform: uppercase;
}

.list-column-divider {
    height: var(--zara-divider-height);
    background: var(--zara-divider);
}

.list-column-actions {
    display: flex;
    gap: 8px;
}

.list-column-action-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    font-size: 11px;
    font-weight: 200;
    color: var(--zara-text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.list-column-action-btn:hover {
    color: var(--zara-text);
}

/* Column Body (scrollable list) */
.list-column-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Detail Panel (Right) - Zara Style - Fills remaining space (largest) */
.list-detail-panel {
    flex: 1;
    min-width: 400px;
    border-left: var(--zara-divider-height) solid var(--zara-divider);
    display: flex;
    flex-direction: column;
    background: var(--zara-bg);
}

.list-detail-panel.hidden {
    display: none;
}

.list-detail-panel-header {
    padding: 14px var(--zara-padding-h);
    min-height: 52px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--zara-bg);
}

.list-detail-panel-header-left,
.list-detail-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Detail Navigator */
.detail-navigator {
    display: flex;
    align-items: center;
    gap: 4px;
}

.detail-nav-btn {
    width: 20px;
    height: 20px;
    border: 0.5px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 300;
    transition: all 0.15s;
}

.detail-nav-btn:hover:not(.disabled) {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.detail-nav-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.detail-nav-indicator {
    font-size: 10px;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    min-width: 28px;
    text-align: center;
}

.list-detail-panel-header-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.list-detail-panel-action-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
    padding: 0;
}

.list-detail-panel-action-btn:hover {
    color: rgba(0, 0, 0, 0.7);
}

/* Detail Header Actions - Zara Style */
.list-detail-header-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
}

.list-detail-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: rgba(0, 0, 0, 0.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.list-detail-action-btn:hover {
    color: rgba(0, 0, 0, 0.8);
}

.list-detail-action-btn:disabled {
    color: rgba(0, 0, 0, 0.15);
    cursor: not-allowed;
}

.list-detail-action-btn svg {
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Minimal Action Button - Zara Style */
.list-detail-action-btn-minimal {
    width: 24px;
    height: 24px;
    border: 0.5px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    padding: 0;
}

.list-detail-action-btn-minimal:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.list-detail-action-btn-minimal:disabled {
    color: var(--text-muted);
    border-color: var(--border-color);
    cursor: not-allowed;
    opacity: 0.5;
}

.list-detail-action-btn-minimal svg {
    width: 12px;
    height: 12px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.list-detail-panel-icon {
    font-size: 11px;
    font-weight: 200;
    color: var(--zara-text-tertiary);
}

.list-detail-panel-title {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 2px;
    color: var(--zara-text-tertiary);
    text-transform: uppercase;
}

.list-detail-panel-divider {
    height: var(--zara-divider-height);
    background: var(--zara-divider);
}

.list-detail-panel-actions {
    display: flex;
    gap: 8px;
}

.list-detail-panel-close {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    font-size: 11px;
    font-weight: 200;
    color: var(--zara-text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.list-detail-panel-close:hover {
    color: var(--zara-text);
}

.list-detail-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Detail Panel Sections - Zara Style */
.list-detail-section {
    padding: var(--zara-padding-h);
    border-bottom: var(--zara-divider-height) solid var(--zara-divider);
}

.list-detail-section:last-child {
    border-bottom: none;
}

.list-detail-section-label {
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 1px;
    color: var(--zara-text-tertiary);
    margin-bottom: 12px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}

.list-detail-section-label .section-icon {
    font-size: 11px;
    font-weight: 200;
}

/* Tags Section */
.list-detail-tags-input {
    width: 100%;
    padding: 10px 12px;
    border: 0.5px solid var(--border-color);
    background: transparent;
    font-size: 12px;
    font-weight: 300;
    outline: none;
    margin-bottom: 12px;
}

.list-detail-tags-input::placeholder {
    color: var(--text-muted);
}

.list-detail-tags-input:focus {
    border-color: var(--text-primary);
}

.list-detail-tags-group {
    margin-bottom: 12px;
}

.list-detail-tags-group-title {
    font-size: 8px;
    font-weight: 300;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.list-detail-tags-group-title .dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-secondary);
}

.list-detail-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.list-detail-tag-chip {
    padding: 4px 10px;
    background: transparent;
    border: 0.5px solid var(--border-color);
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.list-detail-tag-chip:hover {
    border-color: var(--text-secondary);
}

.list-detail-tag-chip .tag-count {
    font-size: 9px;
    color: var(--text-muted);
}

.list-detail-no-tags {
    font-size: 11px;
    font-weight: 300;
    color: var(--text-muted);
    font-style: italic;
}

/* Name Input */
.list-detail-name-input {
    width: 100%;
    padding: 12px;
    border: 0.5px solid var(--border-color);
    background: transparent;
    font-size: 14px;
    font-weight: 300;
    outline: none;
}

.list-detail-name-input:focus {
    border-color: var(--text-primary);
}

/* Importance/Score Field */
.list-detail-score-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.list-detail-score-input {
    width: 80px;
    padding: 8px 12px;
    border: 0.5px solid var(--border-color);
    background: transparent;
    font-size: 13px;
    font-weight: 300;
    outline: none;
    text-align: center;
}

.list-detail-score-input:focus {
    border-color: var(--text-primary);
}

.list-detail-score-range {
    font-size: 10px;
    font-weight: 300;
    color: var(--text-muted);
}

/* Schedule Section */
.list-detail-schedule-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-detail-schedule-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.list-detail-schedule-label {
    width: 60px;
    font-size: 11px;
    font-weight: 400;
    color: var(--text-secondary);
}

.list-detail-schedule-input {
    flex: 1;
    padding: 10px 12px;
    border: 0.5px solid var(--border-color);
    background: transparent;
    font-size: 13px;
    font-weight: 300;
    outline: none;
}

.list-detail-schedule-input:focus {
    border-color: var(--text-primary);
}

.list-detail-duration-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.list-detail-duration-input {
    width: 80px;
    padding: 10px 12px;
    border: 0.5px solid var(--border-color);
    background: transparent;
    font-size: 13px;
    font-weight: 300;
    outline: none;
    text-align: center;
}

.list-detail-duration-input:focus {
    border-color: var(--text-primary);
}

.list-detail-duration-unit {
    font-size: 11px;
    font-weight: 300;
    color: var(--text-muted);
}

/* Category Section */
.category-current {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--hover-bg);
    border: 0.5px solid var(--border-color);
    margin-bottom: 12px;
}

.category-color-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}

.category-name {
    flex: 1;
    font-size: 12px;
    font-weight: 400;
}

.category-remove-btn {
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-remove-btn:hover {
    color: var(--text-primary);
}

.category-empty {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.category-selection-label {
    font-size: 10px;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 0.5px solid var(--border-color);
    cursor: pointer;
    transition: all 0.15s;
}

.category-item:hover {
    border-color: var(--text-secondary);
}

.category-item.selected {
    border-color: var(--text-primary);
    background: var(--hover-bg);
}

.category-item-name {
    flex: 1;
    font-size: 11px;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-delete-btn {
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    color: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    font-size: 14px;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    transition: color 0.15s;
}

.category-delete-btn:hover {
    color: rgba(255, 59, 48, 1);
}

/* Category Modal */
.category-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.category-modal {
    background: var(--bg-primary);
    border: 0.5px solid var(--border-color);
    width: 360px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

.category-modal-header {
    padding: 16px 20px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    border-bottom: 0.5px solid var(--border-color);
}

.category-modal-body {
    padding: 20px;
}

.category-modal-field {
    margin-bottom: 20px;
}

.category-modal-field label {
    display: block;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.category-modal-field input {
    width: 100%;
    padding: 10px 12px;
    border: 0.5px solid var(--border-color);
    background: transparent;
    font-size: 13px;
    font-weight: 300;
    outline: none;
}

.category-modal-field input:focus {
    border-color: var(--text-primary);
}

/* Professional Color Picker - Zara Style */
.color-picker-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.color-spectrum {
    width: 100%;
    height: 120px;
    position: relative;
    cursor: crosshair;
    border: 0.5px solid var(--border-color);
    background: linear-gradient(to bottom, transparent, #000),
                linear-gradient(to right, #fff, hsl(0, 100%, 50%));
}

.color-spectrum-cursor {
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.3), inset 0 0 0 1px rgba(0,0,0,0.3);
    transform: translate(-50%, -50%);
    pointer-events: none;
    left: 100%;
    top: 0;
}

.color-hue-slider {
    width: 100%;
    height: 16px;
    position: relative;
}

.hue-input {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 12px;
    border: 0.5px solid var(--border-color);
    cursor: pointer;
    background: linear-gradient(to right,
        hsl(0, 100%, 50%),
        hsl(60, 100%, 50%),
        hsl(120, 100%, 50%),
        hsl(180, 100%, 50%),
        hsl(240, 100%, 50%),
        hsl(300, 100%, 50%),
        hsl(360, 100%, 50%)
    );
}

.hue-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 6px;
    height: 16px;
    background: var(--bg-primary);
    border: 0.5px solid var(--text-primary);
    cursor: ew-resize;
}

.hue-input::-moz-range-thumb {
    width: 6px;
    height: 16px;
    background: var(--bg-primary);
    border: 0.5px solid var(--text-primary);
    cursor: ew-resize;
    border-radius: 0;
}

.color-value-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-hex-label {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.color-hex-input {
    flex: 1;
    padding: 8px 10px;
    border: 0.5px solid var(--border-color);
    background: transparent;
    font-size: 12px;
    font-weight: 400;
    font-family: 'SF Mono', 'Monaco', monospace;
    letter-spacing: 1px;
    text-transform: uppercase;
    outline: none;
}

.color-hex-input:focus {
    border-color: var(--text-primary);
}

.category-modal-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--hover-bg);
    border: 0.5px solid var(--border-color);
}

.category-modal-preview #preview-name {
    font-size: 12px;
    font-weight: 400;
}

.category-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 20px;
    border-top: 0.5px solid var(--border-color);
}

.category-modal-btn {
    padding: 8px 16px;
    border: 0.5px solid var(--border-color);
    background: transparent;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.15s;
}

.category-modal-btn:hover {
    border-color: var(--text-primary);
}

.category-modal-btn.primary {
    background: var(--accent-blue);
    color: #FFFFFF;
    border-color: var(--accent-blue);
}

.category-modal-btn.primary:hover {
    background: #0066DD;
}

/* ===== Zara Confirm Dialog ===== */
.zara-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: background 0.2s ease;
}

.zara-confirm-overlay.active {
    background: rgba(0, 0, 0, 0.2);
}

.zara-confirm-dialog {
    background: var(--bg-primary);
    border: 0.5px solid var(--border-color);
    padding: 32px 40px;
    max-width: 380px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.2s ease;
}

.zara-confirm-overlay.active .zara-confirm-dialog {
    opacity: 1;
    transform: translateY(0);
}

.zara-confirm-message {
    font-size: 13px;
    font-weight: 300;
    line-height: 1.6;
    color: var(--text-primary);
    margin: 0 0 28px 0;
    text-align: center;
}

.zara-confirm-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.zara-confirm-btn {
    padding: 10px 28px;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border: 0.5px solid var(--border-color);
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}

.zara-confirm-btn.cancel {
    color: var(--text-secondary);
}

.zara-confirm-btn.cancel:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.zara-confirm-btn.confirm {
    background: #007AFF;
    color: #fff;
    border-color: #007AFF;
}

.zara-confirm-btn.confirm:hover {
    background: #0066DD;
}

/* ===== Conflict Resolution Dialog ===== */
.conflict-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.conflict-option-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    font-family: inherit;
}

.conflict-option-btn:hover {
    border-color: #007AFF;
    background: rgba(0, 122, 255, 0.03);
}

.conflict-option-btn:active {
    background: rgba(0, 122, 255, 0.08);
    transform: scale(0.99);
}

.conflict-option-label {
    font-size: 13px;
    font-weight: 400;
    color: #1a1a1a;
    letter-spacing: 0.3px;
}

.conflict-option-label strong {
    font-weight: 600;
    color: #007AFF;
}

.conflict-option-meta {
    font-size: 11px;
    font-weight: 400;
    color: #666;
    letter-spacing: 0.2px;
}

.conflict-option-note {
    font-size: 10px;
    font-weight: 300;
    color: #aaa;
    letter-spacing: 0.2px;
    margin-top: 2px;
}

/* Content Textarea */
.list-detail-content-textarea {
    width: 100%;
    min-height: 150px;
    padding: 12px;
    border: 0.5px solid var(--border-color);
    background: transparent;
    font-size: 12px;
    font-weight: 300;
    line-height: 1.6;
    outline: none;
    resize: vertical;
    font-family: inherit;
}

.list-detail-content-textarea:focus {
    border-color: var(--text-primary);
}

/* Feature Toggle */
.list-detail-feature-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}

.list-detail-feature-label {
    font-size: 11px;
    font-weight: 300;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.list-detail-feature-icon {
    font-size: 12px;
}

/* Toggle Switch */
.list-toggle-switch {
    position: relative;
    width: 40px;
    height: 22px;
    background: var(--border-color);
    border-radius: 11px;
    cursor: pointer;
    transition: background 0.2s;
}

.list-toggle-switch.active {
    background: var(--text-primary);
}

.list-toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}

.list-toggle-switch.active::after {
    transform: translateX(18px);
}

/* Zara Tags Edit View - Two Column Layout */
.zara-tags-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 0.5px solid var(--border-color);
    margin-bottom: 16px;
}

.zara-tags-search-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.zara-tags-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 1px;
    outline: none;
    color: var(--text-primary);
}

.zara-tags-search-input::placeholder {
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Two-column Tags Area */
.zara-tags-columns {
    display: flex;
    gap: 16px;
}

.zara-tags-column {
    flex: 1;
    border: 0.5px solid rgba(0, 0, 0, 0.08);
    padding: 12px;
    display: flex;
    flex-direction: column;
    max-height: 220px;
}

.zara-tags-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 0.5px solid var(--border-color);
}

.zara-tags-column-title {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1.5px;
    font-weight: 500;
    letter-spacing: 1px;
    color: rgba(0, 0, 0, 0.5);
}

.zara-tags-column-count {
    font-size: 10px;
    font-weight: 400;
    color: var(--text-muted);
}

.zara-tags-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.zara-tags-list::-webkit-scrollbar {
    width: 4px;
}

.zara-tags-list::-webkit-scrollbar-track {
    background: transparent;
}

.zara-tags-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 2px;
}

.zara-tag-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 0.5px solid var(--border-color);
    transition: all 0.15s;
}

.zara-tag-row:last-child {
    border-bottom: none;
}

.zara-tag-row:hover .zara-tag-text {
    color: var(--text-secondary);
}

.zara-tag-text {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.15s;
}

.zara-tag-btn {
    width: 20px;
    height: 20px;
    border: 0.5px solid var(--border-color);
    background: transparent;
    font-size: 14px;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    opacity: 0;
    transition: all 0.15s;
    flex-shrink: 0;
}

.zara-tag-row:hover .zara-tag-btn {
    opacity: 1;
}

.zara-tag-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.zara-tags-empty {
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 20px 0;
    text-align: center;
    text-transform: uppercase;
}

/* Section Header with Button */
.list-detail-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.list-detail-link-btn,
.list-detail-category-btn {
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 1px;
    color: var(--zara-text);
    padding: 6px 12px;
    border: 0.5px solid var(--zara-border);
    background: transparent;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.list-detail-link-btn:hover,
.list-detail-category-btn:hover {
    background: var(--zara-hover-bg);
    border-color: var(--zara-text);
}

/* Related Items */
.list-detail-related-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.list-detail-no-items {
    font-size: 11px;
    font-weight: 300;
    color: var(--zara-text-tertiary);
    padding: 16px 0;
}

.list-related-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 0.5px solid var(--zara-border);
    cursor: pointer;
    transition: background 0.15s;
}

.list-related-item:hover {
    background: var(--zara-hover-bg);
}

.list-related-item-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.list-related-item-icon {
    font-size: 12px;
    color: var(--zara-text-tertiary);
}

.list-related-item-title {
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 0.5px;
    color: var(--zara-text);
}

.list-related-item-remove {
    font-size: 14px;
    color: var(--zara-text-tertiary);
    cursor: pointer;
    transition: color 0.15s;
}

.list-related-item-remove:hover {
    color: var(--danger-color);
}

/* Actions Section */
.list-detail-actions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.list-detail-actions-grid.three-col .list-action-btn {
    min-width: calc(33.333% - 7px);
}

.list-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
    min-width: calc(50% - 5px);
    padding: 12px 16px;
    border: 0.5px solid var(--zara-border);
    background: transparent;
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 1px;
    color: var(--zara-text);
    cursor: pointer;
    transition: all 0.15s;
}

.list-action-btn.primary {
    background: var(--accent-blue);
    color: #fff;
    border-color: var(--accent-blue);
}

.list-action-btn.primary:hover {
    background: var(--accent-blue-dark);
    border-color: var(--accent-blue-dark);
}

.list-action-btn:hover {
    background: var(--zara-hover-bg);
    border-color: var(--zara-text);
}

.list-action-btn .action-icon {
    font-size: 12px;
}

.list-action-btn.danger {
    color: var(--danger-color);
    border-color: rgba(255, 59, 48, 0.3);
}

.list-action-btn.danger:hover {
    background: rgba(255, 59, 48, 0.05);
    border-color: var(--danger-color);
}

/* Footer Actions */
.list-detail-footer {
    padding: 16px 20px;
    border-top: 0.5px solid var(--border-color);
    display: flex;
    gap: 12px;
}

.list-detail-footer-btn {
    flex: 1;
    padding: 10px;
    border: 0.5px solid var(--border-strong);
    background: transparent;
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.list-detail-footer-btn:hover {
    background: var(--hover-bg);
}

.list-detail-footer-btn.primary {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.list-detail-footer-btn.primary:hover {
    background: #0066DD;
}

/* List View Empty State - Zara Style */
.list-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    padding: 60px 24px;
    gap: 20px;
}

.list-empty-icon-box {
    width: 52px;
    height: 52px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

.list-empty-plus {
    font-size: 18px;
    font-weight: 200;
    color: rgba(0, 0, 0, 0.35);
}

.list-empty-icon {
    font-size: 40px;
    opacity: 0.15;
}

.list-empty-title {
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 3px;
    color: rgba(0, 0, 0, 0.45);
    margin-top: 4px;
}

.list-empty-subtitle {
    font-size: 11px;
    font-weight: 200;
    letter-spacing: 0.3px;
    color: rgba(0, 0, 0, 0.3);
    margin-top: -12px;
}

.list-empty-actions {
    display: flex;
    gap: 16px;
    margin-top: 4px;
}

.list-empty-btn {
    padding: 8px 18px;
    border: 0.5px solid rgba(0, 0, 0, 0.18);
    background: transparent;
    font-size: 9px;
    font-weight: 300;
    letter-spacing: 1.5px;
    color: rgba(0, 0, 0, 0.55);
    cursor: pointer;
    transition: all 0.2s ease;
}

.list-empty-btn:hover {
    border-color: rgba(0, 0, 0, 0.4);
    color: rgba(0, 0, 0, 0.8);
}

/* ===== EXECUTION WHITEBOARD - Zara Style ===== */
.execution-whiteboard {
    width: 960px; /* 320 (projects) + 320 (tasks) + 320 (ideas) */
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    border-right: 0.5px solid rgba(0, 0, 0, 0.08);
}

.whiteboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px var(--zara-padding-h);
    background: #FFFFFF;
}

.whiteboard-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.whiteboard-select-btn {
    font-size: 9px;
    font-weight: 300;
    letter-spacing: 1px;
    color: var(--zara-text-secondary);
    padding: 6px 12px;
    border: 1px solid var(--zara-border);
    background: transparent;
    cursor: pointer;
    transition: all 0.15s;
}

.whiteboard-select-btn:hover {
    border-color: var(--zara-text-secondary);
}

.whiteboard-select-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #fff;
}

.whiteboard-remove-btn {
    font-size: 9px;
    font-weight: 300;
    letter-spacing: 1px;
    color: #fff;
    padding: 6px 12px;
    border: none;
    background: var(--accent-blue);
    cursor: pointer;
    transition: all 0.15s;
}

.whiteboard-remove-btn:hover {
    background: var(--accent-blue-dark);
}

.whiteboard-title {
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 2px;
    color: var(--zara-text-tertiary);
}

.whiteboard-close-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: rgba(0, 0, 0, 0.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
}

.whiteboard-close-btn:hover {
    color: rgba(0, 0, 0, 0.7);
}

.whiteboard-divider {
    height: 0.5px;
    background: rgba(0, 0, 0, 0.08);
}

.whiteboard-content {
    flex: 1;
    overflow-y: auto;
    background: #FFFFFF;
}

.whiteboard-grid {
    display: flex;
    flex-direction: column;
}

.whiteboard-card {
    background: #FFFFFF;
    padding: 20px var(--zara-padding-h);
    min-height: 140px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: var(--zara-divider-height) solid var(--zara-divider);
    position: relative;
}

.whiteboard-card:hover {
    background: var(--zara-hover-bg);
}

.whiteboard-card.selected {
    background: var(--zara-selected-bg);
}

.whiteboard-card.active {
    background: var(--zara-selected-bg);
}

.whiteboard-card-timestamp {
    position: absolute;
    top: 16px;
    right: var(--zara-padding-h);
    font-size: 18px;
    font-weight: 300;
    color: var(--accent-blue);
    letter-spacing: 1px;
    color: var(--zara-text);
}

.whiteboard-card-title {
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 0.3px;
    color: var(--zara-text);
    line-height: 1.4;
    margin-bottom: 12px;
    padding-right: 60px;
}

.whiteboard-card-content {
    flex: 1;
    font-size: 12px;
    font-weight: 300;
    letter-spacing: 0.2px;
    line-height: 1.7;
    color: var(--zara-text-secondary);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

.whiteboard-card-checkbox {
    position: absolute;
    bottom: 16px;
    right: var(--zara-padding-h);
    width: 18px;
    height: 18px;
    border: 1px solid var(--zara-border);
    background: #fff;
    transition: all 0.15s;
}

.whiteboard-card-checkbox.checked {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.whiteboard-card-checkbox.checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 4px;
    height: 9px;
    border: solid #fff;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}

.whiteboard-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
    gap: 20px;
    color: rgba(0, 0, 0, 0.3);
}

.whiteboard-empty svg {
    stroke: rgba(0, 0, 0, 0.15);
}

.whiteboard-empty-text {
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 2.5px;
    color: rgba(0, 0, 0, 0.35);
}

.whiteboard-empty-hint {
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 0.3px;
    color: rgba(0, 0, 0, 0.25);
}

/* ===== Search Bar - Zara Style ===== */
.list-columns-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.list-detail-panel-header-wrapper {
    position: relative;
}

.search-bar-container {
    padding: 10px var(--zara-padding-h);
    background: var(--zara-bg);
    border-bottom: var(--zara-divider-height) solid var(--zara-divider);
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-bar-input {
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 0.3px;
    color: var(--zara-text);
    border: 1px solid var(--zara-border);
    background: #fff;
    outline: none;
    width: 140px;
    transition: border-color 0.15s;
}

.search-bar-input::placeholder {
    color: var(--zara-text-tertiary);
}

.search-bar-input:focus {
    border-color: var(--zara-text-secondary);
}

.search-bar-buttons {
    display: flex;
    gap: 0;
}

.search-bar-btn {
    padding: 6px 10px;
    font-size: 9px;
    font-weight: 300;
    letter-spacing: 0.5px;
    color: var(--zara-text-secondary);
    background: #fff;
    border: 1px solid var(--zara-border);
    cursor: pointer;
    transition: all 0.15s;
}

.search-bar-btn:first-child {
    border-right: none;
}

.search-bar-btn:hover {
    background: var(--zara-hover-bg);
}

.search-bar-btn.active {
    background: var(--zara-text);
    border-color: var(--zara-text);
    color: #fff;
}

.search-bar-close {
    width: 24px;
    height: 24px;
    border: 1px solid var(--zara-border);
    background: #fff;
    font-size: 14px;
    font-weight: 300;
    color: var(--zara-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.search-bar-close:hover {
    border-color: var(--zara-text-secondary);
}

/* Tag Dropdown */
.search-tag-dropdown {
    margin-top: 6px;
    max-height: 180px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--zara-border);
}

.search-tag-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    cursor: pointer;
    transition: background 0.15s;
}

.search-tag-item:hover {
    background: var(--zara-hover-bg);
}

.search-tag-item.selected {
    background: var(--zara-selected-bg);
}

.search-tag-check {
    width: 14px;
    font-size: 10px;
    color: var(--zara-text);
}

.search-tag-name {
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 0.3px;
    color: var(--zara-text);
}

.search-tag-empty {
    padding: 16px;
    text-align: center;
    font-size: 9px;
    font-weight: 300;
    letter-spacing: 1px;
    color: var(--zara-text-tertiary);
}

/* Active state for search button */
.list-detail-action-btn-minimal.active {
    background: var(--zara-selected-bg);
}

/* Active state for execution cycle button */
.list-action-btn.active {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.2);
}

/* ===== LONG TEXT STORAGE - Zara Style ===== */
.long-text-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.long-text-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.long-text-page-indicator {
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 0.5px;
    color: rgba(0, 0, 0, 0.45);
    min-width: 36px;
    text-align: center;
}

.long-text-editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    position: relative;
}

.long-text-editor {
    flex: 1;
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    padding: 24px 28px;
    font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 0.2px;
    line-height: 1.8;
    color: #1A1A1A;
    background: #FFFFFF;
}

/* Long Text Editor - Rich Text */
.long-text-editor.rich-text {
    overflow-y: auto;
    white-space: pre-wrap;
    outline: none;
    -webkit-user-modify: read-write;
    overflow-wrap: break-word;
}

.long-text-editor.rich-text[contenteditable]:empty:before {
    content: attr(data-placeholder);
    color: rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.long-text-blue-mark {
    color: #4A90D9;
}

.long-text-mark-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.long-text-mark-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.mark-circle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: block;
}

.mark-circle.blue {
    background-color: #4A90D9;
}

.header-divider {
    width: 1px;
    height: 14px;
    background: rgba(0, 0, 0, 0.1);
    margin: 0 4px;
}

.long-text-editor::placeholder {
    color: rgba(0, 0, 0, 0.25);
}

.long-text-char-count {
    position: absolute;
    bottom: 16px;
    right: 24px;
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 0.5px;
    color: rgba(0, 0, 0, 0.3);
}

/* Gallery Mode */
.long-text-gallery {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 20px 24px;
    overflow-y: auto;
    background: #FAFAFA;
}

.long-text-gallery-card {
    background: #FFFFFF;
    border: 0.5px solid rgba(0, 0, 0, 0.08);
    padding: 16px;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: all 0.15s ease;
}

.long-text-gallery-card:hover {
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.long-text-gallery-card.selected {
    border-color: rgba(0, 0, 0, 0.4);
}

.long-text-gallery-preview {
    flex: 1;
    font-size: 11px;
    font-weight: 300;
    line-height: 1.6;
    color: rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
}

.long-text-gallery-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 0.5px solid rgba(0, 0, 0, 0.06);
}

.long-text-gallery-page {
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 1px;
    color: rgba(0, 0, 0, 0.4);
    text-transform: uppercase;
}

.long-text-gallery-chars {
    font-size: 9px;
    font-weight: 300;
    color: rgba(0, 0, 0, 0.3);
}

/* ===== AI CHAT PANEL - Zara Style ===== */
.ai-chat-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.ai-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Welcome message */
.ai-chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 12px;
    padding: 40px;
}

.ai-chat-welcome-icon {
    font-size: 24px;
    color: rgba(0, 0, 0, 0.15);
    font-weight: 200;
}

.ai-chat-welcome-title {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 2px;
    color: rgba(0, 0, 0, 0.4);
}

.ai-chat-welcome-subtitle {
    font-size: 10px;
    font-weight: 300;
    color: rgba(0, 0, 0, 0.3);
}

/* Chat messages */
.chat-message {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 85%;
}

.chat-message-user {
    align-self: flex-end;
}

.chat-message-user .chat-message-content {
    background: rgba(0, 0, 0, 0.04);
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    color: #000;
}

.chat-message-assistant {
    align-self: flex-start;
}

.chat-message-label {
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 1px;
    color: rgba(0, 0, 0, 0.3);
}

.chat-message-assistant .chat-message-content {
    background: white;
    border: 0.5px solid rgba(0, 0, 0, 0.06);
    padding: 12px 14px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 300;
    line-height: 1.6;
    color: #000;
}

/* Markdown Content Styles - Zara */
.md-content {
    font-family: inherit;
}

.md-h1 {
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin: 16px 0 8px 0;
    color: #000;
}

.md-h2 {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin: 14px 0 6px 0;
    color: #000;
}

.md-h3 {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin: 12px 0 4px 0;
    color: #000;
}

.md-h4, .md-h5, .md-h6 {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin: 10px 0 4px 0;
    color: rgba(0, 0, 0, 0.8);
}

.md-p {
    margin: 4px 0;
    line-height: 1.6;
}

.md-spacer {
    height: 8px;
}

.md-list-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 4px 0;
    padding-left: 4px;
}

.md-bullet {
    color: rgba(0, 0, 0, 0.4);
    font-size: 10px;
    margin-top: 2px;
    flex-shrink: 0;
}

.md-number {
    color: rgba(0, 0, 0, 0.5);
    font-size: 12px;
    font-weight: 500;
    min-width: 20px;
    flex-shrink: 0;
}

.md-quote {
    border-left: 2px solid rgba(0, 0, 0, 0.15);
    padding-left: 12px;
    margin: 8px 0;
    color: rgba(0, 0, 0, 0.6);
    font-style: italic;
}

.md-hr {
    border: none;
    border-top: 0.5px solid rgba(0, 0, 0, 0.1);
    margin: 12px 0;
}

.md-code-block {
    background: rgba(0, 0, 0, 0.03);
    padding: 10px 12px;
    border-radius: 3px;
    font-family: 'SF Mono', 'Menlo', 'Monaco', monospace;
    font-size: 11px;
    line-height: 1.5;
    overflow-x: auto;
    margin: 8px 0;
    white-space: pre;
}

.md-inline-code {
    background: rgba(0, 0, 0, 0.04);
    padding: 1px 4px;
    border-radius: 2px;
    font-family: 'SF Mono', 'Menlo', 'Monaco', monospace;
    font-size: 11px;
}

.md-content strong {
    font-weight: 600;
}

.md-content em {
    font-style: italic;
}

.md-content del {
    text-decoration: line-through;
    color: rgba(0, 0, 0, 0.4);
}

.md-link {
    color: var(--accent-blue);
    text-decoration: none;
}

/* Thinking Bubble - Zara Style */
.chat-thinking-bubble {
    margin-bottom: 8px;
    border: 0.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.01);
    overflow: hidden;
}

.chat-thinking-bubble.live {
    border-color: rgba(0, 0, 0, 0.12);
    background: rgba(0, 0, 0, 0.02);
}

.chat-thinking-header {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 6px 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
}

.chat-thinking-header:hover {
    background: rgba(0, 0, 0, 0.02);
}

.chat-thinking-dots {
    font-size: 10px;
    font-weight: 300;
    color: rgba(0, 0, 0, 0.35);
    letter-spacing: 1px;
}

.chat-thinking-dots.animated {
    animation: thinkingDots 1.5s ease-in-out infinite;
}

@keyframes thinkingDots {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.chat-thinking-label {
    font-size: 8px;
    font-weight: 500;
    letter-spacing: 1.5px;
    color: rgba(0, 0, 0, 0.35);
    flex: 1;
}

.chat-thinking-toggle {
    font-size: 10px;
    font-weight: 300;
    color: rgba(0, 0, 0, 0.25);
}

.chat-thinking-content {
    padding: 0 10px 10px 10px;
    font-size: 10px;
    font-weight: 300;
    line-height: 1.6;
    color: rgba(0, 0, 0, 0.45);
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
    border-top: 0.5px solid rgba(0, 0, 0, 0.06);
}

.chat-thinking-bubble.collapsed .chat-thinking-content {
    display: none;
}

/* Typing indicator */
.chat-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 14px;
    background: white;
    border: 0.5px solid rgba(0, 0, 0, 0.06);
    border-radius: 4px;
}

.chat-typing-indicator span {
    width: 4px;
    height: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    animation: typingDot 1.4s infinite ease-in-out;
}

.chat-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}

/* Input area */
.ai-chat-input-area {
    border-top: 0.5px solid rgba(0, 0, 0, 0.06);
    background: white;
}

.ai-chat-input-container {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding: 16px;
}

.ai-chat-input {
    flex: 1;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 300;
    line-height: 1.4;
    resize: none;
    min-height: 20px;
    max-height: 120px;
    color: #000;
    background: transparent;
}

.ai-chat-input::placeholder {
    color: rgba(0, 0, 0, 0.3);
}

.ai-chat-send-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0.5px solid rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.15s ease;
    color: rgba(0, 0, 0, 0.5);
}

.ai-chat-send-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #000;
}

/* AI Model Selector Button */
.ai-chat-header-left {
    display: flex;
    align-items: center;
    position: relative;
}

.ai-model-selector-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: transparent;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.3px;
    color: rgba(0, 0, 0, 0.7);
    cursor: pointer;
    transition: all 0.15s ease;
}

.ai-model-selector-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.2);
}

.ai-model-selector-btn svg {
    opacity: 0.5;
}

/* AI Model Dropdown Backdrop */
.ai-model-dropdown-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
}

/* AI Model Dropdown */
.ai-model-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    min-width: 180px;
    background: #fff;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    overflow: hidden;
}

.ai-model-dropdown-section {
    padding: 8px 0;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
}

.ai-model-dropdown-section:last-child {
    border-bottom: none;
}

.ai-model-dropdown-label {
    padding: 4px 12px 6px;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 1px;
    color: rgba(0, 0, 0, 0.35);
}

.ai-model-dropdown-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: 12px;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.7);
    text-align: left;
    cursor: pointer;
    transition: all 0.1s ease;
}

.ai-model-dropdown-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.ai-model-dropdown-item.active {
    background: rgba(0, 0, 0, 0.06);
    color: #000;
    font-weight: 500;
}

/* AI Map Selector Dropdown */
.ai-map-dropdown-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
}

.ai-map-dropdown {
    position: absolute;
    top: 48px;
    right: 12px;
    width: 280px;
    max-height: 400px;
    background: #fff;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.ai-map-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1px;
    color: rgba(0, 0, 0, 0.5);
}

.ai-map-clear-btn {
    background: transparent;
    border: none;
    font-size: 10px;
    color: var(--accent-blue);
    cursor: pointer;
}

.ai-map-clear-btn:hover {
    text-decoration: underline;
}

.ai-map-dropdown-content {
    overflow-y: auto;
    padding: 8px 0;
}

.ai-map-selector-group {
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.04);
}

.ai-map-selector-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.ai-map-selector-group-title {
    padding: 4px 16px;
    font-size: 10px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-map-selector-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.1s ease;
}

.ai-map-selector-item:hover {
    background: rgba(0, 0, 0, 0.03);
}

.ai-map-selector-item.selected {
    background: rgba(0, 0, 0, 0.05);
}

.ai-map-checkbox {
    width: 16px;
    height: 16px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 3px;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: all 0.15s ease;
}

.ai-map-selector-item.selected .ai-map-checkbox {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.ai-map-name {
    font-size: 13px;
    color: rgba(0, 0, 0, 0.8);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-map-empty {
    padding: 20px;
    text-align: center;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.35);
}

.list-detail-action-btn-minimal.has-selection {
    color: var(--accent-blue);
    background: rgba(0, 122, 255, 0.1);
    position: relative;
}

.ai-context-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--accent-blue);
    color: white;
    font-size: 9px;
    min-width: 14px;
    height: 14px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    font-weight: 600;
    border: 1px solid #fff;
}

/* AI Chat History Panel */
.ai-chat-history-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.ai-chat-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1px;
    color: rgba(0, 0, 0, 0.5);
}

.ai-chat-history-close {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    font-size: 16px;
    color: rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: color 0.15s ease;
}

.ai-chat-history-close:hover {
    color: rgba(0, 0, 0, 0.8);
}

.ai-chat-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.ai-chat-history-empty {
    padding: 40px 20px;
    text-align: center;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.35);
}

.ai-chat-history-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.1s ease;
    position: relative;
}

.ai-chat-history-item:hover {
    background: rgba(0, 0, 0, 0.03);
}

.ai-chat-history-item.active {
    background: rgba(0, 0, 0, 0.05);
}

.ai-chat-history-item-title {
    flex: 1;
    font-size: 12px;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
}

.ai-chat-history-item-date {
    font-size: 10px;
    color: rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
}

.ai-chat-history-item-delete {
    position: absolute;
    right: 8px;
    width: 20px;
    height: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: color 0.15s ease;
}

.ai-chat-history-item:hover .ai-chat-history-item-delete {
    display: flex;
}

.ai-chat-history-item:hover .ai-chat-history-item-date {
    display: none;
}

.ai-chat-history-item-delete:hover {
    color: #ff3b30;
}

/* Active state for action buttons */
.list-detail-action-btn-minimal.active {
    color: rgba(0, 0, 0, 0.8);
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

/* Projects sidebar AI button */
.list-projects-action-btn {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    color: rgba(0, 0, 0, 0.35);
}

.list-projects-action-btn:hover {
    color: rgba(0, 0, 0, 0.6);
}

.list-projects-action-btn svg {
    width: 14px;
    height: 14px;
}

/* Disabled button state */
.list-detail-action-btn.disabled,
.list-detail-action-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.list-detail-action-btn.active {
    color: rgba(0, 0, 0, 0.8);
    background: rgba(0, 0, 0, 0.05);
}

/* Task/Idea Row Item - Zara Style (matches TaskListItemContent) */
.list-row-item {
    padding: 16px var(--zara-padding-h);
    margin-bottom: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.15s;
    background: var(--zara-bg);
}

.list-row-item:hover {
    background: transparent;
}

.list-row-item:hover .list-row-title {
    color: var(--text-secondary);
}

.list-row-item.selected {
    background: var(--hover-bg);
    border-left: 2px solid var(--accent-blue);
    padding-left: calc(var(--zara-padding-h) - 2px);
}

.list-row-item.selected .list-row-title {
    font-weight: 500;
}

.list-row-item.completed .list-row-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

/* List item linking mode */
.list-row-item.link-selectable {
    cursor: pointer;
    border: 0.5px solid transparent;
    transition: all 0.15s ease;
}

.list-row-item.link-selectable:hover {
    border-color: var(--border-strong);
    background: var(--hover-bg);
}

.list-row-item.link-selected {
    border-color: var(--accent-blue) !important;
    background: rgba(0, 122, 255, 0.05) !important;
    position: relative;
}

.list-row-item .link-check {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 0.5px solid var(--border-strong);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.list-row-divider {
    display: none;
}

/* Row Content */
.list-row-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Title - Zara Style (uppercase, 11px, light, tracking 1.5) */
.list-row-title {
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.3px;
    color: var(--text-primary);
    line-height: 1.4;
    transition: color 0.15s;
}

.list-row-title.completed {
    text-decoration: line-through;
    color: var(--zara-text-secondary);
}

.list-row-title.archived {
    color: var(--zara-text-secondary);
}

/* Minimal Time Display */
.list-row-time-minimal {
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.list-row-time-sep {
    color: var(--text-muted);
    font-size: 9px;
}

/* Description/Notes */
.list-row-description {
    font-size: 9px;
    font-weight: 300;
    letter-spacing: 0.5px;
    color: var(--zara-text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Time Row */
.list-row-time {
    display: flex;
    align-items: center;
    gap: 12px;
}

.list-row-time-item {
    display: flex;
    align-items: center;
    gap: 3px;
}

.list-row-time-icon {
    font-size: 8px;
    font-weight: 200;
    color: var(--zara-text-tertiary);
}

.list-row-time-text {
    font-size: 8px;
    font-weight: 300;
    letter-spacing: 0.5px;
    color: var(--zara-text-tertiary);
}

/* Row Tags - Zara Style */
.list-row-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.list-row-tag {
    padding: 3px 6px;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    background: transparent;
    font-size: 7px;
    font-weight: 300;
    letter-spacing: 1px;
    color: var(--zara-text-secondary);
    text-transform: uppercase;
}

.list-row-no-tags {
    font-size: 8px;
    font-weight: 300;
    letter-spacing: 0.5px;
    color: var(--zara-text-tertiary);
    text-transform: uppercase;
}

/* Scoring Summary */
.list-row-summary {
    font-size: 8px;
    font-weight: 300;
    letter-spacing: 0.5px;
    color: var(--zara-text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Row Right Side (Date + Score) */
.list-row-right {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    min-width: 50px;
}

.list-row-date {
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.3px;
    color: var(--zara-text-secondary);
    text-transform: uppercase;
}

.list-row-score {
    font-size: 9px;
    font-weight: 300;
    letter-spacing: 0.5px;
    color: var(--zara-text-tertiary);
}

/* Row Action Button - Zara Style */
.list-row-action-btn {
    width: 28px;
    height: 28px;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    background: transparent;
    font-size: 10px;
    font-weight: 200;
    color: var(--zara-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.list-row-action-btn:hover {
    border-color: var(--zara-text);
    color: var(--zara-text);
}

/* ===== TASK/IDEA DETAIL VIEW ===== */
.list-detail-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    z-index: 810;
}

.list-detail-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 0.5px solid var(--border-color);
    background: var(--bg-primary);
}

.list-detail-back-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 12px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.list-detail-back-btn:hover {
    opacity: 0.7;
}

.list-detail-title-area {
    flex: 1;
    text-align: center;
}

.list-detail-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 2px;
    color: var(--text-secondary);
}

.list-detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.list-detail-main-title {
    font-size: 18px;
    font-weight: 300;
    letter-spacing: 1px;
    color: var(--text-primary);
    margin-bottom: 24px;
    text-transform: uppercase;
}

.list-detail-section {
    margin-bottom: 24px;
}

.list-detail-section-label {
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.list-detail-section-content {
    font-size: 13px;
    font-weight: 300;
    color: rgba(0, 0, 0, 0.8);
    line-height: 1.6;
}

.list-detail-time-row {
    display: flex;
    gap: 24px;
}

.list-detail-time-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.list-detail-time-value {
    font-size: 11px;
    font-weight: 300;
    color: var(--text-primary);
}

.list-detail-time-sub {
    font-size: 11px;
    font-weight: 300;
    color: var(--text-secondary);
}

/* Detail Tags */
.list-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.list-detail-tag {
    padding: 4px 8px;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    font-size: 9px;
    font-weight: 300;
    letter-spacing: 1px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* Detail Actions */
.list-detail-actions {
    padding: 20px 24px;
    border-top: 0.5px solid var(--border-color);
    display: flex;
    gap: 12px;
}

.list-detail-action-btn {
    flex: 1;
    padding: 12px;
    border: 0.5px solid var(--border-strong);
    background: transparent;
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.15s;
}

.list-detail-action-btn:hover {
    background: var(--hover-bg);
}

.list-detail-action-btn.primary {
    background: var(--accent-blue);
    color: #FFFFFF;
    border-color: var(--accent-blue);
}

.list-detail-action-btn.primary:hover {
    background: #0066DD;
}

.list-detail-action-btn.danger {
    color: var(--danger-color);
    border-color: var(--danger-color);
}

.list-detail-action-btn.danger:hover {
    background: rgba(255, 59, 48, 0.1);
}

/* ===== TASK/IDEA EDIT FORM ===== */
.list-edit-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.list-edit-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.list-edit-label {
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.list-edit-input {
    width: 100%;
    padding: 10px 12px;
    border: 0.5px solid var(--border-strong);
    background: transparent;
    font-size: 13px;
    font-weight: 300;
    outline: none;
    transition: border-color 0.15s;
}

.list-edit-input:focus {
    border-color: var(--text-primary);
}

.list-edit-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 0.5px solid var(--border-strong);
    background: transparent;
    font-size: 13px;
    font-weight: 300;
    outline: none;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

.list-edit-textarea:focus {
    border-color: var(--text-primary);
}

.list-edit-row {
    display: flex;
    gap: 16px;
}

.list-edit-row .list-edit-field {
    flex: 1;
}

/* Floating Add Button */
.list-fab {
    position: absolute;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--text-primary);
    color: var(--bg-primary);
    font-size: 24px;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transition: all 0.2s;
    z-index: 820;
}

.list-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.list-fab:active {
    transform: scale(0.95);
}

/* ========================================
   DAY/WEEK VIEW - Fluid Calendar Interface
   Virtual Sliding Window Architecture:
   - Viewport/Track model for 60fps scrolling
   - CSS Transform based panning
   - Physics engine for momentum/snapping
======================================== */

/* Main Container */
#calendar-view-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #FFFFFF;
    z-index: 800;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Calendar Header */
.calendar-header {
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
    z-index: 100;
}

.calendar-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
}

.calendar-header-title {
    font-size: 16px;
    font-weight: 300;
    letter-spacing: 2px;
    color: #000;
    text-transform: uppercase;
}

.calendar-header-subtitle {
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 1px;
    color: rgba(0, 0, 0, 0.6);
    text-transform: uppercase;
    margin-top: 2px;
}

.calendar-header-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Zara-style calendar navigation buttons */
.calendar-nav-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(0, 0, 0, 0.5);
    transition: color 0.15s;
    padding: 0;
}

.calendar-nav-btn:hover {
    color: #000;
}

.calendar-nav-btn.today {
    width: auto;
    padding: 0 16px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: rgba(0, 0, 0, 0.6);
}

.calendar-nav-btn.today:hover {
    color: #000;
}

.calendar-nav-btn svg {
    width: 16px;
    height: 16px;
}

/* ===== VIRTUAL SLIDING WINDOW: HEADER ===== */
.calendar-day-headers {
    display: flex;
    align-items: stretch;
    overflow: hidden;
}

.calendar-time-column-header {
    width: 60px;
    min-width: 60px;
    flex-shrink: 0;
    border-right: 0.5px solid rgba(0, 0, 0, 0.06);
    background: #FFFFFF;
    z-index: 20;
}

/* Header Viewport - clips the sliding header track */
.calendar-header-viewport {
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* Header Track - transforms with horizontalOffset */
.calendar-header-track {
    display: flex;
    will-change: transform;
    /* Width set dynamically: (bufferDays * 2 + visibleDays) * dayWidth */
}

.calendar-day-header {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
    transition: background 0.15s;
    /* Width set dynamically */
}

.calendar-day-header:hover {
    background: rgba(0, 0, 0, 0.02);
}

.calendar-day-header.today {
    position: relative;
}

.calendar-day-header.today::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 20px;
    height: 1.5px;
    background: #000;
}

.calendar-day-name {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1px;
    color: rgba(0, 0, 0, 0.4);
    text-transform: uppercase;
}

.calendar-day-header.today .calendar-day-name {
    color: #000;
}

.calendar-day-number {
    font-size: 14px;
    font-weight: 300;
    color: rgba(0, 0, 0, 0.8);
    margin-top: 4px;
}

.calendar-day-header.today .calendar-day-number {
    font-weight: 600;
    color: #000;
}

/* ===== VIRTUAL SLIDING WINDOW: BODY ===== */
.calendar-body {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}

/* Vertical Scroll Container - handles up/down scrolling natively */
.calendar-scroll-container {
    flex: 1;
    display: flex;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
}

.calendar-scroll-container::-webkit-scrollbar {
    width: 8px;
}

.calendar-scroll-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
}

.calendar-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

.calendar-scroll-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Time Column - static, stays in place */
.calendar-time-column {
    width: 60px;
    min-width: 60px;
    flex-shrink: 0;
    background: #FFFFFF;
    z-index: 10;
}

.calendar-time-label {
    height: 60px; /* hourHeight */
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding-right: 12px;
    padding-top: 0;
    font-size: 9px;
    font-weight: 300;
    color: rgba(0, 0, 0, 0.4);
    position: relative;
}

.calendar-time-label::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 0.5px;
    background: rgba(0, 0, 0, 0.1);
}

/* Grid Viewport - clips the sliding grid track */
.calendar-grid-viewport {
    flex: 1;
    overflow-x: hidden;
    overflow-y: visible; /* Allow vertical content to determine height */
    position: relative;
    touch-action: pan-y; /* Allow vertical touch scroll, block horizontal */
    min-height: calc(60px * 24); /* Force height to full day length so parent scrolls */
}

/* Grid Track - transforms with horizontalOffset */
.calendar-grid-track {
    display: flex;
    will-change: transform;
    height: calc(60px * 24); /* 24 hours * hourHeight */
    /* Width set dynamically */
}

/* Individual Day Column */
.calendar-day-column {
    flex-shrink: 0;
    position: relative;
    border-left: 0.5px solid rgba(0, 0, 0, 0.06);
    height: 100%;
    /* Width set dynamically */
}

.calendar-day-column:first-child {
    border-left: none;
}

/* Hour Grid Lines */
.calendar-hour-row {
    height: 60px; /* hourHeight */
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
    position: relative;
}

/* Current Time Indicator */
.calendar-now-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: #FF3B30;
    z-index: 50;
    pointer-events: none;
}

.calendar-now-line::before {
    content: '';
    position: absolute;
    left: -4px;
    top: -3px;
    width: 8px;
    height: 8px;
    background: #FF3B30;
    border-radius: 50%;
}

/* Task Block - Zara Minimalist Style */
.calendar-task-block {
    position: absolute;
    left: 4px;
    right: 4px;
    background: #FFFFFF;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    cursor: grab;
    overflow: hidden;
    z-index: 20;
    /* No transition on transform for smooth dragging */
}

.calendar-task-block:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.calendar-task-block.selected {
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.25);
    border-color: var(--accent-blue);
    z-index: 30;
}

.calendar-task-block.dragging {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    z-index: 1000;
    cursor: grabbing;
    opacity: 0.95;
    pointer-events: none;
}

/* Task Left Accent Bar (Zara style) */
.calendar-task-accent {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
}

.calendar-task-accent.blue { background: #007AFF; }
.calendar-task-accent.green { background: #34C759; }
.calendar-task-accent.orange { background: #FF9500; }
.calendar-task-accent.red { background: #FF3B30; }
.calendar-task-accent.purple { background: #AF52DE; }
.calendar-task-accent.gray { background: #8E8E93; }

/* Task Content */
.calendar-task-content {
    padding: 4px 6px 4px 10px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.calendar-task-time {
    font-size: 9px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.6);
    margin-bottom: 2px;
}

.calendar-task-title {
    font-size: 10px;
    font-weight: 600;
    color: #000;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.calendar-task-block.archived .calendar-task-title {
    color: rgba(0, 0, 0, 0.4);
}

/* Resize Handles */
.calendar-task-resize-top,
.calendar-task-resize-bottom {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 4px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 2px;
    opacity: 0;
    cursor: ns-resize;
    transition: opacity 0.15s;
    /* Extend touch hit area without changing visual size */
    touch-action: none;
}

.calendar-task-resize-top::before,
.calendar-task-resize-bottom::before {
    content: '';
    position: absolute;
    left: -20px;
    right: -20px;
    top: -12px;
    bottom: -12px;
}

.calendar-task-block.selected .calendar-task-resize-top,
.calendar-task-block.selected .calendar-task-resize-bottom {
    opacity: 1;
}

.calendar-task-resize-top {
    top: 3px;
}

.calendar-task-resize-bottom {
    bottom: 3px;
}

/* Snap Animation Class */
.calendar-snapping .calendar-header-track,
.calendar-snapping .calendar-grid-track {
    transition: transform 0.15s ease-out;
}

/* ===== CALENDAR DETAIL PANEL ===== */
.calendar-detail-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 340px;
    height: 100%;
    background: var(--bg-primary);
    border-left: 0.5px solid var(--border-color);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.05);
    z-index: 900;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.2s ease-out;
    overflow: hidden;
}

.calendar-detail-panel.visible {
    transform: translateX(0);
}

.calendar-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 0.5px solid var(--border-color);
    flex-shrink: 0;
    min-height: 52px;
}

.calendar-detail-title {
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.calendar-detail-close {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    font-size: 16px;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
}

.calendar-detail-close:hover {
    color: var(--text-primary);
}

.calendar-detail-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Use list-detail styles for calendar detail panel content */
.calendar-detail-content .list-detail-section {
    padding: 20px;
    border-bottom: 0.5px solid var(--border-color);
}

.calendar-detail-content .list-detail-section:last-child {
    border-bottom: none;
}

.calendar-detail-content .zara-tags-columns {
    flex-direction: column;
}

.calendar-detail-content .zara-tags-column {
    min-width: 100%;
}

.calendar-detail-content .category-grid {
    grid-template-columns: 1fr;
}

.calendar-detail-actions {
    padding: 16px 20px;
    border-top: 0.5px solid var(--border-color);
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.calendar-detail-btn {
    flex: 1;
    padding: 10px 16px;
    border: 0.5px solid var(--border-color);
    background: transparent;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s;
}

.calendar-detail-btn:hover {
    background: rgba(0, 0, 0, 0.04);
}

.calendar-detail-btn.primary {
    background: var(--accent-blue);
    color: #FFF;
    border-color: var(--accent-blue);
}

.calendar-detail-btn.primary:hover {
    background: #0066DD;
}

.calendar-detail-btn.danger {
    color: #FF3B30;
    border-color: rgba(255, 59, 48, 0.3);
}

.calendar-detail-btn.danger:hover {
    background: rgba(255, 59, 48, 0.1);
}

/* ===== CALENDAR CONTEXT MENU ===== */
.calendar-context-menu {
    position: fixed;
    min-width: 180px;
    background: #FFFFFF;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    padding: 6px 0;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.1s, transform 0.1s;
    pointer-events: none;
}

.calendar-context-menu.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.calendar-context-menu-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 400;
    color: #000;
    cursor: pointer;
    transition: background 0.1s;
}

.calendar-context-menu-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.calendar-context-menu-item.danger {
    color: #FF3B30;
}

.calendar-context-menu-item.danger:hover {
    background: rgba(255, 59, 48, 0.1);
}

.calendar-context-menu-divider {
    height: 0.5px;
    background: rgba(0, 0, 0, 0.08);
    margin: 6px 0;
}

.calendar-context-menu-submenu {
    position: relative;
}

.calendar-context-menu-submenu::after {
    content: '›';
    position: absolute;
    right: 12px;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.4);
}

.calendar-context-submenu {
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 160px;
    background: #FFFFFF;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 6px 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s;
}

.calendar-context-menu-submenu:hover .calendar-context-submenu {
    opacity: 1;
    pointer-events: auto;
}

/* ========================================
   MONTH VIEW
   Calendar grid with task dots/bars
======================================== */

#month-view-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    z-index: 800;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ===== ZARA STYLE TEXT EDITOR MODAL ===== */
.text-editor-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: var(--keyboard-height);
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    transition: opacity 0.2s ease-out;
    pointer-events: none;
}

.text-editor-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.text-editor-modal {
    background: #FFFFFF;
    width: 85vw;
    max-width: 1200px;
    height: 80vh;
    max-height: calc(100vh - var(--keyboard-height) - 40px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: none;
    transform: scale(0.98) translateY(10px);
    transition: transform 0.2s ease-out;
}

.text-editor-overlay.visible .text-editor-modal {
    transform: scale(1) translateY(0);
}

/* Text Editor Header */
.text-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.text-editor-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.text-editor-title {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 2px;
    color: rgba(0, 0, 0, 0.4);
    text-transform: uppercase;
}

.text-editor-subtitle {
    font-size: 10px;
    font-weight: 300;
    color: rgba(0, 0, 0, 0.35);
}

.text-editor-char-count {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.text-editor-char-number {
    font-size: 12px;
    font-weight: 300;
    font-family: 'SF Mono', Menlo, Monaco, monospace;
    color: rgba(0, 0, 0, 0.5);
}

.text-editor-char-label {
    font-size: 9px;
    font-weight: 300;
    color: rgba(0, 0, 0, 0.35);
}

/* Text Editor Body */
.text-editor-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.text-editor-textarea {
    flex: 1;
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    padding: 40px 60px;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
    font-size: 16px;
    font-weight: 300;
    letter-spacing: 0.3px;
    line-height: 2;
    color: rgba(0, 0, 0, 0.85);
    background: #FFFFFF;
}

.text-editor-textarea::placeholder {
    color: rgba(0, 0, 0, 0.25);
}

.text-editor-textarea:focus {
    outline: none;
}

/* Text Editor URL Row */
.text-editor-url-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 60px 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.text-editor-url-icon {
    opacity: 0.35;
    flex-shrink: 0;
}

.text-editor-url-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
    font-size: 12px;
    font-weight: 300;
    color: rgba(0, 0, 0, 0.6);
    letter-spacing: 0.2px;
}

.text-editor-url-input::placeholder {
    color: rgba(0, 0, 0, 0.25);
}

.text-editor-url-input:focus {
    color: #007AFF;
}

/* Text Editor Footer */
.text-editor-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: none;
    flex-shrink: 0;
    background: #FFFFFF;
}

.text-editor-shortcuts {
    display: flex;
    align-items: center;
    gap: 16px;
}

.text-editor-shortcut {
    font-size: 10px;
    font-weight: 300;
    color: rgba(0, 0, 0, 0.2);
    letter-spacing: 1px;
}

.text-editor-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.text-editor-btn {
    padding: 10px 20px;
    border: 0.5px solid rgba(0, 0, 0, 0.15);
    background: transparent;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 1px;
    color: rgba(0, 0, 0, 0.6);
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.text-editor-btn svg {
    width: 16px;
    height: 16px;
}

.text-editor-btn:hover {
    border-color: rgba(0, 0, 0, 0.3);
    color: rgba(0, 0, 0, 0.7);
}

.text-editor-btn.primary {
    background: var(--accent-blue);
    color: #FFFFFF;
    border-color: var(--accent-blue);
}

.text-editor-btn.primary:hover {
    background: #0066DD;
}

.text-editor-btn.primary:disabled {
    background: rgba(0, 122, 255, 0.4);
    border-color: rgba(0, 122, 255, 0.4);
    cursor: not-allowed;
}

.text-editor-btn svg {
    width: 12px;
    height: 12px;
}

/* ===== ZARA STYLE COLOR PICKER MODAL ===== */
.color-picker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    transition: opacity 0.15s ease-out;
    pointer-events: none;
}

.color-picker-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.color-picker-modal {
    background: #FFFFFF;
    min-width: 320px;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    transform: scale(0.95) translateY(8px);
    transition: transform 0.15s ease-out;
}

.color-picker-overlay.visible .color-picker-modal {
    transform: scale(1) translateY(0);
}

/* Color Picker Header */
.color-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
}

.color-picker-title {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 2px;
    color: rgba(0, 0, 0, 0.4);
    text-transform: uppercase;
}

.color-picker-close {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    font-size: 16px;
    color: rgba(0, 0, 0, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
}

.color-picker-close:hover {
    color: rgba(0, 0, 0, 0.8);
}

/* Color Picker Body */
.color-picker-body {
    padding: 20px;
}

/* Preset Colors Section */
.color-picker-section {
    margin-bottom: 20px;
}

.color-picker-section:last-child {
    margin-bottom: 0;
}

.color-picker-label {
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 1.5px;
    color: rgba(0, 0, 0, 0.35);
    text-transform: uppercase;
    margin-bottom: 12px;
}

/* Spectrum Color Picker */
.color-picker-spectrum-container {
    position: relative;
    margin-bottom: 16px;
}

.color-picker-spectrum {
    width: 100%;
    height: 160px;
    cursor: crosshair;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    position: relative;
}

.color-picker-spectrum-cursor {
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid #FFFFFF;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.color-picker-hue-container {
    position: relative;
    margin-top: 12px;
}

.color-picker-hue {
    width: 100%;
    height: 14px;
    cursor: pointer;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    background: linear-gradient(to right, 
        #FF0000 0%, 
        #FFFF00 17%, 
        #00FF00 33%, 
        #00FFFF 50%, 
        #0000FF 67%, 
        #FF00FF 83%, 
        #FF0000 100%
    );
}

.color-picker-hue-cursor {
    position: absolute;
    top: -2px;
    width: 6px;
    height: 18px;
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.3);
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transform: translateX(-50%);
    pointer-events: none;
}

/* Preset Color Grid */
.color-picker-presets {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.color-preset {
    width: 36px;
    height: 36px;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.color-preset:hover {
    transform: scale(1.1);
}

.color-preset.selected {
    border-color: var(--accent-blue);
}

.color-preset.selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: 600;
    color: #FFFFFF;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.color-preset.light.selected::after {
    color: #000000;
    text-shadow: none;
}

/* Custom Color Row */
.color-picker-custom {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-picker-input-wrapper {
    position: relative;
    width: 36px;
    height: 36px;
}

.color-picker-native {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.color-picker-preview {
    width: 36px;
    height: 36px;
    border: 0.5px solid rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

.color-picker-hex-input {
    flex: 1;
    padding: 10px 12px;
    border: 0.5px solid rgba(0, 0, 0, 0.15);
    background: transparent;
    font-family: 'SF Mono', Menlo, Monaco, monospace;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.5px;
    color: rgba(0, 0, 0, 0.8);
    text-transform: uppercase;
    outline: none;
    transition: border-color 0.15s;
}

.color-picker-hex-input:focus {
    border-color: rgba(0, 0, 0, 0.4);
}

.color-picker-hex-input::placeholder {
    color: rgba(0, 0, 0, 0.25);
    text-transform: none;
}

/* Color Picker Footer */
.color-picker-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-top: 0.5px solid rgba(0, 0, 0, 0.08);
}

.color-picker-reset {
    font-size: 10px;
    font-weight: 300;
    color: rgba(0, 0, 0, 0.5);
    padding: 8px 14px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: color 0.15s;
}

.color-picker-reset:hover {
    color: rgba(0, 0, 0, 0.8);
}

.color-picker-actions {
    display: flex;
    gap: 10px;
}

.color-picker-btn {
    padding: 8px 16px;
    border: 0.5px solid rgba(0, 0, 0, 0.15);
    background: transparent;
    font-size: 10px;
    font-weight: 300;
    color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: all 0.15s ease;
}

.color-picker-btn:hover {
    border-color: rgba(0, 0, 0, 0.3);
    color: rgba(0, 0, 0, 0.7);
}

.color-picker-btn.primary {
    background: var(--accent-blue);
    color: #FFFFFF;
    border-color: var(--accent-blue);
    font-weight: 400;
}

.color-picker-btn.primary:hover {
    background: #0066DD;
}

/* ===== Tag Filter Styles ===== */
.node.tag-dimmed {
    opacity: 0.15 !important;
    filter: blur(1px);
    pointer-events: none;
}

.node.tag-highlighted {
    box-shadow: 0 0 0 2px var(--text-primary) !important;
}

.tag-filter-clear {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.03);
    border-bottom: 0.5px solid var(--border-color);
    margin-bottom: 8px;
}

.tag-filter-clear span {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1px;
    color: var(--text-primary);
}

.tag-filter-clear button {
    background: transparent;
    border: none;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
}

.tag-filter-clear button:hover {
    color: var(--text-primary);
}

.list-item.tag-active {
    background: rgba(0, 0, 0, 0.05) !important;
}

.list-item.tag-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--text-primary);
}

/* ===== Dynamic Island - Zara Style Link Mode Notification ===== */
.dynamic-island {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: var(--bg-primary);
    border: 0.5px solid var(--border-color);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
    min-width: 280px;
}

.dynamic-island.active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.dynamic-island-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dynamic-island-icon svg {
    width: 16px;
    height: 16px;
    stroke: var(--text-primary);
    fill: none;
    stroke-width: 1.5;
}

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

.dynamic-island-title {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dynamic-island-subtitle {
    font-size: 10px;
    font-weight: 300;
    color: var(--text-secondary);
    margin-top: 2px;
    letter-spacing: 0.5px;
}

.dynamic-island-count {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-primary);
    padding: 4px 12px;
    border: 0.5px solid var(--border-color);
    min-width: 32px;
    text-align: center;
    letter-spacing: 1px;
}

.dynamic-island-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dynamic-island-btn {
    padding: 8px 16px;
    border: 0.5px solid var(--border-color);
    background: transparent;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-secondary);
}

.dynamic-island-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.dynamic-island-btn.confirm {
    background: var(--accent-blue);
    color: var(--bg-primary);
    border-color: var(--accent-blue);
}

.dynamic-island-btn.confirm:hover {
    background: #0066DD;
    border-color: #0066DD;
}

.dynamic-island-btn.confirm:disabled {
    background: var(--border-color);
    border-color: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* Node selection mode styles for mindmap - Zara Style */
.node.link-selectable {
    cursor: pointer;
    transition: all 0.15s ease;
}

.node.link-selectable:hover {
    border-color: var(--accent-blue) !important;
}

.node.link-selected {
    border-color: var(--accent-blue) !important;
    border-width: 1.5px !important;
}

.node.link-selected::before {
    content: '✓';
    position: absolute;
    top: -12px;
    right: -12px;
    width: 24px;
    height: 24px;
    background: var(--accent-blue);
    color: var(--bg-primary);
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
}

/* Link option menu in detail panel - Zara Style */
.link-options-menu {
    background: #fff;
    border: 1px solid var(--zara-border);
    padding: 4px 0;
    min-width: 140px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: all 0.15s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.link-options-menu.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.link-option-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: none;
    background: transparent;
    width: 100%;
    cursor: pointer;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.link-option-item:hover {
    color: var(--text-primary);
    background: transparent;
}

.link-option-item svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
}

/* Related Items Display - Zara Style */
.list-detail-related-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 0.5px solid var(--border-color);
    cursor: pointer;
    transition: all 0.15s ease;
}

.list-detail-related-item:last-child {
    border-bottom: none;
}

.list-detail-related-item:hover {
    background: transparent;
}

.list-detail-related-item:hover .list-detail-related-item-title {
    color: var(--text-secondary);
}

.list-detail-related-item-icon {
    width: 32px;
    height: 32px;
    border: 0.5px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.list-detail-related-item-icon svg {
    width: 14px;
    height: 14px;
    stroke: var(--text-secondary);
    fill: none;
    stroke-width: 1.5;
}

.list-detail-related-item-content {
    flex: 1;
    min-width: 0;
}

.list-detail-related-item-title {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s;
}

.list-detail-related-item-meta {
    font-size: 10px;
    font-weight: 300;
    color: var(--text-muted);
    margin-top: 3px;
    letter-spacing: 0.3px;
}

.list-detail-related-item-remove {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.list-detail-related-item:hover .list-detail-related-item-remove {
    opacity: 0.4;
}

.list-detail-related-item-remove:hover {
    opacity: 1 !important;
}

.list-detail-related-item-remove svg {
    width: 12px;
    height: 12px;
    stroke: var(--text-secondary);
    stroke-width: 1.5;
}

/* ===== MANAGE MODE STYLES - Zara Design ===== */

/* Manage checkbox in list items */
.manage-checkbox {
    width: 18px;
    height: 18px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 300;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.manage-checkbox:hover {
    border-color: var(--text-secondary);
}

.manage-checkbox.checked {
    background: var(--text-primary);
    border-color: var(--text-primary);
    color: var(--bg-primary);
}

/* Selected state in manage mode */
.list-row-item.manage-selected {
    background: rgba(0, 0, 0, 0.02);
}

/* Manage mode action bar */
.manage-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 0.5px solid var(--border-color);
    background: var(--bg-primary);
}

.manage-action-bar-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.manage-selected-count {
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.manage-action-bar-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.manage-action-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: transparent;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.manage-action-btn:hover:not(:disabled) {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.manage-action-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.manage-action-btn.danger {
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.manage-action-btn.danger:hover:not(:disabled) {
    background: var(--danger-color);
    color: #fff;
}

.manage-action-btn.cancel {
    border-color: transparent;
}

.manage-action-btn.cancel:hover {
    border-color: var(--border-color);
}

/* Action buttons in detail panel */
.list-action-btn.danger {
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.list-action-btn.danger:hover {
    background: var(--danger-color);
    color: #fff;
}

/* ===== STORAGE SETTINGS STYLES - Zara Design ===== */

.settings-storage-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.02);
    border: 0.5px solid var(--border-color);
    margin-bottom: 16px;
}

.storage-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.storage-icon {
    font-size: 16px;
}

.storage-label {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.storage-path {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
}

.storage-path .path-label {
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.storage-path .path-value {
    color: var(--text-primary);
    font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
    font-size: 10px;
    word-break: break-all;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 2px;
}

.storage-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
}

.storage-stats .stats-label {
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.storage-stats .stats-value {
    color: var(--text-primary);
}

.settings-storage-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.settings-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    background: transparent;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.settings-btn:hover:not(:disabled) {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.settings-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.settings-btn.primary {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #FFFFFF;
}

.settings-btn.primary:hover:not(:disabled) {
    background: #0066DD;
    border-color: #0066DD;
}

.settings-btn.danger {
    background: transparent;
    color: #FF3B30;
    border-color: #FF3B30;
    margin-top: 8px;
}

.settings-btn.danger:hover:not(:disabled) {
    background: #FF3B30;
    color: #FFFFFF;
}

.settings-btn svg {
    width: 14px;
    height: 14px;
}

/* API Keys Section */
.settings-api-keys {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.api-key-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.api-key-label {
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.api-key-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.api-key-input {
    flex: 1;
    padding: 10px 12px;
    border: 0.5px solid var(--border-color);
    background: var(--bg-secondary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 300;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s ease;
}

.api-key-input:focus {
    border-color: var(--accent-blue);
}

.api-key-input::placeholder {
    color: var(--text-muted);
}

.api-key-toggle {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0.5px solid var(--border-color);
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s ease;
}

.api-key-toggle:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.settings-backup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.backup-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
    padding: 10px;
    background: rgba(0, 122, 255, 0.05);
    border: 0.5px solid rgba(0, 122, 255, 0.2);
}

.backup-note .note-icon {
    font-size: 12px;
}

.backup-note .note-text {
    font-size: 10px;
    letter-spacing: 0.3px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.settings-about {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.about-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
}

.about-item .about-label {
    color: var(--text-secondary);
    font-weight: 400;
}

.about-item .about-value {
    color: var(--text-primary);
    font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
    font-size: 10px;
}

/* Update Status Styles */
.update-status-container {
    margin-top: 16px;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

.update-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.update-status .update-icon {
    font-size: 14px;
}

/* Zara-style loader */
.zara-loader {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.zara-loader span {
    width: 3px;
    height: 3px;
    background: var(--text-primary);
    animation: zara-pulse 1.4s ease-in-out infinite;
}

.zara-loader span:nth-child(1) {
    animation-delay: 0s;
}

.zara-loader span:nth-child(2) {
    animation-delay: 0.2s;
}

.zara-loader span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes zara-pulse {
    0%, 80%, 100% {
        opacity: 0.2;
        transform: scale(1);
    }
    40% {
        opacity: 1;
        transform: scale(1.2);
    }
}

.update-status .update-text {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.update-status .update-version {
    font-weight: 600;
    color: var(--accent-blue);
}

.update-progress-bar {
    width: 100%;
    height: 3px;
    background: var(--border-color);
    margin-top: 8px;
    overflow: hidden;
}

.update-progress-fill {
    height: 100%;
    background: var(--accent-blue);
    transition: width 0.3s ease;
    width: 0%;
}

.update-status.update-ready {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.update-status.update-ready .update-install-btn {
    width: 100%;
}

.update-status.update-error {
    color: #e74c3c;
}

/* Contact Section */
.settings-contact {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-secondary);
}

.contact-item svg {
    flex-shrink: 0;
    color: var(--text-tertiary);
}

.contact-email {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 400;
    letter-spacing: 0.3px;
}

.contact-email:hover {
    text-decoration: underline;
}

/* ================================================
   LOGIN GATE OVERLAY
   ================================================ */

.login-gate-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.login-gate-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.login-gate-modal {
    width: 400px;
    max-width: 90vw;
    padding: 48px;
    text-align: center;
}

.login-gate-logo {
    margin-bottom: 24px;
    color: var(--text-primary);
}

.login-gate-logo svg {
    stroke-width: 0.8;
}

.login-gate-title {
    font-size: 28px;
    font-weight: 300;
    letter-spacing: 8px;
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.login-gate-subtitle {
    font-size: 13px;
    font-weight: 300;
    color: var(--text-secondary);
    margin: 0 0 32px 0;
    letter-spacing: 0.5px;
}

.login-gate-tabs {
    display: flex;
    border-bottom: 0.5px solid var(--border-color);
    margin-bottom: 24px;
}

.login-gate-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 0;
    font-family: inherit;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 2px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.login-gate-tab:hover {
    color: var(--text-secondary);
}

.login-gate-tab.active {
    color: var(--text-primary);
}

.login-gate-tab.active::after {
    content: '';
    position: absolute;
    bottom: -0.5px;
    left: 0;
    right: 0;
    height: 1.5px;
    background: var(--text-primary);
}

.login-gate-form {
    margin-bottom: 24px;
}

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

.login-gate-form .auth-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--hover-bg);
    border: 0.5px solid transparent;
    font-family: inherit;
    font-size: 13px;
    color: var(--text-primary);
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

.login-gate-form .auth-input:focus {
    border-color: var(--text-muted);
    background: transparent;
}

.login-gate-form .auth-input::placeholder {
    color: var(--text-muted);
}

.auth-error {
    color: var(--danger-color);
    font-size: 12px;
    text-align: left;
    margin-bottom: 12px;
}

.auth-error:empty {
    display: none;
}

.login-gate-btn {
    width: 100%;
    padding: 14px 24px;
    border: 0.5px solid var(--border-strong);
    background: transparent;
    font-family: inherit;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-gate-btn:hover {
    background: var(--active-bg);
}

.login-gate-btn.primary {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.login-gate-btn.primary:hover {
    background: #0066DD;
    border-color: #0066DD;
}

.login-gate-btn.google {
    margin-top: 0;
    background: transparent;
    color: var(--text-primary);
}

.login-gate-btn.google:hover {
    background: var(--hover-bg);
}

.login-gate-link {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 11px;
    letter-spacing: 0.5px;
    cursor: pointer;
    padding: 8px;
    margin-top: 8px;
    transition: color 0.2s ease;
}

.login-gate-link:hover {
    color: var(--text-primary);
}

.login-gate-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 11px;
    letter-spacing: 1px;
}

.login-gate-divider::before,
.login-gate-divider::after {
    content: '';
    flex: 1;
    height: 0.5px;
    background: var(--border-color);
}

.login-gate-divider span {
    padding: 0 16px;
}

/* ================================================
   SUBSCRIPTION GATE OVERLAY
   ================================================ */

.subscription-gate-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.subscription-gate-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.subscription-gate-modal {
    width: 420px;
    max-width: 90vw;
    padding: 40px 36px;
    text-align: center;
    background: var(--bg-primary);
    border: 0.5px solid var(--border-color);
    border-radius: 2px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
}

.subscription-gate-title {
    font-size: 28px;
    font-weight: 300;
    letter-spacing: 6px;
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.subscription-gate-subtitle {
    font-size: 13px;
    font-weight: 300;
    color: var(--text-secondary);
    margin: 0 0 32px 0;
    letter-spacing: 0.5px;
}

.subscription-pricing-card {
    background: var(--hover-bg);
    border: 0.5px solid var(--border-color);
    padding: 24px;
    margin-bottom: 24px;
}

.subscription-trial-badge {
    display: inline-block;
    background: rgba(0, 122, 255, 0.1);
    color: var(--accent-blue);
    padding: 8px 16px;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 2px;
    margin-bottom: 16px;
}

.subscription-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    margin-bottom: 8px;
}

.subscription-currency {
    font-size: 24px;
    font-weight: 300;
    color: var(--text-secondary);
}

.subscription-amount {
    font-size: 64px;
    font-weight: 200;
    letter-spacing: -2px;
    color: var(--text-primary);
}

.subscription-period {
    font-size: 14px;
    font-weight: 300;
    color: var(--text-secondary);
    margin-left: 4px;
}

.subscription-note {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

.subscription-features {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
    text-align: left;
}

.subscription-features li {
    padding: 10px 0;
    font-size: 13px;
    font-weight: 300;
    color: var(--text-primary);
    border-bottom: 0.5px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.subscription-features li::before {
    content: '✓';
    color: var(--accent-blue);
    font-weight: 500;
}

.subscription-features li:last-child {
    border-bottom: none;
}

.subscription-gate-btn {
    width: 100%;
    padding: 16px 24px;
    border: 0.5px solid var(--border-strong);
    background: transparent;
    font-family: inherit;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.subscription-gate-btn.primary {
    background: var(--accent-blue);
    color: #FFFFFF;
    border-color: var(--accent-blue);
}

.subscription-gate-btn.primary:hover {
    background: #0066DD;
    border-color: #0066DD;
}

.subscription-terms {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 16px;
}

/* ================================================
   TRIAL BANNER
   ================================================ */

.trial-banner {
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    height: 36px;
    background: linear-gradient(90deg, #007AFF, #5856D6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-size: 12px;
    letter-spacing: 0.5px;
    z-index: 999;
}

.trial-banner-text {
    display: flex;
    align-items: center;
    gap: 6px;
}

.trial-banner-text #trial-days-remaining {
    font-weight: 600;
}

.trial-banner-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 6px 14px;
    font-family: inherit;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.trial-banner-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Adjust main container when trial banner is visible */
body.has-trial-banner #main-container {
    top: 88px; /* 52px top-bar + 36px trial-banner */
}

body.has-trial-banner.ios-ipad #main-container {
    top: calc(88px + var(--safe-area-top));
}

body.has-trial-banner .settings-overlay,
body.has-trial-banner .modal-overlay {
    top: 88px;
}

/* ===== CLOUD SAVE STATUS INDICATOR ===== */
.save-status {
    position: fixed;
    top: 60px;
    right: 16px;
    bottom: auto;
    left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.3px;
    color: var(--text-secondary);
    background: var(--bg-primary);
    border: 0.5px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    z-index: 9999;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.save-status.hidden {
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
}

.save-status-icon {
    font-size: 12px;
    line-height: 1;
}

.save-status.saving .save-status-icon {
    animation: saveStatusSpin 1s linear infinite;
}

.save-status.error {
    color: #FF3B30;
    border-color: rgba(255, 59, 48, 0.2);
}

@keyframes saveStatusSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== TOAST NOTIFICATIONS (Zara Style) ===== */
#toast-container {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: var(--bg-primary);
    border: 0.5px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 16px 24px;
    border-radius: 2px;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.3px;
    color: var(--text-primary);
    max-width: 400px;
    text-align: center;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(-20px);
    animation: toastSlideIn 0.3s ease forwards;
}

.toast.hiding {
    animation: toastSlideOut 0.3s ease forwards;
}

.toast.success {
    border-left: 3px solid #34C759;
}

.toast.error {
    border-left: 3px solid #FF3B30;
}

.toast.info {
    border-left: 3px solid var(--accent-blue);
}

.toast.warning {
    border-left: 3px solid #FF9500;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    text-align: left;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    margin-left: 12px;
    font-size: 16px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
}

/* ===== FEEDBACK DIALOG (Zara Style) ===== */
.feedback-dialog {
    background: var(--bg-primary);
    border: 0.5px solid var(--border-light);
    width: 400px;
    max-width: 90vw;
    display: flex;
    flex-direction: column;
}

.feedback-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 0.5px solid var(--border-light);
}

.feedback-title {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 2px;
    color: var(--text-primary);
}

.feedback-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.feedback-close:hover {
    color: var(--text-primary);
}

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

.feedback-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.feedback-label {
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.feedback-select,
.feedback-input,
.feedback-textarea {
    background: var(--bg-primary);
    border: 0.5px solid var(--border-light);
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 300;
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.feedback-select:focus,
.feedback-input:focus,
.feedback-textarea:focus {
    border-color: var(--text-muted);
}

.feedback-textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

.feedback-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 0.5px solid var(--border-light);
}

.feedback-btn {
    padding: 10px 20px;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 1.5px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.feedback-btn.secondary {
    background: transparent;
    color: var(--text-muted);
    border: 0.5px solid var(--border-light);
}

.feedback-btn.secondary:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.feedback-btn.primary {
    background: var(--accent-blue);
    color: white;
}

.feedback-btn.primary:hover {
    background: #3a7bc8;
}

#feedback-dialog-overlay.fade-out {
    opacity: 0;
    transition: opacity 0.2s;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* ===== STORAGE FOLDER PROMPT — Zara ===== */
.storage-prompt-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    transition: background 0.25s ease;
}

.storage-prompt-overlay.active {
    background: rgba(0, 0, 0, 0.25);
}

.storage-prompt-card {
    background: var(--bg-primary);
    border: 0.5px solid var(--border-color);
    width: 380px;
    max-width: 90vw;
    padding: 48px 40px;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.25s ease;
}

.storage-prompt-overlay.active .storage-prompt-card {
    opacity: 1;
    transform: translateY(0);
}

.storage-prompt-icon {
    margin-bottom: 24px;
    color: var(--text-secondary);
}

.storage-prompt-title {
    font-size: 13px;
    font-weight: 300;
    letter-spacing: 6px;
    color: var(--text-primary);
    margin: 0 0 16px 0;
}

.storage-prompt-desc {
    font-size: 12px;
    font-weight: 300;
    line-height: 1.8;
    color: var(--text-muted);
    margin: 0 0 32px 0;
    letter-spacing: 0.3px;
}

.storage-prompt-btn {
    display: block;
    width: 100%;
    padding: 14px 28px;
    border: 0.5px solid var(--border-strong);
    background: transparent;
    font-family: inherit;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.storage-prompt-btn:hover {
    border-color: var(--text-primary);
}

.storage-prompt-btn.primary {
    background: var(--accent-blue);
    color: #FFFFFF;
    border-color: var(--accent-blue);
    margin-bottom: 12px;
}

.storage-prompt-btn.primary:hover {
    background: #0066DD;
    border-color: #0066DD;
}

.storage-prompt-btn.skip {
    border-color: transparent;
    color: var(--text-muted);
    font-size: 9px;
    letter-spacing: 1.5px;
    padding: 10px;
}

.storage-prompt-btn.skip:hover {
    color: var(--text-secondary);
}

/* ===== WELCOME MODAL ===== */
.welcome-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100002;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: welcomeFadeIn 0.4s ease;
}

.welcome-modal-content {
    background: var(--bg-primary);
    border: 0.5px solid var(--border-color);
    width: 400px;
    max-width: 90vw;
    padding: 48px;
    text-align: center;
    border-radius: 12px;
    animation: welcomeSlideIn 0.4s ease;
}

.welcome-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.welcome-title {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: var(--text-primary);
}

.welcome-message {
    font-size: 15px;
    font-weight: 400;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.welcome-submessage {
    font-size: 13px;
    font-weight: 300;
    color: var(--text-muted);
    margin: 0 0 28px 0;
}

/* Welcome Button - Zara Style */
.welcome-btn {
    width: 100%;
    padding: 16px 32px;
    background: transparent;
    border: 0.5px solid var(--accent-blue);
    color: var(--accent-blue);
    font-family: inherit;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
}

.welcome-btn:hover {
    background: var(--accent-blue);
    color: white;
}

@keyframes welcomeFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes welcomeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== TRIAL EXPIRED GATE ===== */
.trial-expired-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 100003;
    display: flex;
    align-items: center;
    justify-content: center;
}

.trial-expired-modal {
    width: 420px;
    max-width: 90vw;
    padding: 56px;
    text-align: center;
}

.trial-expired-icon {
    font-size: 48px;
    margin-bottom: 24px;
}

.trial-expired-title {
    font-size: 20px;
    font-weight: 300;
    letter-spacing: 8px;
    margin: 0 0 16px 0;
    color: var(--text-primary);
}

.trial-expired-message {
    font-size: 13px;
    font-weight: 300;
    line-height: 1.8;
    color: var(--text-secondary);
    margin: 0 0 32px 0;
}

.trial-expired-pricing {
    margin-bottom: 32px;
}

.trial-expired-price {
    font-size: 48px;
    font-weight: 200;
    color: var(--text-primary);
}

.trial-expired-period {
    font-size: 14px;
    font-weight: 300;
    color: var(--text-muted);
}

/* Trial Expired Button - Zara Style */
.trial-expired-btn-blue {
    width: 100%;
    padding: 18px 32px;
    background: transparent;
    border: 0.5px solid var(--accent-blue);
    font-family: inherit;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--accent-blue);
}

.trial-expired-btn-blue:hover {
    background: var(--accent-blue);
    color: white;
}

/* ===== FREE TIER LIMIT OVERLAY ===== */
/* ===== Free Tier Limit Overlay (Zara-style minimal) ===== */
.free-tier-limit-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 100004;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: freeTierFadeIn 0.3s ease;
}

@keyframes freeTierFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.free-tier-limit-modal {
    position: relative;
    width: 380px;
    max-width: 88vw;
    padding: 56px 48px 40px;
    text-align: center;
    background: var(--bg-primary);
    animation: freeTierSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.free-tier-x-btn {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    font-weight: 300;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}

.free-tier-x-btn:hover {
    color: var(--text-primary);
}

@keyframes freeTierSlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.free-tier-limit-header {
    margin-bottom: 28px;
}

.free-tier-limit-title {
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 5px;
    text-transform: uppercase;
    margin: 0 0 16px 0;
    color: var(--text-primary);
}

.free-tier-limit-divider {
    width: 32px;
    height: 0.5px;
    background: var(--text-muted);
    margin: 0 auto;
}

.free-tier-limit-message {
    font-size: 12px;
    font-weight: 300;
    line-height: 1.9;
    color: var(--text-secondary);
    margin: 0 0 24px 0;
    letter-spacing: 0.3px;
}

.free-tier-limit-usage {
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 3px;
    color: var(--text-muted);
    margin: 0 0 32px 0;
    padding: 14px 0;
    border-top: 0.5px solid var(--border-color);
    border-bottom: 0.5px solid var(--border-color);
}

.free-tier-limit-cta {
    margin-bottom: 12px;
}

.free-tier-limit-trial-note {
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin: 0 0 16px 0;
}

.free-tier-limit-btn {
    display: block;
    width: 100%;
    padding: 15px 32px;
    border: none;
    font-family: inherit;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 4px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

.free-tier-limit-btn.primary {
    background: var(--accent-blue);
    border: none;
    color: white;
}

.free-tier-limit-btn.primary:hover {
    opacity: 0.85;
}

.free-tier-limit-btn.secondary {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 10px;
    letter-spacing: 2px;
    padding: 12px;
}

.free-tier-limit-btn.secondary:hover {
    color: var(--text-primary);
}

/* ===== UPDATE MODAL (Zara Style) ===== */
.update-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: updateModalFadeIn 0.3s ease forwards;
}

.update-modal-content {
    background: var(--bg-primary);
    border: 0.5px solid var(--border-color);
    width: 380px;
    max-width: 90vw;
    padding: 40px;
    text-align: center;
    transform: translateY(-20px);
    animation: updateModalSlideIn 0.3s ease forwards;
}

.update-modal-header {
    margin-bottom: 32px;
}

.update-icon {
    color: var(--accent-blue);
    margin-bottom: 16px;
}

.update-icon svg {
    width: 32px;
    height: 32px;
}

.update-title {
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 4px;
    margin: 0;
    color: var(--text-primary);
}

.update-modal-body {
    margin-bottom: 32px;
}

.update-version,
.update-current {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 8px 0;
    font-size: 13px;
}

.version-label {
    color: var(--text-muted);
    font-weight: 300;
}

.version-number {
    color: var(--accent-blue);
    font-weight: 500;
    letter-spacing: 1px;
}

.version-current {
    color: var(--text-secondary);
    font-weight: 400;
}

.update-changelog {
    margin-top: 24px;
    text-align: left;
    padding: 16px;
    background: var(--hover-bg);
    border-radius: 2px;
    max-height: 150px;
    overflow-y: auto;
    font-size: 12px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.update-changelog:empty {
    display: none;
}

.update-changelog ul {
    margin: 0;
    padding-left: 16px;
}

.update-changelog li {
    margin: 4px 0;
}

.update-modal-footer {
    display: flex;
    gap: 12px;
}

.update-btn {
    flex: 1;
    padding: 14px 24px;
    border: 0.5px solid var(--border-strong);
    background: transparent;
    font-family: inherit;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.update-btn:hover {
    background: var(--hover-bg);
}

.update-btn.primary {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.update-btn.primary:hover {
    background: #0066DD;
    border-color: #0066DD;
}

.update-btn.secondary {
    color: var(--text-muted);
}

@keyframes updateModalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes updateModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== READ-ONLY MODE ===== */
#read-only-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 36px;
    background: var(--accent-blue, #3b82f6);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 999;
    font-size: 11px;
    letter-spacing: 1px;
    font-weight: 400;
}

#read-only-banner .read-only-text {
    text-transform: uppercase;
}

#read-only-banner .read-only-subscribe-btn {
    background: #fff;
    color: var(--accent-blue, #3b82f6);
    border: none;
    padding: 6px 16px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#read-only-banner .read-only-subscribe-btn:hover {
    background: rgba(255, 255, 255, 0.9);
}

/* Read-only toast notification - Zara Blue Style */
.read-only-toast {
    position: fixed;
    bottom: 56px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--accent-blue, #007AFF);
    color: #fff;
    padding: 14px 28px;
    border-radius: 0;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 1.5px;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

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

/* ===== FORUM VIEW ===== */
#forum-view-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    z-index: 800;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.forum-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

/* Forum Header */
.forum-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 48px 20px;
    flex-shrink: 0;
}

.forum-header-left {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.forum-title {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-primary);
}

.forum-subtitle {
    font-size: 11px;
    font-weight: 300;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.forum-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.forum-sort-group {
    display: flex;
    gap: 2px;
}

.forum-sort-btn {
    padding: 6px 14px;
    border: none;
    background: transparent;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.forum-sort-btn:hover {
    color: var(--text-secondary);
}

.forum-sort-btn.active {
    color: var(--text-primary);
    font-weight: 500;
}

.forum-publish-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border: 1px solid var(--border-strong);
    background: transparent;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.forum-publish-btn:hover {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
}

.forum-publish-btn svg {
    flex-shrink: 0;
}

/* Forum Gallery */
.forum-gallery {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 48px 48px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    align-content: start;
}

.forum-gallery::-webkit-scrollbar {
    width: 4px;
}

.forum-gallery::-webkit-scrollbar-track {
    background: transparent;
}

.forum-gallery::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.08);
    border-radius: 2px;
}

/* Forum Card */
.forum-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.25s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.forum-card:hover {
    border-color: var(--border-strong);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.forum-card-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.forum-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.forum-card:hover .forum-card-thumbnail img {
    transform: scale(1.03);
}

.forum-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f8f8;
}

.forum-card-info {
    padding: 14px 16px;
}

.forum-card-name {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.forum-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 300;
}

.forum-card-sep {
    opacity: 0.4;
}

/* Forum Empty State */
.forum-empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    gap: 12px;
}

.forum-empty-title {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.forum-empty-sub {
    font-size: 12px;
    font-weight: 300;
    color: var(--text-muted);
}

/* Forum Loading */
.forum-loading-spinner {
    width: 20px;
    height: 20px;
    border: 1.5px solid var(--border-strong);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: forumSpin 0.8s linear infinite;
}

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

/* ===== Forum Modals ===== */
.forum-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.forum-modal-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.forum-modal {
    background: var(--bg-primary);
    width: 520px;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    transform: translateY(10px);
    transition: transform 0.2s ease;
}

.forum-modal-overlay.visible .forum-modal {
    transform: translateY(0);
}

.forum-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.forum-modal-title {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.forum-modal-close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
}

.forum-modal-close:hover {
    color: var(--text-primary);
}

.forum-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.forum-modal-label {
    display: block;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.forum-modal-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    background: var(--bg-primary);
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    cursor: pointer;
    margin-bottom: 16px;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    transition: border-color 0.15s;
}

.forum-modal-select:focus {
    border-color: var(--accent-blue);
}

.forum-modal-preview {
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    border: 1px solid var(--border-color);
}

.forum-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.forum-modal-btn {
    padding: 8px 20px;
    border: none;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.forum-modal-btn.primary {
    background: var(--text-primary);
    color: var(--bg-primary);
}

.forum-modal-btn.primary:hover {
    opacity: 0.85;
}

.forum-modal-btn.primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.forum-modal-btn.secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-strong);
}

.forum-modal-btn.secondary:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

.forum-modal-btn.danger {
    background: transparent;
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

.forum-modal-btn.danger:hover {
    background: var(--danger-color);
    color: white;
}

/* Forum Preview Modal */
.forum-preview-modal {
    width: 700px;
    max-width: 90vw;
}

.forum-preview-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 300;
    margin-top: 4px;
}

.forum-preview-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
}

.forum-preview-image {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
}

/* ===== Settings: AI Explore Mode ===== */
.settings-explore-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    margin-top: 10px;
}
.settings-explore-info { flex: 1; }
.settings-explore-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary, #333);
    margin-bottom: 4px;
}
.settings-explore-desc {
    font-size: 11px;
    color: var(--text-secondary, #888);
    line-height: 1.5;
}
.settings-toggle {
    position: relative;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
    margin-top: 2px;
}
.settings-toggle input { opacity: 0; width: 0; height: 0; }
.settings-toggle-slider {
    position: absolute; cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--border-color, #ddd);
    border-radius: 22px;
    transition: background 0.2s;
}
.settings-toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    left: 3px; bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}
.settings-toggle input:checked + .settings-toggle-slider {
    background: var(--accent-blue, #2563eb);
}
.settings-toggle input:checked + .settings-toggle-slider::before {
    transform: translateX(18px);
}
.settings-agent-row { margin-top: 16px; }
.settings-agent-label {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-secondary, #666);
    margin-bottom: 6px;
    display: block;
}
.settings-agent-desc {
    font-size: 10px;
    color: var(--text-muted, #aaa);
    margin-bottom: 8px;
}
.settings-agent-input {
    width: 100%;
    padding: 8px 12px;
    border: 0.5px solid var(--border-color, #ddd);
    background: var(--bg-secondary, #fafafa);
    font-family: inherit;
    font-size: 12px;
    color: var(--text-primary, #333);
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.settings-agent-input:focus {
    border-color: var(--accent-blue, #2563eb);
}
.settings-agent-maps {
    max-height: 200px;
    overflow-y: auto;
    border: 0.5px solid var(--border-color, #eee);
    background: var(--bg-secondary, #fafafa);
}
.agent-map-group { padding: 4px 0; }
.agent-map-group-title {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted, #aaa);
    padding: 6px 12px 2px;
}
.agent-map-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    cursor: pointer;
    transition: background 0.1s;
    font-size: 12px;
    color: var(--text-primary, #333);
}
.agent-map-item:hover { background: var(--hover-bg, #f0f0f0); }
.agent-map-checkbox {
    width: 14px; height: 14px;
    accent-color: var(--accent-blue, #2563eb);
    cursor: pointer;
}
.settings-agent-activity {
    margin-top: 16px;
    padding: 10px 12px;
    background: var(--hover-bg, #f9f9f9);
    border: 0.5px solid var(--border-color, #eee);
    font-size: 11px;
    color: var(--text-secondary, #888);
    line-height: 1.6;
}
.settings-agent-activity .explore-status-dot {
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}
.explore-status-dot.on { background: #22c55e; }
.explore-status-dot.off { background: var(--text-muted, #ccc); }

/* AI badge on forum comments */
.forum-ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #7c3aed, #2563eb);
    color: white;
    font-size: 9px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    margin-left: 4px;
}

/* My Posts button */
.forum-myposts-btn {
    background: var(--bg-primary, #fff);
    color: var(--text-secondary, #666);
    border: 1px solid var(--border-color, #e5e5e5);
    border-radius: 4px;
    padding: 8px 15px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
}
.forum-myposts-btn:hover {
    background: var(--hover-bg, #f5f5f5);
    color: var(--text-primary, #333);
}

/* My Posts modal */
.forum-myposts-modal {
    max-width: 600px;
}
.forum-myposts-body {
    max-height: 60vh;
    overflow-y: auto;
    padding: 0 !important;
}
.forum-mypost-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color, #f0f0f0);
    transition: background 0.1s;
}
.forum-mypost-item:hover {
    background: var(--hover-bg, #fafafa);
}
.forum-mypost-thumb {
    width: 80px;
    height: 50px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--border-color, #eee);
}
.forum-mypost-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.forum-mypost-info {
    flex: 1;
    min-width: 0;
}
.forum-mypost-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary, #333);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.forum-mypost-meta {
    font-size: 12px;
    color: var(--text-secondary, #999);
    margin-top: 2px;
}
.forum-mypost-remove {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: 1px solid var(--danger-color, #e53e3e);
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--danger-color, #e53e3e);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s;
}
.forum-mypost-remove:hover {
    background: var(--danger-color, #e53e3e);
    color: white;
}
.forum-mypost-remove:hover svg {
    stroke: white;
}

/* Toast animation for forum */
@keyframes toastIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════
   FORUM VIEWER (Read-only map + Comments)
   ══════════════════════════════════════ */

.fv-viewer {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background: var(--bg-primary, #fff);
}

/* ── Top Bar ── */
.fv-topbar {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border-color, #e5e5e5);
    flex-shrink: 0;
    background: var(--bg-primary, #fff);
    z-index: 10;
}
.fv-back-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: 1px solid var(--border-color, #e5e5e5);
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-secondary, #666);
    cursor: pointer;
    transition: all 0.15s ease;
}
.fv-back-btn:hover {
    background: var(--hover-bg, #f5f5f5);
    color: var(--text-primary, #333);
}
.fv-topbar-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.fv-topbar-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary, #333);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fv-topbar-meta {
    font-size: 11px;
    color: var(--text-secondary, #999);
    letter-spacing: 0.3px;
}
.fv-topbar-actions {
    display: flex;
    gap: 8px;
}
.fv-delete-btn {
    background: none;
    border: 1px solid var(--danger-color, #e53e3e);
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--danger-color, #e53e3e);
    cursor: pointer;
    transition: all 0.15s ease;
}
.fv-delete-btn:hover {
    background: var(--danger-color, #e53e3e);
    color: white;
}

/* ── Body (Canvas + Sidebar) ── */
.fv-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.fv-canvas-area {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #ffffff;
}
.fv-canvas-area canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* ── Comments Sidebar ── */
.fv-comments-sidebar {
    width: 340px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-color, #e5e5e5);
    background: var(--bg-primary, #fff);
    overflow: hidden;
}
.fv-comments-header {
    padding: 15px 20px 12px;
    border-bottom: 1px solid var(--border-color, #e5e5e5);
    flex-shrink: 0;
}
.fv-comments-title {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-secondary, #999);
    margin: 0;
}
.fv-comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}
.fv-no-comments {
    text-align: center;
    padding: 40px 20px;
    font-size: 13px;
    color: var(--text-muted, #bbb);
}

/* ── Single Comment ── */
.fv-comment {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color, #f0f0f0);
    transition: background 0.1s;
}
.fv-comment:hover {
    background: var(--hover-bg, #fafafa);
}

/* Vote column */
.fv-comment-votes {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    padding-top: 2px;
}
.fv-vote-btn {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: var(--text-muted, #ccc);
    border-radius: 3px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.fv-vote-btn:hover {
    color: var(--text-secondary, #666);
    background: var(--hover-bg, #f0f0f0);
}
.fv-vote-up.active {
    color: #f97316;
}
.fv-vote-down.active {
    color: #6366f1;
}
.fv-vote-score {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary, #888);
    min-width: 18px;
    text-align: center;
    line-height: 1;
}
.fv-vote-score.positive { color: #f97316; }
.fv-vote-score.negative { color: #6366f1; }

/* Comment body */
.fv-comment-body {
    flex: 1;
    min-width: 0;
}
.fv-comment-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 3px;
}
.fv-comment-author {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary, #333);
}
.fv-comment-time {
    font-size: 11px;
    color: var(--text-muted, #bbb);
}
.fv-comment-text {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-primary, #333);
    word-wrap: break-word;
    white-space: pre-wrap;
}
.fv-comment-actions {
    margin-top: 4px;
}
.fv-reply-btn {
    background: none;
    border: none;
    padding: 2px 0;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-muted, #bbb);
    cursor: pointer;
    transition: color 0.15s;
}
.fv-reply-btn:hover {
    color: var(--accent-blue, #2563eb);
}

/* Reply box */
.fv-reply-box {
    margin-top: 8px;
}
.fv-reply-textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color, #e5e5e5);
    border-radius: 4px;
    font-size: 12px;
    font-family: inherit;
    resize: vertical;
    background: var(--bg-primary, #fff);
    color: var(--text-primary, #333);
    box-sizing: border-box;
}
.fv-reply-textarea:focus {
    outline: none;
    border-color: var(--accent-blue, #2563eb);
}
.fv-reply-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 6px;
}
.fv-reply-cancel,
.fv-reply-submit {
    background: none;
    border: 1px solid var(--border-color, #e5e5e5);
    border-radius: 4px;
    padding: 4px 12px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s;
}
.fv-reply-cancel {
    color: var(--text-secondary, #888);
}
.fv-reply-cancel:hover {
    background: var(--hover-bg, #f5f5f5);
}
.fv-reply-submit {
    background: var(--accent-blue, #2563eb);
    color: white;
    border-color: var(--accent-blue, #2563eb);
}
.fv-reply-submit:hover {
    background: #1d4ed8;
}

/* ── Comment Input Area (bottom) ── */
.fv-comment-input-area {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color, #e5e5e5);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.fv-comment-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color, #e5e5e5);
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    resize: none;
    background: var(--bg-primary, #fff);
    color: var(--text-primary, #333);
    box-sizing: border-box;
}
.fv-comment-textarea:focus {
    outline: none;
    border-color: var(--accent-blue, #2563eb);
}
.fv-comment-submit {
    align-self: flex-end;
    background: var(--accent-blue, #2563eb);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 20px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s;
}
.fv-comment-submit:hover {
    background: #1d4ed8;
}

/* ── Responsive: hide sidebar on narrow screens ── */
@media (max-width: 768px) {
    .fv-comments-sidebar {
        width: 260px;
    }
    .fv-body {
        flex-direction: column;
    }
    .fv-canvas-area {
        height: 50%;
    }
    .fv-comments-sidebar {
        width: 100%;
        height: 50%;
        border-left: none;
        border-top: 1px solid var(--border-color, #e5e5e5);
    }
}

/* ===== OUTLINE VIEW ===== */
#outline-view-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fafafa;
    z-index: 800;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.outline-canvas-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#outline-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: grab;
}

#outline-canvas:active {
    cursor: grabbing;
}

/* Outline panel in sidebar (tree view) */
.outline-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.15s;
    border-radius: 4px;
    margin: 2px 8px;
}

.outline-item:hover {
    background: var(--hover-bg, #f5f5f5);
}

.outline-bullet {
    color: var(--text-muted, #999);
    font-size: 8px;
    flex-shrink: 0;
}

.outline-text {
    font-size: 12px;
    color: var(--text-primary, #333);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Empty state for outline */
#outline-tree .empty-state {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-muted, #999);
    font-size: 11px;
    letter-spacing: 0.5px;
}

/* ── MOBILE-ONLY BUTTONS (hidden on desktop) ── */
.view-switcher-wrapper {
    display: none;
    position: relative;
}

#box-select-btn {
    display: none; /* Hidden on desktop — desktop uses left-click drag */
}

/* ── VIEW SWITCHER DROPDOWN ── */

.view-switcher-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-primary, #fff);
    border: 0.5px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    z-index: 2000;
    min-width: 140px;
    padding: 6px 0;
}

.view-switcher-dropdown.open {
    display: flex;
    flex-direction: column;
}

.view-switcher-item {
    padding: 12px 20px;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 2px;
    color: var(--text-secondary, rgba(0,0,0,0.4));
    cursor: pointer;
    transition: color 0.2s ease, background 0.15s ease;
    font-family: inherit;
}

.view-switcher-item:hover {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-primary, #000);
}

.view-switcher-item.active {
    color: var(--accent-blue, #007AFF);
    font-weight: 500;
}

/* ========================================
   MOBILE / iOS RESPONSIVE LAYOUT
   Capacitor WebView & small screens
   ======================================== */

/* Safe area support for iOS notch / home indicator */
:root {
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);
    --keyboard-height: 0px;
}

/* Prevent native callout / selection on canvas & interactive elements (iOS) */
#mindmap-canvas,
#canvas-wrapper,
#mindmap-container {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: none; /* we handle all gestures ourselves */
}

@media (max-width: 768px) {

    /* ── TOP BAR: compact mobile version ── */
    #top-bar {
        height: 44px;
        padding: 0 8px;
        padding-top: var(--safe-area-top);
        height: calc(44px + var(--safe-area-top));
        box-sizing: border-box;
    }

    .top-bar-left {
        min-width: unset;
        gap: 8px;
    }

    .top-bar-left .breadcrumb {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 12px;
    }

    /* Hide desktop view tabs on mobile — use dropdown instead */
    .top-bar-center {
        display: none;
    }

    /* Show mobile-only buttons */
    .view-switcher-wrapper {
        display: block;
    }

    #box-select-btn {
        display: flex;
    }

    .top-bar-right {
        min-width: unset;
        gap: 4px;
    }

    .top-bar-right .zara-icon-btn {
        width: 28px;
        height: 28px;
    }

    .top-bar-right .zara-icon-btn svg {
        width: 13px;
        height: 13px;
    }

    /* Split view button visible on mobile */

    /* ── SPLIT VIEW CONTROLS: compact for mobile ── */
    .split-view-controls {
        height: 36px;
        padding: 0 8px;
        gap: 8px;
    }

    .split-control-left,
    .split-control-right {
        flex: 1;
        min-width: 0; /* Allow shrinking */
        overflow: hidden;
    }

    .split-selector-group {
        min-width: 0;
        overflow: hidden;
    }

    .split-select {
        font-size: 11px;
        min-width: 0;
        max-width: 100%;
        padding: 4px 18px 4px 6px;
        background-position: right 2px center;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
    }

    .split-pane-label {
        font-size: 9px;
        flex-shrink: 0;
    }

    .split-swap-btn {
        flex-shrink: 0;
        font-size: 14px;
        width: 28px;
        height: 28px;
    }

    /* Adjust canvas offset for shorter mobile split controls */
    #mindmap-container.split-view #canvas-wrapper,
    #mindmap-container.split-view .split-right-pane {
        top: 36px;
    }

    .split-divider {
        top: 36px;
    }

    /* ── SPLIT DIVIDER: larger touch target on mobile ── */
    .split-divider::before {
        left: -12px;
        width: 25px; /* Much larger touch target */
    }

    /* ── MAIN CONTAINER ── */
    #main-container {
        top: calc(44px + var(--safe-area-top));
        padding-bottom: var(--safe-area-bottom);
    }

    body.has-trial-banner #main-container {
        top: calc(80px + var(--safe-area-top));
    }

    /* ── LEFT SIDEBAR: narrow on mobile ── */
    #left-sidebar {
        width: 52px;
        box-shadow: 1px 0 8px rgba(0, 0, 0, 0.06);
    }

    .sidebar-nav {
        padding: 12px 0;
    }

    .sidebar-item {
        padding: 14px 0;
        font-size: 8px;
        letter-spacing: 1px;
        text-align: center;
        white-space: nowrap;
    }

    /* ── LEFT PANEL: compact overlay on mobile ── */
    #left-panel {
        left: 52px;
        width: 240px;
        max-width: 240px;
        box-shadow: 4px 0 16px rgba(0, 0, 0, 0.1);
    }

    #left-sidebar.hidden ~ #left-panel {
        transform: translateX(calc(-292px)); /* 52px sidebar + 240px panel */
    }

    .panel-header {
        padding: 10px 10px 8px;
    }

    .panel-title {
        font-size: 10px;
        letter-spacing: 0.5px;
    }

    .panel-body {
        padding: 0 4px;
    }

    .panel-search {
        padding: 0 8px;
    }

    .panel-search input {
        font-size: 11px;
    }

    .panel-footer {
        padding: 6px 8px;
    }

    .panel-action-btn {
        font-size: 9px;
        padding: 6px 8px;
    }

    /* Mindmap list items: compact */
    .mindmap-item {
        padding: 8px 10px;
    }

    .mindmap-item-name {
        font-size: 12px;
    }

    .mindmap-item-meta {
        font-size: 10px;
    }

    /* Node list items: compact */
    .node-item {
        padding: 6px 10px;
    }

    .node-item-text {
        font-size: 11px;
    }

    .node-item-map {
        font-size: 9px;
    }

    /* ── MINDMAP CONTAINER ── */
    #mindmap-container {
        width: 100%;
    }

    /* ── SETTINGS PANEL: full width on mobile ── */
    .settings-panel {
        width: 100vw;
        max-width: 100vw;
    }

    .settings-header {
        padding: 16px;
        padding-top: calc(16px + var(--safe-area-top));
    }

    .settings-body {
        padding: 12px 16px;
    }

    .settings-section {
        padding: 16px 0;
    }

    /* ── NODE DETAIL PANEL: full width on mobile ── */
    .node-detail-panel,
    #node-detail-panel {
        width: 100vw !important;
        max-width: 100vw !important;
    }

    /* ── MODALS: responsive ── */
    .modal-overlay .modal-content,
    .create-modal {
        width: 90vw;
        max-width: 340px;
    }

    /* ── FREE TIER LIMIT OVERLAY ── */
    .free-tier-limit-modal {
        width: 90vw;
        max-width: 340px;
        padding: 32px 24px;
    }

    /* ── SUBSCRIPTION GATE ── */
    .subscription-gate-content {
        width: 90vw;
        max-width: 340px;
        padding: 32px 24px;
    }

    /* ── MAP LIST ITEMS ── */
    .map-item {
        padding: 10px 12px;
    }

    .map-item-name {
        font-size: 12px;
    }

    /* ── SPACE LIST ITEMS ── */
    .space-item {
        padding: 10px 12px;
    }

    /* ── CONTEXT MENU: larger touch targets ── */
    .context-menu {
        min-width: 180px;
    }

    .context-menu-item {
        padding: 14px 20px;
        font-size: 13px;
    }

    /* ── LOGIN / AUTH FORMS ── */
    .account-auth-form {
        max-width: 90vw;
    }

    .auth-input {
        font-size: 14px; /* prevent iOS zoom on input focus */
        padding: 10px 12px;
    }

    /* ── HAMBURGER BUTTON ── */
    .hamburger-btn {
        width: 28px;
        height: 28px;
    }

    .hamburger-btn span {
        width: 16px;
    }
}

/* Extra small screens (iPhone SE etc.) */
@media (max-width: 380px) {
    #left-panel {
        width: calc(100vw - 52px);
        max-width: none;
    }
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE LIST VIEW — golden-ratio two-panel layout
   Left  38.2%  (1 / φ²)   — sidebar / whiteboard cards
   Right 61.8%  (φ / φ+1)  — detail / editor
   ═══════════════════════════════════════════════════════════════ */

/* Make the list container a flex row so both panels sit side-by-side.
   NOTE: No !important — JS must be able to override with display:none when hiding.
   The :has() selector is already more specific than #list-view-container alone. */
#list-view-container:has(.list-mobile-sidebar),
#list-view-container:has(.mobile-whiteboard-wrapper) {
    display: flex;
    flex-direction: row;
    overflow: hidden;
    position: relative;
}

/* ── Left sidebar ────────────────────────────────────────────── */
.list-mobile-sidebar {
    flex: 0 0 38.2%;
    max-width: 38.2%;
    display: flex;
    flex-direction: column;
    border-right: 0.5px solid var(--zara-divider);
    background: var(--zara-bg);
    overflow: hidden;
}

/* Tab bar */
.list-mobile-tabs {
    display: flex;
    flex-direction: row;
    border-bottom: 0.5px solid var(--zara-divider);
    background: var(--zara-bg);
    flex-shrink: 0;
}

.list-mobile-tab {
    flex: 1;
    padding: 10px 2px;
    border: none;
    background: transparent;
    font-size: 8px;
    font-weight: 500;
    letter-spacing: 1px;
    color: var(--zara-text-tertiary);
    text-transform: uppercase;
    cursor: pointer;
    text-align: center;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.list-mobile-tab.active {
    color: var(--zara-text);
    border-bottom-color: var(--accent-blue, #1a6ff4);
}

/* Scrollable item list */
.list-mobile-tab-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Compact row items */
.list-mobile-tab-body .list-row-item {
    padding: 10px 10px;
}

.list-mobile-tab-body .list-row-title {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Add button bar */
.list-mobile-add-bar {
    border-top: 0.5px solid var(--zara-divider);
    padding: 10px 12px;
    padding-bottom: calc(10px + var(--safe-area-bottom, 0px));
    flex-shrink: 0;
    background: var(--zara-bg);
}

.list-mobile-add-btn {
    width: 100%;
    height: 34px;
    border: 0.5px solid var(--zara-divider);
    background: transparent;
    font-size: 20px;
    font-weight: 200;
    color: var(--zara-text-secondary);
    cursor: pointer;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.list-mobile-add-btn:active {
    background: var(--zara-hover);
}

/* ── Right detail panel ──────────────────────────────────────── */
.list-mobile-detail-wrapper {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--zara-bg);
    overflow: hidden;
}

.list-mobile-detail-wrapper .list-detail-panel {
    flex: 1;
    width: 100%;
    border-left: none;
    box-shadow: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE WHITEBOARD — same golden-ratio two-panel layout
   ═══════════════════════════════════════════════════════════════ */

/* Left: whiteboard card list 38.2% */
.mobile-whiteboard-wrapper {
    flex: 0 0 38.2%;
    max-width: 38.2%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 0.5px solid var(--zara-divider);
}

.mobile-whiteboard-wrapper .execution-whiteboard {
    width: 100%;
    flex: 1;
    min-width: 0;
    border-right: none;
    background: var(--zara-bg);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Compact whiteboard typography for the narrow left pane */
.mobile-whiteboard-wrapper .whiteboard-header {
    padding: 10px 10px;
}

.mobile-whiteboard-wrapper .whiteboard-title {
    font-size: 8px;
    letter-spacing: 1.5px;
}

.mobile-whiteboard-wrapper .whiteboard-card {
    padding: 10px 10px;
    min-height: 70px;
}

.mobile-whiteboard-wrapper .whiteboard-card-title {
    font-size: 12px;
}

.mobile-whiteboard-wrapper .whiteboard-card-content {
    font-size: 11px;
    -webkit-line-clamp: 2;
}

/* Right: always-visible detail 61.8% */
.mobile-whiteboard-detail {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--zara-bg);
}

.mobile-whiteboard-detail .list-detail-panel {
    flex: 1;
    width: 100%;
    border-left: none;
    box-shadow: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Long text editor: comfortable on mobile */
.list-mobile-detail-wrapper .long-text-editor,
.mobile-whiteboard-detail .long-text-editor {
    padding: 16px 14px;
    font-size: 13px;
}

/* Long text gallery: single column on mobile */
.list-mobile-detail-wrapper .long-text-gallery,
.mobile-whiteboard-detail .long-text-gallery {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
}

/* ─────────────────────────────────────────────────────────────
   MOBILE DETAIL PANEL — content width overrides
   Removes the 400px min-width and re-fits all inner content
   ───────────────────────────────────────────────────────────── */
.list-mobile-detail-wrapper .list-detail-panel,
.mobile-whiteboard-detail .list-detail-panel {
    min-width: 0 !important;   /* kill the 400px desktop floor */
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Compact header */
.list-mobile-detail-wrapper .list-detail-panel-header,
.mobile-whiteboard-detail .list-detail-panel-header {
    padding: 10px 10px;
    flex-wrap: wrap;
    gap: 4px;
    min-height: unset;
}

/* Shrink action buttons slightly */
.list-mobile-detail-wrapper .list-detail-action-btn-minimal,
.mobile-whiteboard-detail .list-detail-action-btn-minimal {
    width: 20px;
    height: 20px;
}

/* Reduce section padding */
.list-mobile-detail-wrapper .list-detail-section,
.mobile-whiteboard-detail .list-detail-section {
    padding: 12px 10px;
}

/* Name / notes inputs: full width */
.list-mobile-detail-wrapper .list-detail-name-input,
.mobile-whiteboard-detail .list-detail-name-input,
.list-mobile-detail-wrapper .list-detail-content-textarea,
.mobile-whiteboard-detail .list-detail-content-textarea {
    width: 100%;
    box-sizing: border-box;
    font-size: 13px;
    padding: 8px 10px;
}

/* Schedule: stack label above input */
.list-mobile-detail-wrapper .list-detail-schedule-row,
.mobile-whiteboard-detail .list-detail-schedule-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.list-mobile-detail-wrapper .list-detail-schedule-label,
.mobile-whiteboard-detail .list-detail-schedule-label {
    width: auto;
    font-size: 10px;
}

.list-mobile-detail-wrapper .list-detail-schedule-input,
.mobile-whiteboard-detail .list-detail-schedule-input {
    width: 100%;
    box-sizing: border-box;
    font-size: 12px;
    padding: 7px 8px;
}

/* Duration row */
.list-mobile-detail-wrapper .list-detail-duration-input-wrapper,
.mobile-whiteboard-detail .list-detail-duration-input-wrapper {
    width: 100%;
}

.list-mobile-detail-wrapper .list-detail-duration-input,
.mobile-whiteboard-detail .list-detail-duration-input {
    flex: 1;
    width: 100%;
    box-sizing: border-box;
    font-size: 12px;
    padding: 7px 8px;
}

/* Tags: stack the two columns vertically */
.list-mobile-detail-wrapper .zara-tags-columns,
.mobile-whiteboard-detail .zara-tags-columns {
    flex-direction: column;
    gap: 8px;
}

.list-mobile-detail-wrapper .zara-tags-column,
.mobile-whiteboard-detail .zara-tags-column {
    max-height: 120px;
}

/* Tags search input */
.list-mobile-detail-wrapper .zara-tags-search,
.mobile-whiteboard-detail .zara-tags-search {
    width: 100%;
    box-sizing: border-box;
}

.list-mobile-detail-wrapper .zara-tags-search-input,
.mobile-whiteboard-detail .zara-tags-search-input {
    width: 100%;
    box-sizing: border-box;
    font-size: 12px;
}

/* Actions grid */
.list-mobile-detail-wrapper .list-detail-actions-grid,
.mobile-whiteboard-detail .list-detail-actions-grid {
    flex-direction: column;
    gap: 6px;
}

.list-mobile-detail-wrapper .list-action-btn,
.mobile-whiteboard-detail .list-action-btn {
    width: 100%;
    box-sizing: border-box;
}

/* Save button */
.list-mobile-detail-wrapper .list-detail-save-btn,
.mobile-whiteboard-detail .list-detail-save-btn {
    width: 100%;
    box-sizing: border-box;
}

/* ===== Wiki Link Autocomplete Dropdown ===== */
.wiki-link-dropdown {
    position: fixed;
    z-index: 4000;
    background: #FFFFFF;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14);
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    display: none;
}

.wiki-link-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 300;
    letter-spacing: 0.3px;
    color: #000;
    transition: background 0.1s;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.04);
}

.wiki-link-item:last-child {
    border-bottom: none;
}

.wiki-link-item:hover,
.wiki-link-item.selected {
    background: rgba(0, 122, 255, 0.06);
}

.wiki-link-item.selected {
    border-left: 2px solid #007AFF;
    padding-left: 12px;
}

.wiki-link-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wiki-link-name strong {
    font-weight: 500;
    color: #007AFF;
}

.wiki-link-path {
    font-size: 10px;
    color: rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
    flex-shrink: 0;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== Wiki Link Picker Popup (Cmd+Click multi-link) ===== */
.wiki-link-picker {
    position: fixed;
    z-index: 5000;
    background: #FFFFFF;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    min-width: 160px;
    max-width: 300px;
}

.wiki-link-picker-item {
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.5px;
    color: #007AFF;
    cursor: pointer;
    transition: background 0.1s;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.04);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.wiki-link-picker-item:last-child {
    border-bottom: none;
}

.wiki-link-picker-item:hover {
    background: rgba(0, 122, 255, 0.06);
}

/* ===== Text Editor Wiki Link Backdrop (Obsidian-style) ===== */
.text-editor-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 40px 60px;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
    font-size: 16px;
    font-weight: 300;
    letter-spacing: 0.3px;
    line-height: 2;
    color: rgba(0, 0, 0, 0.85);
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow: hidden;
    pointer-events: none;
    z-index: 3;
    background: transparent;
}

/* When backdrop is active, make textarea text invisible but keep caret */
.text-editor-textarea.has-wiki-links {
    color: transparent !important;
    caret-color: rgba(0, 0, 0, 0.85);
    position: relative;
    z-index: 1;
    background: transparent;
}

/* Wiki link spans in the backdrop — clickable */
.te-wiki-link {
    color: #007AFF;
    cursor: pointer;
    pointer-events: auto;
}

.te-wiki-link:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}
