body {
    margin: 0;
    background-color: var(--bg-deep);
    background-image: radial-gradient(var(--grid-line) 1px, transparent 1px);
    background-size: 20px 20px;
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
    height: 100vh;
    overflow: hidden;
    display: block;
    cursor: grab;
    box-sizing: border-box; /* Maintain size calculations with padding */
}

#app-main {
    position: relative;
    width: 100%;
    height: 100%; /* Fills the remaining height after body padding */
    overflow: visible; /* Allow content to be seen behind header */
}

/* Ensure flow content like server_add handles the container properly */
#app-main > div:not(.launcher-overlay):not(.bento-wrapper) {
    height: 100%;
    overflow-y: auto; /* Allow internal scrolling if content overflows */
}

/* Exception for Board which is absolute */
#app-main > .bento-wrapper {
    overflow: visible;
    height: auto;
}

body:active {
    cursor: grabbing;
}

.bento-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    transform-origin: 0 0;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.card {
    position: absolute;
    background: linear-gradient(135deg,
            var(--card-base) 0%,
            rgba(30, 30, 32, 0.1) 100%);
    backdrop-filter: blur(3px) saturate(150%) brightness(1.1);
    -webkit-backdrop-filter: blur(1px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 8px 32px 0 rgba(0, 0, 0, 0.3),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: grab;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10;
    user-select: none;
    -webkit-user-select: none;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: -1;
    opacity: 0.5;
}

.card:hover {
    background: var(--card-hover);
    box-shadow:
        0 24px 48px -12px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.15);
    z-index: 20;
}

.card.wizard-active:hover {
    transform: none;
    background: linear-gradient(135deg,
            var(--card-base) 0%,
            rgba(30, 30, 32, 0.1) 100%);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow:
        0 4px 24px -1px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 0 var(--shine);
    cursor: default;
    z-index: 10;
}

.card:active {
    cursor: grabbing;
    transform: scale(0.98);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.card.connected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-dim), 0 20px 50px rgba(0, 0, 0, 0.4);
}

.card.connected::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-dim);
    pointer-events: none;
}

/* ERROR STATE CRAD */
.card-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(30, 30, 32, 0.4) 100%) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    box-shadow: 0 8px 32px 0 rgba(239, 68, 68, 0.1), inset 0 0 0 1px rgba(239, 68, 68, 0.1) !important;
}

.card-error:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(30, 30, 32, 0.5) 100%) !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
}

.card-ghost {
    position: absolute;
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-mute);
    z-index: 5;
    cursor: pointer;
    transition: background 0.3s, border-color 0.3s;
}

.card-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
    color: var(--text-main);
}

.card-ghost h2 {
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.7;
}

.card-inner {
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.status-indicator {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    z-index: 5;
}

.status-indicator.pulse {
    animation: statusPulse 2s infinite;
}

.status-green {
    background: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    --pulse-color: rgba(16, 185, 129, 0.7);
}

.status-red {
    background: #ef4444;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    --pulse-color: rgba(239, 68, 68, 0.7);
}

.status-yellow {
    background: #f59e0b;
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    --pulse-color: rgba(245, 158, 11, 0.7);
}

.status-blue {
    background: #60a5fa;
    box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.7);
    --pulse-color: rgba(96, 165, 250, 0.7);
}

@keyframes statusPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 var(--pulse-color); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(0,0,0,0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0,0,0,0); }
}

.icon-box {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 12px;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
}

.card-header .icon-box {
    margin-bottom: 0;
}

.card-header .meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-body {
    width: 100%;
    margin-top: auto; /* Push to bottom */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 48px; /* Reserve space */
}

