/* ═══════════════════════════════════════════════════════════ */
/*  TraceGeo — Advanced UI Component Library                    */
/*  v1.0 · Command Palette · Tooltips · Skeletons · Timeline  */
/* ═══════════════════════════════════════════════════════════ */

/* ── 1. COMMAND PALETTE (Cmd+K / Ctrl+K) ───────────────── */
.cmd-palette-overlay {
    position: fixed; inset: 0; z-index: 9000;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex; align-items: flex-start; justify-content: center;
    padding-top: min(20vh, 160px);
    opacity: 0; visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.cmd-palette-overlay.active {
    opacity: 1; visibility: visible;
}
.cmd-palette {
    width: 100%; max-width: 580px;
    background: rgba(13, 13, 13,0.96);
    backdrop-filter: blur(40px) saturate(1.6);
    -webkit-backdrop-filter: blur(40px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255,0.15);
    border-radius: 20px;
    box-shadow: 0 40px 100px rgba(0,0,0,0.6), 0 0 80px rgba(255, 255, 255,0.08), inset 0 1px 0 rgba(255,255,255,0.04);
    overflow: hidden;
    transform: scale(0.92) translateY(-12px);
    transition: transform 0.25s var(--ease-spring, cubic-bezier(0.16,1,0.3,1));
}
.cmd-palette-overlay.active .cmd-palette {
    transform: scale(1) translateY(0);
}
.cmd-palette-input-wrap {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.cmd-palette-input-wrap i {
    color: var(--text-muted, #555555); font-size: 16px; flex-shrink: 0;
}
.cmd-palette-input {
    flex: 1; background: none; border: none; outline: none;
    color: var(--text-primary, #f0f0f0); font-size: 16px;
    font-family: var(--font-sans, 'DM Sans', sans-serif);
    caret-color: #ffffff;
}
.cmd-palette-input::placeholder { color: var(--text-muted, #555555); }
.cmd-palette-kbd {
    font-size: 10px; font-family: var(--font-mono, monospace);
    padding: 3px 8px; border-radius: 6px;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-muted, #555555); font-weight: 600; white-space: nowrap;
}
.cmd-palette-results {
    max-height: 360px; overflow-y: auto; padding: 8px;
    scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255,0.2) transparent;
}
.cmd-palette-results::-webkit-scrollbar { width: 4px; }
.cmd-palette-results::-webkit-scrollbar-thumb { background: rgba(255, 255, 255,0.2); border-radius: 2px; }
.cmd-palette-group-label {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1px; color: var(--text-muted, #555555);
    padding: 12px 12px 6px; user-select: none;
}
.cmd-palette-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: 12px;
    cursor: pointer; transition: all 0.15s ease;
    color: var(--text-secondary, #999999);
    position: relative;
}
.cmd-palette-item:hover, .cmd-palette-item.focused {
    background: rgba(255, 255, 255,0.08);
    color: var(--text-primary, #f0f0f0);
}
.cmd-palette-item.focused::before {
    content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 20px; border-radius: 0 3px 3px 0;
    background: #ffffff;
}
.cmd-palette-item-icon {
    width: 34px; height: 34px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; flex-shrink: 0;
    background: rgba(255, 255, 255,0.08); color: #cccccc;
}
.cmd-palette-item-text { flex: 1; }
.cmd-palette-item-title { font-size: 14px; font-weight: 500; }
.cmd-palette-item-desc { font-size: 11px; color: var(--text-muted, #555555); margin-top: 1px; }
.cmd-palette-item-shortcut { display: flex; gap: 4px; }
.cmd-palette-footer {
    padding: 10px 16px;
    border-top: 1px solid rgba(255,255,255,0.04);
    display: flex; align-items: center; gap: 16px;
    font-size: 11px; color: var(--text-muted, #555555);
}
.cmd-palette-footer kbd {
    font-family: var(--font-mono, monospace); font-size: 10px;
    padding: 2px 6px; border-radius: 4px;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
    margin: 0 2px;
}
.cmd-palette-empty {
    padding: 40px 20px; text-align: center;
    color: var(--text-muted, #555555); font-size: 14px;
}
.cmd-palette-empty i { font-size: 28px; margin-bottom: 10px; display: block; opacity: 0.3; }

/* ── 2. KEYBOARD SHORTCUTS OVERLAY ────────────────────── */
.shortcuts-overlay {
    position: fixed; inset: 0; z-index: 9001;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(16px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    transition: all 0.2s ease;
}
.shortcuts-overlay.active { opacity: 1; visibility: visible; }
.shortcuts-panel {
    background: rgba(13, 13, 13,0.96); backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255,0.12);
    border-radius: 20px; padding: 32px;
    max-width: 600px; width: 90%;
    box-shadow: 0 30px 80px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: transform 0.25s var(--ease-spring, cubic-bezier(0.16,1,0.3,1));
}
.shortcuts-overlay.active .shortcuts-panel { transform: scale(1); }
.shortcuts-title {
    font-size: 18px; font-weight: 700; color: var(--text-primary, #f0f0f0);
    margin-bottom: 24px; display: flex; align-items: center; gap: 10px;
}
.shortcuts-title i { color: #ffffff; }
.shortcuts-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px 32px;
}
.shortcut-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 0;
}
.shortcut-label { font-size: 13px; color: var(--text-secondary, #999999); }
.shortcut-keys { display: flex; gap: 4px; }
.shortcut-key {
    font-family: var(--font-mono, monospace); font-size: 11px; font-weight: 600;
    padding: 4px 10px; border-radius: 8px;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-primary, #f0f0f0); min-width: 28px; text-align: center;
    box-shadow: 0 2px 0 rgba(0,0,0,0.3);
}
.shortcuts-close {
    position: absolute; top: 16px; right: 16px;
    background: none; border: none; color: var(--text-muted, #555555);
    cursor: pointer; font-size: 16px; padding: 8px;
    border-radius: 8px; transition: all 0.2s;
}
.shortcuts-close:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }

/* ── 3. ENHANCED TOAST NOTIFICATIONS ──────────────────── */
.toast-container {
    position: fixed; bottom: 24px; right: 24px; z-index: 8000;
    display: flex; flex-direction: column-reverse; gap: 10px;
    pointer-events: none; max-width: 380px;
}
.toast-item {
    pointer-events: auto;
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px 18px; border-radius: 14px;
    background: rgba(13, 13, 13,0.95); backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 0 1px rgba(0,0,0,0.1);
    transform: translateX(120%);
    animation: toast-slide-in 0.4s var(--ease-spring, cubic-bezier(0.16,1,0.3,1)) forwards;
    position: relative; overflow: hidden;
}
.toast-item.removing {
    animation: toast-slide-out 0.3s ease forwards;
}
@keyframes toast-slide-in {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes toast-slide-out {
    to { transform: translateX(120%); opacity: 0; }
}
.toast-icon {
    width: 32px; height: 32px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; flex-shrink: 0;
}
.toast-success .toast-icon { background: rgba(200, 200, 200,0.12); color: #cccccc; }
.toast-error .toast-icon { background: rgba(180, 180, 180,0.12); color: #777777; }
.toast-warning .toast-icon { background: rgba(200, 200, 200,0.12); color: #aaaaaa; }
.toast-info .toast-icon { background: rgba(255, 255, 255,0.12); color: #cccccc; }
.toast-content { flex: 1; min-width: 0; }
.toast-title { font-size: 13px; font-weight: 600; color: var(--text-primary, #f0f0f0); }
.toast-message { font-size: 12px; color: var(--text-muted, #555555); margin-top: 2px; line-height: 1.4; }
.toast-close {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: 4px; font-size: 12px; opacity: 0.5;
    transition: opacity 0.2s;
}
.toast-close:hover { opacity: 1; }
.toast-progress {
    position: absolute; bottom: 0; left: 0; height: 2px;
    background: currentColor; opacity: 0.3; border-radius: 0 0 14px 14px;
    animation: toast-progress linear forwards;
}
@keyframes toast-progress { from { width: 100%; } to { width: 0%; } }

/* ── 4. TOOLTIP SYSTEM ────────────────────────────────── */
[data-tooltip] {
    position: relative; cursor: help;
}
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute; bottom: calc(100% + 8px); left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 6px 12px; border-radius: 8px;
    background: rgba(13, 13, 13,0.95); border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-primary, #f0f0f0); font-size: 12px; font-weight: 500;
    white-space: nowrap; pointer-events: none;
    opacity: 0; visibility: hidden;
    transition: all 0.2s ease;
    z-index: 7000;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
[data-tooltip]:hover::after {
    opacity: 1; visibility: visible;
    transform: translateX(-50%) translateY(0);
}
[data-tooltip-pos="bottom"]::after {
    bottom: auto; top: calc(100% + 8px);
    transform: translateX(-50%) translateY(-4px);
}
[data-tooltip-pos="bottom"]:hover::after {
    transform: translateX(-50%) translateY(0);
}

/* ── 5. SKELETON LOADING ──────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg,
        rgba(255,255,255,0.03) 25%,
        rgba(255,255,255,0.06) 50%,
        rgba(255,255,255,0.03) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.8s ease infinite;
    border-radius: 8px;
}
@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-text { height: 14px; margin-bottom: 8px; border-radius: 6px; }
.skeleton-text-sm { height: 10px; width: 60%; margin-bottom: 6px; }
.skeleton-avatar { width: 48px; height: 48px; border-radius: 12px; }
.skeleton-card {
    padding: 20px; border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.04);
}
.skeleton-image { width: 100%; height: 160px; border-radius: 12px; }
.skeleton-btn { width: 100px; height: 36px; border-radius: 10px; }

/* ── 6. BREADCRUMBS ───────────────────────────────────── */
.breadcrumbs {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; color: var(--text-muted, #555555);
    margin-bottom: 20px; flex-wrap: wrap;
}
.breadcrumb-item {
    display: flex; align-items: center; gap: 8px;
    text-decoration: none; color: var(--text-muted, #555555);
    transition: color 0.2s;
}
.breadcrumb-item:hover { color: #cccccc; }
.breadcrumb-item.active { color: var(--text-primary, #f0f0f0); font-weight: 500; }
.breadcrumb-sep { color: rgba(255,255,255,0.15); font-size: 10px; }
.breadcrumb-item i { font-size: 11px; }

/* ── 7. ACTIVITY TIMELINE ─────────────────────────────── */
.timeline {
    position: relative; padding-left: 28px;
}
.timeline::before {
    content: ''; position: absolute; left: 11px; top: 0; bottom: 0;
    width: 2px; background: linear-gradient(to bottom, rgba(255, 255, 255,0.3), rgba(255, 255, 255,0.05));
    border-radius: 2px;
}
.timeline-item {
    position: relative; padding-bottom: 24px;
    animation: timeline-fade-in 0.4s ease both;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
    position: absolute; left: -22px; top: 4px;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--dark-surface, #080808);
    border: 2px solid #ffffff;
    z-index: 1;
}
.timeline-dot.dot-success { border-color: #cccccc; }
.timeline-dot.dot-warning { border-color: #aaaaaa; }
.timeline-dot.dot-info { border-color: #ffffff; }
.timeline-dot.dot-error { border-color: #777777; }
.timeline-card {
    background: rgba(10, 10, 10,0.55); backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 14px; padding: 14px 18px;
    transition: all 0.2s;
}
.timeline-card:hover {
    border-color: rgba(255, 255, 255,0.15);
}
.timeline-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.timeline-title { font-size: 13px; font-weight: 600; color: var(--text-primary, #f0f0f0); }
.timeline-time { font-size: 11px; color: var(--text-muted, #555555); font-family: var(--font-mono, monospace); }
.timeline-body { font-size: 12px; color: var(--text-secondary, #999999); line-height: 1.5; }
@keyframes timeline-fade-in {
    from { opacity: 0; transform: translateX(-8px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ── 8. SPARKLINE MINI CHARTS ─────────────────────────── */
.sparkline-wrap {
    display: inline-flex; align-items: flex-end; gap: 2px;
    height: 28px; vertical-align: middle;
}
.sparkline-bar {
    width: 4px; border-radius: 2px;
    background: rgba(255, 255, 255,0.4);
    transition: height 0.4s var(--ease-spring, cubic-bezier(0.16,1,0.3,1));
}
.sparkline-bar:last-child { background: #ffffff; }

/* ── 9. ENHANCED CARD INTERACTIONS ────────────────────── */
.card-tilt {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transform-style: preserve-3d;
    perspective: 800px;
}
.card-tilt:hover {
    box-shadow: 0 20px 60px rgba(0,0,0,0.35), 0 0 40px rgba(255, 255, 255,0.06);
}
.card-spotlight {
    position: relative; overflow: hidden;
}
.card-spotlight::before {
    content: ''; position: absolute; inset: -50%;
    background: radial-gradient(circle at var(--spotlight-x, 50%) var(--spotlight-y, 50%),
        rgba(255, 255, 255,0.06) 0%, transparent 60%);
    pointer-events: none; opacity: 0;
    transition: opacity 0.3s ease;
}
.card-spotlight:hover::before { opacity: 1; }

/* ── 10. FOCUS RINGS & ACCESSIBILITY ──────────────────── */
:focus-visible {
    outline: 2px solid rgba(255, 255, 255,0.5);
    outline-offset: 2px;
    border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── 11. ANIMATED NUMBER COUNTER ──────────────────────── */
.counter-value {
    font-variant-numeric: tabular-nums;
    transition: all 0.4s ease;
}
.counter-value.counting {
    animation: counter-pulse 0.15s ease;
}
@keyframes counter-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* ── 12. STATUS INDICATOR ─────────────────────────────── */
.status-dot {
    width: 8px; height: 8px; border-radius: 50%;
    display: inline-block; position: relative;
}
.status-dot::after {
    content: ''; position: absolute; inset: -3px;
    border-radius: 50%; border: 2px solid currentColor;
    opacity: 0.3; animation: status-pulse 2s ease infinite;
}
.status-online { background: #cccccc; color: #cccccc; }
.status-offline { background: #777777; color: #777777; }
.status-busy { background: #aaaaaa; color: #aaaaaa; }
@keyframes status-pulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.4); opacity: 0; }
}

/* ── 13. FLOATING ACTION BUTTON ───────────────────────── */
.fab-group {
    position: fixed; bottom: 28px; right: 28px; z-index: 100;
    display: flex; flex-direction: column-reverse; align-items: center; gap: 12px;
}
.fab {
    width: 52px; height: 52px; border-radius: 16px; border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff; font-size: 20px; cursor: pointer;
    box-shadow: 0 0 20px rgba(255, 255, 255,0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s var(--ease-spring, cubic-bezier(0.16,1,0.3,1));
}
.fab:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 12px 40px rgba(255, 255, 255,0.45);
}
.fab:active { transform: scale(0.95); }
.fab-mini {
    width: 40px; height: 40px; border-radius: 12px; border: none;
    background: rgba(13, 13, 13,0.9); border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-secondary); font-size: 14px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s; opacity: 0; transform: scale(0.5) translateY(20px);
    pointer-events: none;
}
.fab-group.open .fab-mini {
    opacity: 1; transform: scale(1) translateY(0); pointer-events: auto;
}
.fab-mini:hover {
    background: rgba(255, 255, 255,0.15); color: #cccccc;
    border-color: rgba(255, 255, 255,0.3);
}
.fab-mini:nth-child(1) { transition-delay: 0.05s; }
.fab-mini:nth-child(2) { transition-delay: 0.1s; }
.fab-mini:nth-child(3) { transition-delay: 0.15s; }

/* ── 14. TAGS / CHIP SYSTEM ───────────────────────────── */
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 14px; border-radius: 22px;
    font-size: 12px; font-weight: 500;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: var(--text-secondary, #999999);
    transition: all 0.2s;
}
.chip-primary { background: rgba(255, 255, 255,0.1); color: #bbbbbb; border-color: rgba(255, 255, 255,0.2); }
.chip-success { background: rgba(200, 200, 200,0.1); color: #cccccc; border-color: rgba(200, 200, 200,0.2); }
.chip-warning { background: rgba(200, 200, 200,0.1); color: #aaaaaa; border-color: rgba(200, 200, 200,0.2); }
.chip-danger { background: rgba(180, 180, 180,0.1); color: #777777; border-color: rgba(180, 180, 180,0.2); }
.chip-removable { cursor: pointer; padding-right: 8px; }
.chip-remove {
    width: 16px; height: 16px; border-radius: 50%; border: none;
    background: rgba(255,255,255,0.1); color: inherit;
    cursor: pointer; font-size: 8px;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}
.chip-remove:hover { background: rgba(180, 180, 180,0.3); }

/* ── 15. PROGRESS STEPPER ─────────────────────────────── */
.stepper {
    display: flex; align-items: center; gap: 0; margin: 24px 0;
}
.stepper-step {
    display: flex; align-items: center; gap: 10px;
    flex: 1; position: relative;
}
.stepper-step:not(:last-child)::after {
    content: ''; flex: 1; height: 2px;
    background: rgba(255,255,255,0.08); margin: 0 12px;
}
.stepper-step.completed::after { background: #ffffff; }
.stepper-dot {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; flex-shrink: 0;
    background: rgba(255,255,255,0.05); border: 2px solid rgba(255,255,255,0.1);
    color: var(--text-muted); transition: all 0.3s;
}
.stepper-step.active .stepper-dot {
    background: rgba(255, 255, 255,0.15); border-color: #ffffff; color: #cccccc;
    box-shadow: 0 0 20px rgba(255, 255, 255,0.2);
}
.stepper-step.completed .stepper-dot {
    background: #ffffff; border-color: #ffffff; color: white;
}
.stepper-label { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.stepper-step.active .stepper-label { color: var(--text-primary); font-weight: 600; }
.stepper-step.completed .stepper-label { color: var(--text-secondary); }

/* ── 16. EMPTY STATE HERO ─────────────────────────────── */
.empty-hero {
    text-align: center; padding: 60px 32px;
    display: flex; flex-direction: column; align-items: center;
}
.empty-hero-icon {
    width: 80px; height: 80px; border-radius: 24px;
    background: rgba(255, 255, 255,0.06); border: 1px solid rgba(255, 255, 255,0.1);
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; color: #ffffff; margin-bottom: 20px;
    animation: empty-float 4s ease-in-out infinite;
}
@keyframes empty-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.empty-hero h3 { font-size: 20px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.empty-hero p { font-size: 14px; color: var(--text-muted); max-width: 360px; line-height: 1.6; margin-bottom: 20px; }
.empty-hero-action {
    padding: 10px 24px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff; font-weight: 600; font-size: 13px;
    cursor: pointer; font-family: inherit;
    box-shadow: 0 0 12px rgba(255, 255, 255,0.05);
    text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
    transition: all 0.2s;
}
.empty-hero-action:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(255, 255, 255,0.35); }

/* ── 17. CURSOR SPOTLIGHT ─────────────────────────────── */
.cursor-spotlight {
    position: fixed; pointer-events: none; z-index: 9999;
    width: 400px; height: 400px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255,0.04) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    opacity: 0;
    will-change: left, top;
}
body:hover .cursor-spotlight { opacity: 1; }

/* ── 18. SELECTION STYLE ──────────────────────────────── */
::selection {
    background: rgba(255, 255, 255,0.25);
    color: #f0f0f0;
}
::-moz-selection {
    background: rgba(255, 255, 255,0.25);
    color: #f0f0f0;
}

/* ── 19. IMAGE GALLERY / GRID CARDS ───────────────────── */
.grid-card {
    background: rgba(10, 10, 10,0.6); backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 18px; overflow: hidden;
    transition: all 0.3s var(--ease-smooth, cubic-bezier(0.22,1,0.36,1));
    cursor: pointer;
}
.grid-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255,0.2);
    box-shadow: 0 16px 48px rgba(0,0,0,0.35), 0 0 30px rgba(255, 255, 255,0.05);
}
.grid-card-image {
    width: 100%; height: 180px; object-fit: cover;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.grid-card-image-placeholder {
    width: 100%; height: 180px;
    background: rgba(255, 255, 255,0.04);
    display: flex; align-items: center; justify-content: center;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.grid-card-image-placeholder i { font-size: 36px; color: rgba(255, 255, 255,0.15); }
.grid-card-body { padding: 16px; }
.grid-card-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.grid-card-subtitle { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.grid-card-footer {
    padding: 12px 16px; border-top: 1px solid rgba(255,255,255,0.04);
    display: flex; align-items: center; justify-content: space-between;
    font-size: 11px; color: var(--text-muted);
}
.grid-card-tag {
    padding: 3px 10px; border-radius: 22px;
    font-size: 10px; font-weight: 600; text-transform: capitalize;
}

/* ── 20. CONTEXT MENU ─────────────────────────────────── */
.context-menu {
    position: fixed; z-index: 8500;
    background: rgba(13, 13, 13,0.96); backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255,0.12);
    border-radius: 14px; padding: 6px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
    min-width: 200px;
    opacity: 0; visibility: hidden; transform: scale(0.95);
    transition: all 0.15s ease;
}
.context-menu.active { opacity: 1; visibility: visible; transform: scale(1); }
.context-menu-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 14px; border-radius: 8px;
    cursor: pointer; font-size: 13px;
    color: var(--text-secondary); transition: all 0.15s;
}
.context-menu-item:hover {
    background: rgba(255, 255, 255,0.08); color: var(--text-primary);
}
.context-menu-item i { font-size: 13px; width: 16px; text-align: center; color: var(--text-muted); }
.context-menu-item:hover i { color: #cccccc; }
.context-menu-divider {
    height: 1px; background: rgba(255,255,255,0.05);
    margin: 4px 8px;
}
.context-menu-item.danger { color: #777777; }
.context-menu-item.danger i { color: #777777; }

/* ── 11. INTERIOR FOOTER ──────────────────────────────── */
.interior-footer {
    margin-top: 60px;
    padding: 24px 0;
    border-top: 1px solid rgba(255,255,255,0.04);
    text-align: center;
    font-size: 12px;
    color: var(--text-muted, #555555);
}
.interior-footer-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}
.interior-footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--text-secondary, #999999);
}
.interior-footer-sep {
    color: rgba(255,255,255,0.1);
}
.interior-footer a {
    color: var(--text-muted, #555555);
    text-decoration: none;
    transition: color 0.2s;
}
.interior-footer a:hover {
    color: #cccccc;
}

/* ── 12. NAV ACTIVE STATE ─────────────────────────────── */
.nav-btn.active {
    color: #cccccc !important;
    background: rgba(255, 255, 255,0.1);
    border-radius: 8px;
}
.mobile-nav-link.active {
    color: #cccccc !important;
    background: rgba(255, 255, 255,0.08);
}

/* ── 13. MOBILE MENU BUTTON (interior pages) ──────────── */
.site-header .mobile-menu-btn {
    display: none;
    background: none;
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-secondary, #999999);
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.2s;
}
.site-header .mobile-menu-btn:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255,0.3);
}

@media (max-width: 768px) {
    .site-header .header-nav {
        display: none;
    }
    .site-header .header-divider {
        display: none;
    }
    .site-header .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ── 21. HISTORY GRID VIEW ────────────────────────────── */
.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

/* ── 22. RESPONSIVE TWEAKS ────────────────────────────── */
@media (max-width: 768px) {
    .cmd-palette { max-width: calc(100% - 32px); border-radius: 16px; }
    .cmd-palette-overlay { padding-top: 80px; }
    .shortcuts-grid { grid-template-columns: 1fr; }
    .toast-container { left: 16px; right: 16px; bottom: 16px; max-width: none; }
    .fab-group { bottom: 20px; right: 20px; }
    .analysis-grid { grid-template-columns: 1fr; }
}

/* ── 23. PRINT STYLES ─────────────────────────────────── */
@media print {
    .cmd-palette-overlay, .shortcuts-overlay, .toast-container,
    .fab-group, .cursor-spotlight, .context-menu { display: none !important; }
}

/* ── 24. SHARED PAGE HEADER PATTERN ───────────────────── */
.page-header-unified {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 32px;
    animation: page-enter-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.page-header-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    font-size: 20px;
}
.page-header-icon img {
    width: 28px; height: 28px;
    filter: invert(1) hue-rotate(180deg);
}
.page-header-text h1 {
    font-size: 22px; font-weight: 700; color: white;
    margin-bottom: 4px; letter-spacing: -0.01em;
}
.page-header-text p {
    font-size: 13px; color: var(--text-muted);
    line-height: 1.5;
}
.page-header-badge {
    margin-left: auto;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 11px; font-weight: 600;
    font-family: var(--font-mono);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
}

/* ── 25. GLASS SECTION WRAPPER ────────────────────────── */
.glass-section {
    background: rgba(10, 10, 10, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    backdrop-filter: blur(16px);
    padding: 28px;
    position: relative;
}
.glass-section::before {
    content: '';
    position: absolute;
    top: 0; left: 15%; right: 15%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

/* ── 26. GLASS CARD SPOTLIGHT ─────────────────────────── */
.glass-card-spotlight {
    --spotlight-x: 50%;
    --spotlight-y: 50%;
    position: relative;
}
.glass-card-spotlight::before {
    content: '';
    position: absolute; inset: 0;
    border-radius: inherit;
    background: radial-gradient(300px circle at var(--spotlight-x) var(--spotlight-y), rgba(255,255,255,0.04), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}
.glass-card-spotlight:hover::before { opacity: 1; }

/* ── 27. MONO GRADIENT DIVIDER ────────────────────────── */
.divider-gradient {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
    margin: 20px 0;
}

/* ── 28. TEXT GLOW ON HOVER ───────────────────────────── */
.text-glow:hover {
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

/* Standard component pass v4 */
.cmd-palette,
.shortcuts-panel,
.toast-item,
.toast-notification,
.tooltip,
[data-tooltip]::after,
.skeleton-card,
.glass-section {
    border-radius: 8px !important;
    border-color: rgba(255, 255, 255, 0.09) !important;
}

.cmd-palette-overlay,
.shortcuts-overlay {
    padding-inline: 16px;
}

.cmd-palette {
    max-width: min(580px, calc(100vw - 32px));
}

.cmd-palette-item,
.shortcut-row,
.toast-item,
.toast-notification {
    min-height: 44px;
}

.cmd-palette-input,
.cmd-palette-item-title,
.toast-title,
.shortcut-label {
    color: var(--text-primary, #e8edf2);
}

.cmd-palette-item-desc,
.toast-message,
.cmd-palette-footer,
.shortcut-label {
    color: var(--text-secondary, #a7b0bb);
}

.toast-container {
    left: auto;
    right: 20px;
    bottom: 20px;
    max-width: min(380px, calc(100vw - 32px));
}

@media (max-width: 600px) {
    .cmd-palette-overlay {
        padding-top: 72px;
        align-items: flex-start;
    }

    .shortcuts-panel {
        padding: 22px;
    }

    .shortcuts-grid {
        grid-template-columns: 1fr;
    }

    .toast-container {
        left: 12px;
        right: 12px;
        bottom: 12px;
        max-width: none;
    }

    .toast-item,
    .toast-notification {
        width: 100%;
        min-width: 0;
    }
}
