:root {
    /* Color System - Dark Premium Theme */
    --primary-color: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.3);
    --primary-hover: #818cf8;
    --primary-active: #4f46e5;
    
    --bg-color: #0a0e27;
    --bg-secondary: #0f1340;
    --text-color: #e2e8f0;
    --text-muted: #94a3b8;
    --card-bg: #131837;
    --border-color: rgba(99, 102, 241, 0.15);
    --input-border: rgba(148, 163, 184, 0.3);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    
    /* Typography Tokens */
    --font-inter: 'Inter', system-ui, -apple-system, sans-serif;
    --h1-size: 2.75rem;
    --h2-size: 2rem;
    --h3-size: 1.25rem;
    --body-size: 1rem;
    --caption-size: 0.875rem;
    --small-size: 0.75rem;
}

@media print {
    .main-header, .mobile-menu, .input-section, .canvas-controls, .export-bar, 
    .saved-maps, .info-section, .faq-section, footer, .tour-overlay, 
    .autosave-indicator, #toast, .offline-banner, .minimap-container {
        display: none !important;
    }
    body, .container { padding: 0; margin: 0; background: white; }
    .canvas-wrapper { border: none; box-shadow: none; height: auto; }
    .mindmap-canvas { height: 100vh; background: none; }
    #svg-canvas { width: 100%; height: 100%; }
}

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;
}

.offline-banner {
    background: var(--warning-color); color: #0a0e27; padding: 0.5rem 1rem;
    display: flex; justify-content: space-between; align-items: center;
    font-weight: 600; z-index: 50; position: relative;
}
.offline-banner button {
    background: transparent; border: none; color: #0a0e27; font-size: 1.25rem;
    cursor: pointer; min-width: 44px; min-height: 44px;
}

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