/* SMART HIGHLIGHT CONTAINERS */
.smart-highlight {
    padding: 0;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* VARIANTS */

/* 1. ALERT (Error) */
.highlight-alert {
    color: #ef4444; 
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.alert-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    opacity: 0.9;
}

.alert-log {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.75rem;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* 2. LOAD (High CPU/RAM) */
.highlight-load {
    color: var(--text-main);
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.load-meter {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
}

.load-exclude {
    height: 100%;
    background: #f59e0b;
    border-radius: 2px;
}


/* 3. TRAFFIC (Network) */
.highlight-traffic {
    color: var(--text-main);
    justify-content: space-between;
}

/* 4. IDLE (Healthy) */
.highlight-idle {
    color: var(--text-mute);
    justify-content: flex-start; /* Align left */
    opacity: 0.7;
}

.highlight-idle .status-dot-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse-green 2s infinite;
    margin-right: 4px;
}

@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Graph Bars for Traffic */
.mini-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 16px;
}
.mini-bar {
    width: 3px;
    background: #60a5fa;
    border-radius: 1px;
}

/* Full Width CPU Graph (Equalizer Style) */
.cpu-graph {
    width: 100%;
    height: 24px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between; /* Spread evenly */
    gap: 2px;
    opacity: 0.8;
}

.cpu-bar {
    flex: 1; /* Auto width */
    background: rgba(239, 68, 68, 0.4); /* Dim red */
    border-radius: 1px;
    min-height: 2px;
    transition: height 0.3s;
}

.cpu-bar.active {
    background: #ef4444; /* Bright red */
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
}

/* Full Width Network Graph (Blue) */
.net-graph {
    width: 100%;
    height: 24px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2px;
    opacity: 0.9;
}

.net-bar {
    flex: 1;
    background: rgba(96, 165, 250, 0.4); /* Blue-400 equivalent transparent */
    border-radius: 1px;
    min-height: 2px;
    transition: height 0.3s;
}

.net-bar.active {
    background: #60a5fa; /* Blue-400 */
    box-shadow: 0 0 6px rgba(96, 165, 250, 0.5);
}

.meta h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.meta p {
    margin: 4px 0 0;
    font-size: 0.75rem;
    color: var(--text-mute);
}

.size-1x1 {
    width: var(--cell);
    height: var(--cell);
}

.size-1x1 .meta h3 {
    font-size: 0.85rem;
}

.size-2x1 {
    width: calc(2 * var(--cell) + var(--gap));
    height: var(--cell);
}

.size-2x1 .card-inner {
    flex-direction: row;
    align-items: center;
    gap: 16px;
}

.size-2x1 .icon-box {
    margin-bottom: 0;
}

.size-2x2 {
    width: calc(2 * var(--cell) + var(--gap));
    height: calc(2 * var(--cell) + var(--gap));
}

.size-2x2 .icon-box {
    width: 64px;
    height: 64px;
    font-size: 2rem;
    margin-bottom: auto;
}

.size-1x2 {
    width: var(--cell);
    height: calc(2 * var(--cell) + var(--gap));
}

.size-4x3 {
    width: calc(4 * var(--cell) + 3 * var(--gap));
    height: calc(3 * var(--cell) + 2 * var(--gap));
}

.graph-mini {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 30px;
    width: 100%;
    opacity: 0.5;
}

.bar {
    background: var(--text-main);
    width: 100%;
    border-radius: 2px;
}

.status-pill {
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(45, 212, 191, 0.1);
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
}

.wizard-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    box-sizing: border-box;
}

.wizard-title {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    font-weight: 600;
    text-align: center;
}

.os-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 600px;
}

.os-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
}

.os-btn:hover {
    background: var(--card-hover);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.os-btn i {
    font-size: 2rem;
}

.cmd-box {
    background: #000;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    color: var(--accent);
    width: 100%;
    max-width: 600px;
    position: relative;
    cursor: pointer;
    
    /* Force single line & scroll */
    white-space: nowrap;
    overflow-x: auto;
    display: flex;
    align-items: center;
}

.cmd-box:hover {
    border-color: var(--accent-glow);
}

.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    cursor: pointer;
    color: var(--text-mute);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
    z-index: 10;
}

.back-btn:hover {
    color: var(--text-main);
}

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

/* LOGIN CSS EXTRACTED */
.login-wrapper {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

/* Floating Action Button */
.floating-fab {
    /* Positioning & Sizing handled by Tailwind/Parent */
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 1000;
    color: var(--text-main);
    overflow: hidden; /* For smooth width transition */
}

/* Offline State */
.floating-fab.fab-offline {
    width: fit-content; /* Only take necessary space */
    border-radius: 34px; /* More rounded for pill shape */
    padding: 0 20px; /* Add padding for text */
    background: rgba(100, 100, 100, 0.1); 
    border-color: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.4); 
    cursor: not-allowed;
    /* pointer-events: none; REMOVED to allow simple hover interaction if needed, or keep? User didn't ask, but let's keep pointer-events: none for offline */
    pointer-events: none;
    /* right: 30px; REMOVED */
    /* justify-content: flex-start; REMOVED */
}

