/* ============================================
   Store Mind Map — Professional Interactive UI
   ============================================ */

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

:root {
    --bg-deep: #0a0a0f;
    --bg-surface: #12121a;
    --bg-elevated: #1a1a26;
    --bg-card: rgba(255, 255, 255, 0.04);
    --border: rgba(255, 255, 255, 0.08);
    --border-active: rgba(255, 255, 255, 0.18);
    --text-primary: #f0f0f5;
    --text-secondary: #9898a8;
    --text-muted: #5c5c6e;
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.35);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.5);
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-spring: 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    --header-h: 72px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: var(--font);
    background: var(--bg-deep);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    position: relative;
    overflow: hidden;
}

/* ── Header ── */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
    padding: 0 24px;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    flex-shrink: 0;
}

.header__brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header__logo {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    border-radius: var(--radius-sm);
    color: white;
}

.header__logo svg {
    width: 22px;
    height: 22px;
}

.header__title {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.header__subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.header__controls {
    display: flex;
    gap: 6px;
}

.ctrl-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.ctrl-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border-active);
    transform: translateY(-1px);
}

.ctrl-btn:active {
    transform: translateY(0);
}

.ctrl-btn svg {
    width: 18px;
    height: 18px;
}

/* ── Canvas ── */
.canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    cursor: grab;
    touch-action: none;
}

.canvas-container.is-dragging {
    cursor: grabbing;
}

.canvas-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.canvas-bg__grid {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 1px 1px, rgba(255,255,255,0.04) 1px, transparent 0);
    background-size: 32px 32px;
    opacity: 0.6;
}

.canvas-bg__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: glowPulse 8s ease-in-out infinite;
}

.canvas-bg__glow--1 {
    width: 500px;
    height: 500px;
    background: var(--accent);
    top: -10%;
    right: -5%;
}

.canvas-bg__glow--2 {
    width: 400px;
    height: 400px;
    background: #8b5cf6;
    bottom: -10%;
    left: -5%;
    animation-delay: -4s;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.12; transform: scale(1); }
    50% { opacity: 0.2; transform: scale(1.1); }
}

.connections {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: visible;
}

.connections line,
.connections path {
    fill: none;
    stroke-linecap: round;
    transition: stroke-opacity var(--transition-smooth), stroke-width var(--transition-fast);
}

.nodes-layer {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    will-change: transform;
    z-index: 2;
}

.zoom-indicator {
    position: absolute;
    bottom: 20px;
    left: 20px;
    padding: 6px 12px;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    z-index: 10;
    opacity: 0;
    transition: opacity var(--transition-fast);
    pointer-events: none;
}

.zoom-indicator.is-visible {
    opacity: 1;
}

/* ── Mind Map Nodes ── */
.mind-node {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: var(--bg-elevated);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
    transition:
        transform var(--transition-spring),
        box-shadow var(--transition-smooth),
        border-color var(--transition-fast),
        opacity var(--transition-smooth),
        filter var(--transition-smooth);
    transform-origin: center center;
    transform: translate(-50%, -50%);
    opacity: 0;
    animation: nodeAppear 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes nodeAppear {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.6) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) translateY(0);
    }
}

.mind-node:hover {
    transform: translate(-50%, -50%) scale(1.06) translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-active);
    z-index: 5;
}

.mind-node.is-root {
    padding: 18px 28px;
    border-radius: var(--radius-xl);
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: var(--shadow-md), 0 0 40px var(--accent-glow);
}

.mind-node.is-active {
    border-color: var(--node-color, var(--accent));
    box-shadow: var(--shadow-md), 0 0 30px color-mix(in srgb, var(--node-color, var(--accent)) 30%, transparent);
    transform: translate(-50%, -50%) scale(1.08);
    z-index: 10;
}

.mind-node.is-dimmed {
    opacity: 0.25;
    filter: grayscale(0.5);
    pointer-events: none;
}

.mind-node.is-collapsed-branch {
    opacity: 0.4;
    transform: translate(-50%, -50%) scale(0.92);
}

.mind-node__icon {
    font-size: 1.25rem;
    line-height: 1;
    flex-shrink: 0;
}

.mind-node.is-root .mind-node__icon {
    font-size: 1.5rem;
}

.mind-node__label {
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.mind-node.is-root .mind-node__label {
    font-size: 1.05rem;
}

.mind-node__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-left: 4px;
}

.mind-node__pulse {
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    border: 2px solid var(--node-color, var(--accent));
    opacity: 0;
    animation: nodePulse 1.5s ease-out;
    pointer-events: none;
}

@keyframes nodePulse {
    0% { opacity: 0.6; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.15); }
}

/* ── Detail Overlay (Full Page) ── */
.detail-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    pointer-events: none;
    visibility: hidden;
}

.detail-overlay.is-open {
    pointer-events: auto;
    visibility: visible;
}

.detail-overlay__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    transition: all var(--transition-smooth);
}