body {
    font-family: var(--font-inter);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

.container { max-width: 1200px; margin: 0 auto; padding: 2rem; }

/* Header & Nav */
.main-header {
    background: rgba(19, 24, 55, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 1rem 2rem;
    position: sticky; top: 0; z-index: 100;
    border-bottom: 1px solid var(--border-color);
}
.header-content {
    max-width: 1200px; margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center;
}
.logo-container {
    display: flex; align-items: center; text-decoration: none; color: var(--text-color);
}
.logo-image { height: 32px; width: auto; }
.brand-name {
    font-weight: 800; font-size: 1.4rem; margin-left: 0.75rem;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-link {
    text-decoration: none; color: #cbd5e1; font-weight: 600;
    font-size: 0.95rem; transition: color 0.2s;
}
.nav-link:hover, .nav-link.active { color: var(--primary-color); }

/* Hero */
.hero-section { text-align: center; margin-bottom: 3rem; }
.hero-section h1 { font-size: var(--h1-size); font-weight: 800; margin-bottom: 0.5rem; color: #fff; }
.gradient-text {
    background: linear-gradient(135deg, #6366f1, #a855f7, #ec4899);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.subtitle { font-size: 1.25rem; color: var(--text-muted); }

/* Input Section */
.input-section { margin-bottom: 2rem; }
.input-container { display: flex; flex-direction: column; gap: 1rem; }
.input-toggle { display: flex; gap: 0.5rem; justify-content: center; }
.toggle-btn {
    padding: 0.5rem 1.5rem; border-radius: var(--radius-xl);
    border: 1px solid var(--border-color); background: var(--card-bg);
    color: var(--text-muted); cursor: pointer; font-weight: 600; min-height: 44px;
    transition: all 0.2s;
}
.toggle-btn.active {
    background: var(--primary-color); color: white; border-color: var(--primary-color);
}
.input-group {
    display: flex; gap: 1rem; background: var(--card-bg);
    padding: 1rem; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); border: 1px solid var(--border-color);
    position: relative;
}
.input-group input {
    flex: 1; padding: 0.75rem 1rem; border: 1px solid var(--input-border);
    border-radius: var(--radius-md); font-size: 1rem; outline: none; min-height: 44px;
    background: var(--bg-color); color: var(--text-color);
}
.input-group input:focus {
    border-color: var(--primary-color); box-shadow: 0 0 0 3px var(--primary-glow);
}
.input-group input::placeholder { color: var(--text-muted); }
.input-group select {
    padding: 0.75rem; border: 1px solid var(--input-border);
    border-radius: var(--radius-md); background: var(--bg-color);
    color: var(--text-color); font-size: 1rem; min-height: 44px;
}

#generateBtn, #generateFromUrlBtn {
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), #a855f7);
    color: white; border: none; border-radius: var(--radius-md);
    font-weight: 700; cursor: pointer; transition: all 0.2s; min-height: 44px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}
#generateBtn:hover, #generateFromUrlBtn:hover {
    transform: translateY(-2px); filter: brightness(1.1);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

/* Search Bar */
.search-bar {
    max-width: 600px; margin: 0 auto 1.5rem; position: relative;
    background: var(--card-bg); padding: 0.75rem 1rem;
    border-radius: var(--radius-xl); border: 1px solid var(--border-color);
    box-shadow: var(--shadow); display: flex; align-items: center; gap: 0.75rem;
}
.search-bar input {
    border: none; outline: none; flex: 1; font-size: 1rem;
    min-height: 44px; background: transparent; color: var(--text-color);
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar i { color: var(--text-muted); }

/* Canvas Area */
.canvas-wrapper {
    position: relative; background: var(--card-bg);
    border-radius: var(--radius-lg); border: 1px solid var(--border-color);
    box-shadow: 0 0 60px rgba(99, 102, 241, 0.06), var(--shadow-lg);
    overflow: hidden; margin-bottom: 2rem;
}
.mindmap-canvas {
    width: 100%; height: 600px;
    background: 
        radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.03) 0%, transparent 70%),
        radial-gradient(circle, rgba(99, 102, 241, 0.08) 1px, transparent 1px);
    background-size: 100% 100%, 24px 24px;
}
#svg-canvas { width: 100%; height: 100%; cursor: grab; touch-action: none; }
#svg-canvas:active { cursor: grabbing; }

.canvas-controls {
    position: absolute; top: 1rem; left: 1rem; right: 1rem;
    display: flex; justify-content: space-between;
    pointer-events: none; z-index: 10;
}
.control-group { display: flex; gap: 0.5rem; pointer-events: auto; }
.control-group button {
    padding: 0.5rem 1rem; min-height: 40px;
    background: rgba(19, 24, 55, 0.9); backdrop-filter: blur(10px);
    border: 1px solid var(--border-color); border-radius: var(--radius-md);
    cursor: pointer; font-size: 0.8rem; font-weight: 600;
    color: var(--text-muted); box-shadow: var(--shadow);
    transition: all 0.2s; display: flex; align-items: center;
    justify-content: center; gap: 0.4rem;
}
.control-group button:hover { background: var(--card-bg); color: var(--text-color); }
.control-group button.active {
    background: var(--primary-color); color: white; border-color: var(--primary-color);
}

.theme-select {
    padding: 0.5rem; min-height: 40px; font-size: 0.8rem;
    background: rgba(19, 24, 55, 0.9); backdrop-filter: blur(10px);
    border: 1px solid var(--border-color); border-radius: var(--radius-md);
    color: var(--text-muted); cursor: pointer;
}

/* Node Styling */
.node { cursor: pointer; }
.node:focus { outline: none; }
.node:focus rect { stroke: var(--primary-color); stroke-width: 4px; }
.node rect {
    stroke-width: 2px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.node:hover rect {
    filter: drop-shadow(0 0 16px var(--primary-glow)) drop-shadow(0 8px 15px rgba(0,0,0,0.3));
}
.node text { font-size: 14px; font-weight: 600; pointer-events: none; user-select: none; }
.node-text-wrap {
    display: flex; align-items: center; justify-content: center;
    height: 100%; width: 100%; overflow: hidden; text-align: center;
    line-height: 1.4; word-break: break-word;
}
.node.selected rect {
    stroke: var(--primary-color); stroke-width: 3px;
    stroke-dasharray: 4; animation: dash 1s linear infinite;
    filter: drop-shadow(0 0 12px var(--primary-glow));
}
.node.dimmed { opacity: 0.2; }

@keyframes dash { to { stroke-dashoffset: -8; } }

/* Cross links */
.cross-link { fill: none; stroke: var(--text-muted); stroke-width: 1.5; stroke-dasharray: 4; opacity: 0.4; }

/* Tooltip */
#node-hover-tooltip {
    position: absolute; background: var(--card-bg); color: var(--text-color);
    padding: 0.5rem 0.75rem; border-radius: var(--radius-sm);
    font-size: var(--small-size); pointer-events: none; z-index: 1000;
    white-space: pre-wrap; max-width: 200px; box-shadow: var(--shadow-lg);
    opacity: 0; transition: opacity 0.2s; border: 1px solid var(--border-color);
}

/* Empty State */
.empty-state {
    position: absolute; inset: 0; display: flex; align-items: center;
    justify-content: center; background: var(--card-bg); z-index: 5;
    text-align: center; padding: 2rem;
}
.empty-state-content { max-width: 500px; }
.empty-state-icon { font-size: 4rem; margin-bottom: 1rem; animation: float 3s ease-in-out infinite; }
.empty-state h2 { color: #fff; margin-bottom: 0.5rem; }
.empty-state p { color: var(--text-muted); }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.demo-grid {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 1rem; margin-top: 2rem;
}
.demo-card {
    background: var(--bg-color); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); padding: 1.25rem;
    cursor: pointer; transition: all 0.3s; display: flex;
    flex-direction: column; align-items: center; gap: 0.75rem; min-height: 44px;
}
.demo-card:hover {
    border-color: var(--primary-color); transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.2);
    background: rgba(99, 102, 241, 0.05);
}
.demo-card i { font-size: 1.5rem; color: var(--primary-color); }
.demo-card span { color: var(--text-color); font-weight: 600; font-size: 0.9rem; }

/* Skeleton Loading */
.skeleton-overlay {
    position: absolute; inset: 0; background: var(--card-bg);
    z-index: 6; display: flex; align-items: center; justify-content: center;
}
.skeleton-node {
    position: absolute; background: rgba(99, 102, 241, 0.1);
    border-radius: 12px; width: 120px; height: 40px;
}
.skeleton-node.root {
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 140px; height: 50px; background: rgba(99, 102, 241, 0.2);
}
.skeleton-node.c1 { top: 30%; left: 30%; }
.skeleton-node.c2 { top: 70%; left: 30%; }
.skeleton-node.c3 { top: 50%; left: 70%; }
.pulsing { animation: pulse 1.5s infinite ease-in-out; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* Autosave */
.autosave-indicator {
    position: absolute; right: -100px; top: 50%; transform: translateY(-50%);
    background: var(--success-color); color: white;
    padding: 0.25rem 0.75rem; border-radius: var(--radius-xl);
    font-size: var(--small-size); font-weight: 700; transition: opacity 0.3s;
}
@media (max-width: 1300px) {
    .autosave-indicator { position: static; transform: none; margin-top: 0.5rem; }
}

/* Minimap */
.minimap-container {
    position: absolute; bottom: 1rem; right: 1rem;
    width: 180px; height: 130px;
    background: rgba(19, 24, 55, 0.85); backdrop-filter: blur(8px);
    border: 1px solid var(--border-color); border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg); z-index: 20; overflow: hidden;
}
#minimap-svg { width: 100%; height: 100%; }
#minimap-viewport {
    position: absolute; border: 2px solid var(--primary-color);
    background: rgba(99, 102, 241, 0.1); pointer-events: none;
}