.floating-fab.fab-offline:hover {
    transform: none;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    background: rgba(100, 100, 100, 0.1);
}

.floating-fab:hover {
    transform: translateY(-2px) scale(1.05); 
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3); 
    background: rgba(255, 255, 255, 0.15); 
    border-color: rgba(255, 255, 255, 0.2);
}

.floating-fab i {
    width: 24px; /* Slightly smaller icon to balance text */
    height: 24px;
    stroke-width: 2;
    flex-shrink: 0; /* Prevent icon shrinking */
}

.login-card {
    position: relative !important; /* Override .card absolute */
    width: 100%;
    max-width: 380px;
    padding: 40px;
    align-items: center;
    gap: 32px;
    background: rgba(20, 20, 23, 0.7); /* Slightly more opaque */
    border: 1px solid rgba(255, 255, 255, 0.04); /* Subtler border */
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.login-card:hover {
    transform: none;
    background: rgba(20, 20, 23, 0.7);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.04);
    cursor: default;
}

.logo-area {
    position: relative;
}

.logo-icon {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon img {
    height: 100%;
    width: auto;
}

.login-header {
    text-align: center;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.login-header p {
    font-size: 0.9rem;
    color: #94A3B8; /* Slate-400 equivalent */
    margin: 0;
    line-height: 1.5;
}

.login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-group {
    position: relative;
    width: 100%;
}

.input-group svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-mute);
    height: 1.2rem;
    width: 1.2rem;
    transition: color 0.2s;
}

.input-group:focus-within svg {
    color: var(--text-main);
}

.input-group input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 999px;
    padding: 16px 16px 16px 48px;
    color: var(--text-main);
    font-size: 0.95rem;
    font-family: var(--font-main);
    outline: none;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-sizing: border-box;
}

.input-group input:focus {
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: none;
}

.input-group input::placeholder {
    color: var(--text-mute);
    opacity: 0.7;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(to bottom, #FFFFFF, #E5E5E5);
    color: var(--bg-deep);
    border: none;
    border-radius: 999px;
    padding: 16px;
    font-size: 0.95rem;
    font-family: var(--font-main);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

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

.login-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}

.legal-links {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
}

.legal-links a {
    color: var(--text-mute);
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.2s, color 0.2s;
}

.legal-links a:hover {
    opacity: 1;
    color: var(--text-main);
}

.legal-links .dot {
    color: var(--border);
}

.login-footer p {
    color: var(--text-mute);
    font-size: 0.7rem;
    opacity: 0.4;
    margin: 0;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.login-footer p::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M20.92,10.64l-8-5.33a1.53,1.53,0,0,0-1.84,0l-8,5.33A1.51,1.51,0,0,0,2.5,12V18A3.5,3.5,0,0,0,6,21.5H18A3.5,3.5,0,0,0,21.5,18V12A1.51,1.51,0,0,0,20.92,10.64ZM12,18a2,2,0,1,1,2-2A2,2,0,0,1,12,18Z'/%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    opacity: 0.7;
}

.form-success-message {
    display: none !important;
    background: var(--status-success-bg);
    border: 1px solid var(--status-success-border);
    color: var(--status-success);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    text-align: center;
    align-items: center;
    justify-content: center;
    gap: 8px;
    backdrop-filter: blur(4px);
    overflow: hidden;
    animation: slideDown 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.form-success-message:not(:empty) {
    display: flex !important;
}

.form-success-message i {
    font-size: 1.1rem;
}

@keyframes slideDown {
    0% {
        opacity: 0;
        transform: translateY(-8px);
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        border-width: 0;
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        max-height: 100px;
        padding-top: 12px;
        padding-bottom: 12px;
        border-width: 1px;
    }
}

/* ERROR MESSAGE STYLING */
[odac-form-error] {
    display: none !important;
    background: var(--status-error-bg);
    border: 1px solid var(--status-error-border);
    color: var(--status-error);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    text-align: center;
    align-items: center;
    justify-content: center;
    gap: 8px;
    backdrop-filter: blur(4px);
    overflow: hidden;
    margin-top: 12px;
    animation: slideDown 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

[odac-form-error]:not(:empty) {
    display: flex !important;
}

/* 
   TOAST NOTIFICATIONS 
   Glassmorphism Style - Top Center Pill
*/
#toast-container {
    position: fixed;
    top: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    pointer-events: none;
    width: auto;
}

.toast {
    pointer-events: auto;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 
        0 8px 32px 0 rgba(0, 0, 0, 0.2),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    padding: 10px 24px;
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    
    /* Entry State */
    opacity: 0;
    transform: translateY(-20px);
    
    /* Layout Transition Properties */
    max-height: 100px; /* Arbitrary limit for animation */
    margin-bottom: 12px;
    overflow: hidden; /* Needed for height animation */
    
    transition: 
        transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), 
        opacity 0.4s ease,
        max-height 0.4s ease,
        padding 0.4s ease,
        margin 0.4s ease,
        border 0.4s ease;
}

.toast.show {
    /* Active State */
    transform: translateY(0);
    opacity: 1;
}

.toast.closing {
    /* Exit State: Fade out AND collapse layout */
    transform: translateY(0);
    opacity: 0;
    
    /* Collapse layout to prevent jumping */
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    border: 0;
    pointer-events: none;
}

/* Toast Variants */
/* Info (Default) - Grayish */
.toast-info {
    background: rgba(30, 30, 35, 0.7);
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.1);
}