.detail-overlay.is-open .detail-overlay__backdrop {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.detail-panel {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    transform: translateY(100%);
    transition: transform var(--transition-smooth);
    overflow: hidden;
}

.detail-overlay.is-open .detail-panel {
    transform: translateY(0);
}

.detail-overlay.is-closing .detail-panel {
    transform: translateY(100%);
}

.detail-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    min-height: 60px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    font-size: 0.8rem;
}

.breadcrumb__item {
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition-fast);
    padding: 4px 0;
}

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

.breadcrumb__item.is-current {
    color: var(--text-primary);
    font-weight: 500;
    cursor: default;
}

.breadcrumb__sep {
    color: var(--text-muted);
    margin: 0 4px;
    user-select: none;
}

.detail-panel__close {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.detail-panel__close:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
    transform: rotate(90deg);
}

.detail-panel__close svg {
    width: 20px;
    height: 20px;
}

.detail-panel__hero {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 40px 32px 32px;
    flex-shrink: 0;
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-smooth);
}

.detail-overlay.is-open .detail-panel__hero {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.1s;
}

.detail-panel__icon {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    border-radius: var(--radius-lg);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    flex-shrink: 0;
    transition: transform var(--transition-spring);
}

.detail-overlay.is-open .detail-panel__icon {
    animation: iconBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
}

@keyframes iconBounce {
    from { transform: scale(0.5) rotate(-10deg); opacity: 0; }
    to { transform: scale(1) rotate(0deg); opacity: 1; }
}

.detail-panel__title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.detail-panel__summary {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 8px;
    line-height: 1.5;
    max-width: 600px;
}

.detail-panel__body {
    display: flex;
    gap: 32px;
    padding: 0 32px 32px;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.detail-panel__content {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-secondary);
    opacity: 0;
    transform: translateX(-20px);
    transition: all var(--transition-smooth);
}

.detail-overlay.is-open .detail-panel__content {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.2s;
}

.detail-panel__content h3,
.detail-panel__content h4 {
    color: var(--text-primary);
    font-weight: 650;
    margin-bottom: 12px;
}

.detail-panel__content h3 {
    font-size: 1.15rem;
}

.detail-panel__content h4 {
    margin-top: 20px;
    font-size: 1rem;
}

.detail-panel__content ul {
    list-style: none;
    padding: 0;
}

.detail-panel__content ul li {
    position: relative;
    padding: 8px 0 8px 20px;
    border-bottom: 1px solid var(--border);
}

.detail-panel__content ul li:last-child {
    border-bottom: none;
}

.detail-panel__content ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.detail-panel__content p {
    margin-bottom: 12px;
}

.detail-panel__sidebar {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateX(20px);
    transition: all var(--transition-smooth);
}

.detail-overlay.is-open .detail-panel__sidebar {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.25s;
}