/* Context Menu */
.context-menu {
    position: absolute; background: var(--card-bg);
    border: 1px solid var(--border-color); border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg); padding: 0.5rem 0; z-index: 1000; min-width: 180px;
}
.menu-item {
    padding: 0.75rem 1rem; cursor: pointer; display: flex; align-items: center;
    gap: 0.75rem; font-size: 0.9rem; font-weight: 500; width: 100%;
    border: none; background: none; text-align: left; min-height: 44px;
    color: var(--text-color);
}
.menu-item:hover { background: rgba(99, 102, 241, 0.1); color: var(--primary-color); }
.menu-item i { width: 16px; text-align: center; }
.menu-colors { display: flex; padding: 0.5rem 1rem; gap: 0.5rem; }
.context-menu hr { border: 0; border-top: 1px solid var(--border-color); margin: 0.25rem 0; }

/* Tour / Onboarding */
.tour-overlay {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6);
    z-index: 2000; pointer-events: none;
}
.tour-tooltip {
    position: absolute; background: var(--card-bg); color: var(--text-color);
    padding: 1.5rem; border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5); border: 1px solid var(--border-color);
    width: 280px; pointer-events: auto; z-index: 2001;
}
.tour-tooltip h3 { margin-bottom: 0.5rem; color: var(--primary-color); }
.tour-tooltip p { margin-bottom: 1rem; font-size: 0.95rem; color: var(--text-muted); }
.tour-arrow {
    position: absolute; width: 0; height: 0;
    border-left: 10px solid transparent; border-right: 10px solid transparent;
}
.arrow-up { border-bottom: 10px solid var(--card-bg); top: -10px; left: 50%; transform: translateX(-50%); }