/* Success - Green Tint */
.toast-success {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.3);
    color: #d1fae5;
    box-shadow: 0 8px 32px 0 rgba(16, 185, 129, 0.1), inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
}

/* Error - Red Tint */
.toast-error {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fee2e2;
    box-shadow: 0 8px 32px 0 rgba(239, 68, 68, 0.1), inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
}

@media (max-width: 768px) {
    /* Main Layout */
    .card.login-card {
        padding: 24px 16px !important;
        min-height: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: 16px !important;
        box-sizing: border-box !important;
    }
    
    /* Wrapper */
    div[style*="padding: 20px"] {
        padding: 10px !important;
    }

    /* Container adjustments */
    .wizard-container {
        padding: 10px 0 !important;
    }
    
    .wizard-title {
        font-size: 1.4rem !important;
        margin-bottom: 1rem !important;
    }
    
    .wizard-container p {
        font-size: 0.95rem !important;
        margin-bottom: 1.5rem !important;
        padding: 0 10px;
    }

    /* Grid to List */
    .os-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        max-width: 100%;
    }

    /* OS Buttons: Horizontal List Style */
    .os-btn {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        padding: 16px;
        gap: 16px;
    }

    .os-btn i, .os-btn svg {
        width: 24px !important;
        height: 24px !important;
    }

    .os-btn span {
        margin-top: 0 !important;
        font-size: 1rem;
        font-weight: 500;
    }

    /* Command Box */
    .cmd-box {
        padding: 16px !important;
        font-size: 0.8rem !important;
        flex-direction: row !important; /* Keep row */
        align-items: center !important;
        gap: 12px;
    }

    .cmd-box span {
        word-break: break-all;
        text-align: left;
        line-height: 1.4;
    }
    
    .cmd-box i {
        min-width: 20px; /* Prevent icon shrinking */
    }
    
    /* Timer Area */
    div[style*="max-width: 650px"] {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 8px !important;
    }

    /* Header & Back Button */
    .logo-area {
        margin-top: 40px;
        margin-bottom: 10px;
        transform: scale(0.9);
    }
    
    .back-btn {
        top: 16px !important;
        left: 16px !important;
    }
    
    /* Toast Mobile Tweaks - Just ensure it stays centered */
    #toast-container {
        top: 20px;
        max-width: 90%;
    }
    .toast {
        white-space: normal;
        padding: 10px 16px;
    }
}

/* 
   RAYCAST SEARCH BAR STYLES 
   Glassmorphism Overlay & Modal
*/

/* 
   LAUNCHER SEARCH BAR STYLES 
   Glassmorphism Overlay & Modal (HUD / Command Center Style)
*/

.launcher-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25); /* Lighter backdrop (was 0.6) */
    backdrop-filter: blur(4px); /* Blur the underlying canvas */
    z-index: 1000;
    cursor: default;
    display: flex;
    justify-content: center;
    align-items: center; /* Center vertically too */
    padding-bottom: 10vh; /* Slight optical offset upwards */
    
    /* Animation Entry */
    opacity: 0; 
    pointer-events: none;
    transition: opacity 0.2s ease-out;
}

.launcher-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.launcher-modal {
    width: 90%;
    max-width: 900px;
    /* Wrapper acts as layout container only, no bg/border */
    background: transparent;
    border: none;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    /* Remove overflow hidden so children borders don't get cut weirdly if separated */
    overflow: visible; 
}