.sidebar__heading {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.sidebar__children {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex: 1;
}

.sidebar-child {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sidebar-child:hover {
    background: var(--bg-elevated);
    border-color: var(--border-active);
    transform: translateX(4px);
}

.sidebar-child__icon {
    font-size: 1.1rem;
}

.sidebar-child__text {
    flex: 1;
    min-width: 0;
}

.sidebar-child__meta {
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar-child__label {
    font-size: 0.9rem;
    font-weight: 650;
    line-height: 1.3;
}

.sidebar-child__summary {
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 0.74rem;
    line-height: 1.45;
}

.sidebar-child__arrow {
    color: var(--text-muted);
    flex-shrink: 0;
    margin-top: 4px;
}

.sidebar-child__arrow svg {
    width: 16px;
    height: 16px;
}

.detail-panel__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    border-top: 1px solid var(--border);
    background: rgba(10, 10, 15, 0.5);
    flex-shrink: 0;
}

.detail-panel__nav {
    display: flex;
    gap: 10px;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    outline: none;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn--primary {
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    color: white;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn--primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px var(--accent-glow);
}

.btn--outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn--outline:hover:not(:disabled) {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-active);
}

.btn--ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
}

.btn--ghost:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

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

/* ── Branch Preview ── */
.branch-preview {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 200px;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    z-index: 50;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all var(--transition-smooth);
    pointer-events: none;
}

.branch-preview.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.branch-preview__inner {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.branch-preview__item {
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all var(--transition-fast);
}

.branch-preview__item.is-active {
    color: var(--text-primary);
    background: var(--bg-card);
    font-weight: 500;
}

/* ── Loader ── */
.loader {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-deep);
    z-index: 1000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader__spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loader__text {
    margin-top: 16px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ── Content transition animation ── */
.detail-panel.is-switching .detail-panel__hero,
.detail-panel.is-switching .detail-panel__content,
.detail-panel.is-switching .detail-panel__sidebar {
    opacity: 0;
    transform: translateY(10px);
    transition-duration: 0.2s;
    transition-delay: 0s;
}

/* ── Connection line animations ── */
.connection-line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawLine 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes drawLine {
    to { stroke-dashoffset: 0; }
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .header {
        padding: 0 16px;
    }

    .header__subtitle {
        display: none;
    }

    .detail-panel__body {
        flex-direction: column;
    }

    .detail-panel__sidebar {
        width: 100%;
        max-height: 200px;
    }

    .detail-panel__hero {
        padding: 24px 20px 20px;
        gap: 16px;
    }

    .detail-panel__title {
        font-size: 1.5rem;
    }

    .detail-panel__icon {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
    }

    .detail-panel__header,
    .detail-panel__body,
    .detail-panel__footer {
        padding-left: 20px;
        padding-right: 20px;
    }

    .detail-panel__footer {
        flex-direction: column;
        gap: 12px;
    }

    .detail-panel__nav {
        width: 100%;
    }

    .detail-panel__nav .btn {
        flex: 1;
        justify-content: center;
    }

    .branch-preview {
        display: none;
    }
}

@media (max-width: 600px) {
    .header__title {
        font-size: 0.95rem;
    }

    .ctrl-btn {
        width: 36px;
        height: 36px;
    }

    .mind-node {
        padding: 10px 14px;
    }

    .mind-node__label {
        font-size: 0.8rem;
    }
}
/* ── Back to Website and Professional Live Search ── */
.header__tools {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.website-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 14px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 650;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.035);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.website-back-btn:hover,
.website-back-btn:focus-visible {
    color: var(--text-primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(139, 92, 246, 0.12));
    border-color: rgba(139, 92, 246, 0.38);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.14);
    outline: none;
}

.website-back-btn svg {
    width: 16px;
    height: 16px;
}

.search-shell {
    position: relative;
    width: min(420px, 34vw);
    z-index: 120;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.045);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.search-shell.is-focused .search-box,
.search-box:focus-within {
    border-color: rgba(99, 102, 241, 0.55);
    background: rgba(255, 255, 255, 0.065);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.search-box__icon {
    position: absolute;
    left: 13px;
    width: 17px;
    height: 17px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    height: 100%;
    padding: 0 42px 0 40px;
    color: var(--text-primary);
    background: transparent;
    border: 0;
    outline: 0;
    font-family: var(--font);
    font-size: 0.84rem;
}

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

.search-box__clear {
    position: absolute;
    right: 8px;
    width: 26px;
    height: 26px;
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.search-shell.has-query .search-box__clear {
    display: flex;
}

.search-box__clear:hover,
.search-box__clear:focus-visible {
    color: var(--text-primary);
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.28);
    outline: none;
}

.search-box__clear svg {
    width: 14px;
    height: 14px;
}

.search-results {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(520px, 90vw);
    max-height: min(520px, calc(100vh - 110px));
    overflow-y: auto;
    padding: 8px;
    background: rgba(18, 18, 26, 0.96);
    border: 1px solid var(--border-active);
    border-radius: 18px;
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.025);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.98);
    transform-origin: top right;
    transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
}

.search-shell.is-open .search-results {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.search-result {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 14px;
    color: inherit;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 14px;
    cursor: pointer;
    text-align: left;
    font-family: var(--font);
    transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.search-result:hover,
.search-result:focus-visible,
.search-result.is-active {
    background: rgba(255, 255, 255, 0.055);
    border-color: rgba(255, 255, 255, 0.09);
    transform: translateX(2px);
    outline: none;
}

.search-result__icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 11px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.2);
    font-size: 1rem;
}

.search-result__body {
    min-width: 0;
    flex: 1;
}

.search-result__label {
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.35;
}

.search-result__path {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result__summary {
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 0.76rem;
    line-height: 1.45;
}

.search-empty,
.search-hint {
    padding: 18px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.55;
}

.search-highlight .mind-node:not(.is-search-match) {
    opacity: 0.18;
    filter: grayscale(0.7);
}

.mind-node.is-search-match {
    border-color: rgba(99, 102, 241, 0.72);
    box-shadow: var(--shadow-md), 0 0 28px rgba(99, 102, 241, 0.22);
    z-index: 9;
}

.detail-footer__left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn--website {
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    text-decoration: none;
}

.btn--website:hover,
.btn--website:focus-visible {
    color: var(--text-primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(139, 92, 246, 0.12));
    border-color: rgba(139, 92, 246, 0.35);
    outline: none;
}

@media (max-width: 1100px) {
    .search-shell {
        width: min(360px, 32vw);
    }

    .website-back-btn span {
        display: none;
    }

    .website-back-btn {
        width: 40px;
        padding: 0;
        justify-content: center;
    }
}

@media (max-width: 760px) {
    .header {
        height: auto;
        min-height: var(--header-h);
        align-items: flex-start;
        gap: 12px;
        padding-top: 12px;
        padding-bottom: 12px;
        flex-wrap: wrap;
    }

    .header__brand {
        min-width: 0;
        flex: 1 1 auto;
    }

    .header__tools {
        width: 100%;
        justify-content: space-between;
        order: 2;
    }

    .search-shell {
        flex: 1;
        width: auto;
    }

    .search-results {
        left: 0;
        right: auto;
        width: 100%;
        max-height: min(420px, calc(100vh - 150px));
        transform-origin: top left;
    }

    .header__controls {
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .header__tools {
        gap: 8px;
    }

    .search-box input {
        font-size: 0.8rem;
    }

    .ctrl-btn,
    .website-back-btn {
        width: 36px;
        height: 36px;
    }

    .search-box {
        height: 36px;
    }
}