.link { fill: none; stroke: rgba(148, 163, 184, 0.5); stroke-width: 2.5px; stroke-linecap: round; transition: stroke 0.3s; }

/* Popup */
.node-popup {
    position: absolute; background: var(--card-bg);
    border: 1px solid var(--border-color); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); padding: 1rem; z-index: 100;
    width: 320px; display: flex; flex-direction: column; gap: 0.75rem;
}
.popup-header { display: flex; gap: 0.5rem; }
#nodeEditInput {
    flex: 1; padding: 0.5rem; border: 1px solid var(--input-border);
    border-radius: var(--radius-sm); min-height: 44px;
    background: var(--bg-color); color: var(--text-color);
}
#closePopup {
    background: none; border: none; font-size: 1.5rem; cursor: pointer;
    line-height: 1; min-width: 44px; min-height: 44px; color: var(--text-muted);
}
#closePopup:hover { color: var(--text-color); }
.emoji-picker {
    display: flex; flex-wrap: wrap; gap: 0.25rem; padding: 0.5rem;
    background: var(--bg-color); border-radius: var(--radius-md);
}
.emoji-item {
    font-size: 1.25rem; cursor: pointer; padding: 0.25rem;
    border-radius: var(--radius-sm); transition: background 0.2s;
    background: none; border: none; min-width: 40px; min-height: 40px;
}
.emoji-item:hover { background: rgba(99, 102, 241, 0.15); }
.popup-actions { display: flex; gap: 0.5rem; }
.ai-btn {
    flex: 2; background: linear-gradient(135deg, var(--primary-color), #a855f7);
    color: white; border: none; padding: 0.5rem; border-radius: var(--radius-sm);
    font-weight: 700; cursor: pointer; min-height: 44px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    transition: all 0.2s;
}
.ai-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4); }
.danger-btn {
    flex: 1; background: var(--error-color); color: white;
    border: none; padding: 0.5rem; border-radius: var(--radius-sm);
    cursor: pointer; min-height: 44px; transition: all 0.2s;
}
.danger-btn:hover { background: #dc2626; }

/* AI Chat Section */
.ai-chat-section {
    border-top: 1px solid var(--border-color); padding-top: 0.75rem;
    display: flex; flex-direction: column; gap: 0.5rem;
}
.node-note {
    background: rgba(99, 102, 241, 0.1); padding: 0.75rem;
    border-radius: var(--radius-md); font-size: 0.85rem;
    border: 1px solid var(--border-color); max-height: 120px;
    overflow-y: auto; color: var(--text-color);
}
.chat-input-wrapper { display: flex; gap: 0.5rem; }
.chat-input-wrapper input {
    flex: 1; padding: 0.5rem; border: 1px solid var(--input-border);
    border-radius: var(--radius-sm); font-size: 0.85rem; min-height: 44px;
    background: var(--bg-color); color: var(--text-color);
}
.chat-input-wrapper input::placeholder { color: var(--text-muted); }
#aiChatBtn {
    background: var(--primary-color); color: white; border: none;
    padding: 0.5rem 0.75rem; border-radius: var(--radius-sm);
    cursor: pointer; min-width: 44px; min-height: 44px;
}
.color-picker { display: flex; gap: 0.5rem; justify-content: center; }
.color-swatch {
    width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
    border: 2px solid rgba(255,255,255,0.2); box-shadow: 0 0 0 1px var(--border-color);
    min-width: 28px; min-height: 28px; transition: transform 0.2s;
}
.color-swatch:hover { transform: scale(1.3); }

/* Export Bar */
.export-bar {
    display: flex; justify-content: center; gap: 1rem;
    flex-wrap: wrap; margin-bottom: 3rem;
}
.secondary-btn {
    padding: 0.75rem 1.5rem; min-height: 44px;
    background: rgba(99, 102, 241, 0.1); border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-md); font-weight: 600; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    color: var(--text-color); transition: all 0.2s;
}
.secondary-btn:hover {
    border-color: var(--primary-color); color: var(--primary-hover);
    background: rgba(99, 102, 241, 0.15);
    transform: translateY(-1px);
}
.primary-btn {
    padding: 0.75rem 1.5rem; min-height: 44px;
    background: var(--primary-color); color: white; border: none;
    border-radius: var(--radius-md); font-weight: 600; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    transition: all 0.2s;
}
.primary-btn:hover { background: var(--primary-hover); }