/* Header & Input (Floating Pill) */
.launcher-header {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    background: rgba(23, 23, 26, 0.6); /* Slightly more opaque for input clarity */
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    box-shadow: 
        0 8px 32px rgba(0,0,0,0.2),
        inset 0 1px 0 rgba(255,255,255,0.05);
    gap: 16px;
    position: relative;
    z-index: 20; /* Higher than results panel (9) */

    margin-bottom: 16px; /* THE GAP */
}

/* Results Panel (Body + Footer) */
.launcher-results-panel {
    display: flex;
    flex-direction: column;
    height: 500px; /* Fixed height for results area */
    background: rgba(23, 23, 26, 0.4);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 
        0 40px 80px -20px rgba(0, 0, 0, 0.5), 
        inset 0 1px 0 0 rgba(255, 255, 255, 0.1),
        0 0 0 1px rgba(0, 0, 0, 0.2);
    border-radius: 35px;
    overflow: hidden;
    position: relative;
    z-index: 9;
}

/* Glowing Border Effect for Results Panel Only */
.launcher-results-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 35px;
    padding: 1px;
    background: linear-gradient(180deg, rgba(255,255,255,0.15), transparent 60%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.launcher-header .search-icon {
    color: var(--accent); /* Brand color search icon */
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.launcher-header input {
    flex: 1;
    background: transparent;
    border: none;
    font-size: 1.25rem; /* Large, confident text */
    color: var(--text-main);
    outline: none;
    font-family: var(--font-main);
    font-weight: 500;
}

.launcher-header input::placeholder {
    color: var(--text-mute);
    opacity: 0.5;
    font-weight: 400;
}

/* Horizontal Tabs (Top of Results) */
.launcher-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 24px 8px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    overflow-x: auto;
    /* Hide scrollbar but keep functionality */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.launcher-tabs::-webkit-scrollbar {
    display: none;
}

.tab-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px; /* Pill shape */
    cursor: pointer;
    color: var(--text-mute);
    transition: all 0.2s ease;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid transparent;
}

.tab-item i, .tab-item svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.tab-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.tab-item.active {
    background: rgba(255, 255, 255, 0.08); /* More subtle active state for tabs */
    color: var(--accent);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tab-item.active i, .tab-item.active svg {
    opacity: 1;
}

/* Grid Content (Full Width) */
.launcher-grid-content {
    flex: 1;
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Slightly wider cards */
    grid-auto-rows: max-content;
    gap: 16px;
    overflow-y: auto;
    align-content: start;
}

/* APP CARD STYLES */
.app-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

/* Selection State (Keyboard Nav) */
.app-card.active, .app-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

/* Active Indicator Border */
.app-card.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    box-shadow: 2px 0 12px var(--accent-glow);
}

.app-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.5rem;
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
}

.app-icon img, .app-icon svg {
    pointer-events: none;
    -webkit-user-drag: none;
}

/* Specific Icon Brands (Mock Colors) */
.n8n-icon { background: linear-gradient(135deg, #ff6b6b, #ea4c4c); }
.pg-icon { background: linear-gradient(135deg, #336791, #2f5676); }
.ai-icon { background: linear-gradient(135deg, #a855f7, #9333ea); }
.next-icon { background: linear-gradient(135deg, #111, #333); }
.redis-icon { background: linear-gradient(135deg, #dc382d, #b92b22); }
.docker-icon { background: linear-gradient(135deg, #0db7ed, #0081d6); }

.app-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0; /* Text truncation magic */
}

.app-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-desc {
    font-size: 0.8rem;
    color: var(--text-mute);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-tags {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

.tag {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-mute);
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-weight: 500;
}



/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px) scale(0.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .launcher-overlay {
        padding-top: 16px;
        align-items: flex-start; /* Push to top */
        background: rgba(0, 0, 0, 0.4); /* Slightly darker for better contrast outdoors */
    }

    .launcher-modal {
        width: 100%;
        padding: 0 12px;
    }

    .launcher-header {
        padding: 12px 16px;
        margin-bottom: 12px;
    }

    .launcher-header input {
        font-size: 1rem;
    }
    
    .launcher-header .search-icon {
        width: 20px;
        height: 20px;
    }

    .launcher-results-panel {
        height: calc(100vh - 160px); /* Fill available space */
        border-radius: 24px;
    }

    .launcher-tabs {
        padding: 12px 16px 8px 16px;
    }
    
    .tab-item {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .launcher-grid-content {
        grid-template-columns: 1fr; /* Force single column */
        padding: 16px;
        gap: 12px;
    }


}



/* Hide FAB when launcher is open (optional but cleaner) */
body:has(.launcher-overlay.show) .floating-fab {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

.icon-box-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 16px;
    color: var(--text-mute);
}
.icon-box-ghost svg {
    width: 24px;
    height: 24px;
}



/* Card Entrance Animation */
.card-hidden {
    opacity: 0 !important;
    transform: translateY(-40px) scale(1.15) !important;
    box-shadow: 0 50px 70px -10px rgba(0,0,0,0.6) !important; /* Yoğun derinlik gölgesi */
    pointer-events: none;
}
/* Transition normal .card sınıfında zaten var (0.4s), bu yüzden sınıfı kaldırdığımızda o devreye girer */

/* HEADER LAYOUT STRUCTURE */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 72px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    
    /* Base styling for the container itself */
    background: rgba(20, 20, 23, 0.3); /* More transparent */
    backdrop-filter: blur(3px) saturate(180%);
    -webkit-backdrop-filter: blur(3px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03); /* Subtle border */
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
    
    /* Prevent selection during drag operations */
    user-select: none;
    -webkit-user-select: none;
    cursor: default;
}

/* Adjust layout to push content down below fixed header */
body {
    padding-top: 0; 
    box-sizing: border-box;
}

/* User Dropdown */
.user-avatar-trigger {
    user-select: none;
    -webkit-user-select: none;
}

.user-avatar-trigger img {
    pointer-events: none;
    -webkit-user-drag: none;
}

.app-logo {
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
    -webkit-user-drag: none;
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 12px;
    width: 180px;
    background: rgba(23, 23, 26, 0.8);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.dropdown-item.text-danger {
    color: #ef4444;
}

.dropdown-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.dropdown-item i, .dropdown-item svg {
    width: 16px;
    height: 16px;
}



/* Simple Spinner for Loading State */
.loader-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
/* Launcher Empty State */
.launcher-empty {
    grid-column: 1 / -1; /* Span across all columns */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-mute);
    animation: fadeIn 0.3s ease;
}

.launcher-empty span {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-main);
}

.launcher-empty small {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Launcher Skeleton Loading */
.skeleton-card {
    pointer-events: none;
    border-color: rgba(255, 255, 255, 0.05);
}

.skeleton-box {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    animation: pulse 1.5s infinite;
}

.skeleton-text {
    height: 12px;
    width: 80%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    margin-bottom: 8px;
    animation: pulse 1.5s infinite;
}

.skeleton-text:last-child {
    width: 50%;
}

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

/* FADE OUT/IN effect for seamless search */
.launcher-grid-content {
    transition: opacity 0.2s ease;
}
.launcher-grid-content.reloading {
    opacity: 0.5;
    pointer-events: none; /* Prevent clicks while loading new data */
}

/* Launcher Dropdown Menu */
.launcher-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(20, 20, 23, 0.4); /* More transparent for blur visibility */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px; /* Full curved */
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    min-width: 200px;
    z-index: 99999; /* Ensure on top */
    overflow: hidden;
    display: none;
    animation: fadeIn 0.15s cubic-bezier(0.2, 0.8, 0.2, 1);
    padding: 6px; /* Inner padding for floating items look */
}

.launcher-dropdown-menu.show {
    display: block;
}

.launcher-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px; /* Comfortable hit area */
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    border-radius: 14px; /* Inner radius matching outer */
    width: 100%; /* Ensure full width click */
    box-sizing: border-box;
}

.launcher-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateX(2px); /* Subtle feedback */
}

.launcher-menu-item i {
    opacity: 0.7;
    transition: opacity 0.2s;
}

.launcher-menu-item:hover i {
    opacity: 1;
}

/* Trash FAB State */
.floating-fab.fab-trash {
    background: rgba(239, 68, 68, 0.15) !important; /* Light red tint, override default */
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #ef4444 !important;
    backdrop-filter: blur(12px);
}

.floating-fab.fab-trash-active {
    background: rgba(239, 68, 68, 0.25) !important;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4) !important;
    transform: translateX(-50%) scale(1.1) !important;
    transform-origin: center center !important;
}

.floating-fab.fab-trash i {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.floating-fab.fab-trash-active i {
    transform: scale(1.2);
}