/* Presentation Mode */
/* Presentation Mode */
.presenting #svg-canvas { background: #050820; }
.presenting .main-header, .presenting .hero-section, .presenting .input-section,
.presenting .search-bar, .presenting .export-bar, .presenting .info-section,
.presenting .faq-section, .presenting footer, .presenting .canvas-controls,
.presenting .minimap-container, .presenting #nodePopup, .presenting #contextMenu { display: none !important; }
.presenting .canvas-wrapper {
    position: fixed; inset: 0; z-index: 9999; border-radius: 0; border: none;
    touch-action: none;
}
.presenting .mindmap-canvas { height: 100vh; touch-action: none; }
.presenting #svg-canvas { touch-action: none; -webkit-user-select: none; user-select: none; }

.presentation-controls {
    position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%);
    background: rgba(19, 24, 55, 0.95); backdrop-filter: blur(12px);
    padding: 0.75rem 1.5rem; border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg); border: 1px solid var(--border-color);
    display: flex; gap: 1rem; z-index: 10001; align-items: center;
    color: var(--text-color);
}
.presentation-controls button {
    min-width: 44px; min-height: 44px; background: none; border: none;
    color: var(--text-color); cursor: pointer; font-size: 1rem;
    border-radius: var(--radius-sm); transition: background 0.2s;
}
.presentation-controls button:hover { background: rgba(99, 102, 241, 0.2); }

/* Exit button - top right corner, always visible */
.pres-exit-corner {
    position: fixed; top: 1.5rem; right: 1.5rem; z-index: 10002;
    background: rgba(239, 68, 68, 0.9); color: white; border: none;
    padding: 0.6rem 1.2rem; border-radius: var(--radius-md);
    font-weight: 700; font-size: 1rem; cursor: pointer;
    display: flex; align-items: center; gap: 0.5rem;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
    transition: all 0.2s; min-height: 44px;
}
.pres-exit-corner:hover { background: #ef4444; transform: scale(1.05); }

/* Caption overlay */
.pres-caption {
    position: fixed; bottom: 6rem; left: 50%; transform: translateX(-50%);
    z-index: 10001; text-align: center; opacity: 0;
    transition: opacity 0.4s ease; pointer-events: none;
}
.pres-caption.pres-caption-visible { opacity: 1; }
.pres-caption-depth {
    display: block; font-size: 0.75rem; text-transform: uppercase;
    letter-spacing: 2px; color: var(--primary-color); margin-bottom: 0.25rem;
    font-weight: 700;
}
.pres-caption-text {
    display: block; font-size: 1.8rem; font-weight: 800; color: white;
    text-shadow: 0 2px 20px rgba(0,0,0,0.5);
    background: rgba(10, 14, 39, 0.7); padding: 0.5rem 1.5rem;
    border-radius: var(--radius-lg); backdrop-filter: blur(8px);
}

/* Progress bar */
.pres-progress-bar {
    position: fixed; top: 0; left: 0; right: 0; height: 4px;
    background: rgba(255,255,255,0.1); z-index: 10002;
}
.pres-progress-fill {
    height: 100%; background: linear-gradient(90deg, var(--primary-color), #a855f7);
    transition: width 0.5s ease; width: 0%;
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Presentation node states */
.node.pres-active rect {
    filter: drop-shadow(0 0 20px var(--primary-glow)) drop-shadow(0 0 40px rgba(99, 102, 241, 0.3));
}
.node.pres-active { transform-origin: center; }
.node.pres-dimmed { opacity: 0.15; transition: opacity 0.5s ease; }
.node.pres-active { opacity: 1; transition: opacity 0.5s ease; }

/* Dragging cursor */
.node.dragging { cursor: grabbing; }
.node { cursor: grab; }

/* How It Works */
.info-section { padding: 4rem 0; border-top: 1px solid var(--border-color); }
.info-section h2 { text-align: center; margin-bottom: 3rem; color: #fff; }
.steps-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem;
}
.step-card {
    text-align: center; padding: 2rem; background: var(--card-bg);
    border-radius: var(--radius-lg); box-shadow: var(--shadow);
    border: 1px solid var(--border-color); transition: all 0.3s;
}
.step-card:hover { transform: translateY(-4px); border-color: var(--primary-color); }
.step-card h3 { color: #fff; margin-bottom: 0.5rem; }
.step-card p { color: var(--text-muted); }
.step-num {
    width: 40px; height: 40px; background: var(--primary-color); color: white;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 800; margin: 0 auto 1.5rem;
}

/* FAQ */
.faq-section { padding: 3rem 0; }
.faq-section h2 { text-align: center; margin-bottom: 2rem; color: #fff; }
.faq-item {
    margin-bottom: 1.5rem; padding: 1.5rem; background: var(--card-bg);
    border-radius: var(--radius-md); border: 1px solid var(--border-color);
}
.faq-item h3 { color: var(--primary-color); margin-bottom: 0.5rem; }
.faq-item p { color: var(--text-muted); }

/* Footer */
footer {
    padding: 2rem; border-top: 1px solid var(--border-color);
    text-align: center; color: var(--text-muted);
}
.footer-content { max-width: 1200px; margin: 0 auto; }
.footer-links { display: flex; gap: 1.5rem; justify-content: center; margin-top: 0.5rem; }
.footer-links a { color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--primary-color); }

/* Saved Maps */
.saved-maps { margin-bottom: 2rem; }
.saved-maps h3 { color: #fff; margin-bottom: 1rem; }
.maps-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem;
}

/* Toast */
.toast {
    position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%);
    background: var(--card-bg); color: var(--text-color);
    padding: 0.75rem 1.5rem; border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg); border: 1px solid var(--border-color);
    z-index: 10001; font-weight: 600; transition: opacity 0.3s;
}

/* Expand button */
.expand-btn { cursor: pointer; opacity: 0; transition: opacity 0.2s; }
.node:hover .expand-btn { opacity: 1; }
.expand-icon { font-size: 14px; font-weight: bold; pointer-events: none; }

/* Mobile */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .mobile-toggle {
        display: flex; align-items: center; justify-content: center;
        width: 44px; height: 44px; cursor: pointer; font-size: 1.5rem;
        background: none; border: none; color: var(--text-color);
    }
    .hero-section h1 { font-size: 1.8rem; }
    .hero-section .subtitle { font-size: 1rem; }
    .input-group { flex-direction: column; gap: 0.75rem; }
    .input-group input, .input-group select, #generateBtn, #generateFromUrlBtn {
        width: 100%; min-height: 44px;
    }
    .mindmap-canvas { height: 400px; min-height: 400px; }
    .node-popup {
        position: fixed; bottom: 0; left: 0; right: 0; top: auto;
        width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        transform: translateY(0); transition: transform 0.3s ease-out;
        z-index: 1000; padding-bottom: 2rem;
        max-height: 60vh; overflow-y: auto;
    }
    .node-popup.hidden { transform: translateY(100%); display: flex !important; }
    .export-bar { flex-direction: column; gap: 0.75rem; }
    .export-bar button { width: 100%; min-height: 44px; }
    .steps-grid { grid-template-columns: 1fr; }
    .minimap-container { width: 120px; height: 90px; }
    .canvas-controls { flex-wrap: wrap; gap: 0.5rem; align-items: flex-start; }
    .control-group { flex-wrap: wrap; gap: 0.25rem; }
    .control-group button { padding: 0.35rem 0.5rem; font-size: 0.7rem; min-height: 34px; }
    .theme-select { font-size: 0.7rem; min-height: 34px; padding: 0.35rem; }
}

@media (max-width: 480px) {
    .hero-section h1 { font-size: 1.5rem; }
    .container { padding: 1rem; }
    .demo-grid { grid-template-columns: 1fr; }
}

/* Mobile Menu */
.mobile-menu {
    display: none; position: fixed; top: 70px; left: 0; right: 0;
    background: var(--card-bg); flex-direction: column; padding: 1rem;
    border-bottom: 1px solid var(--border-color); box-shadow: var(--shadow-lg); z-index: 99;
}
.mobile-menu.active { display: flex; }
.mobile-menu .nav-link {
    padding: 1rem; border-bottom: 1px solid var(--border-color);
    min-height: 44px; color: var(--text-muted);
}

/* Spinner */
.spinner {
    width: 20px; height: 20px; border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white; border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }
