/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0F1419;
    --bg-secondary: #161B22;
    --bg-tertiary: #1C2128;
    --border: #30363D;
    --text-primary: #E6EDF3;
    --text-secondary: #8B949E;
    --text-muted: #484F58;
    --accent: #2B7CE9;
    --accent-hover: #62A0EA;
    --accent-rgb: 43, 124, 233;
    --success: #2DA44E;
    --warning: #D29922;
    --error: #CF222E;
    --header-height: 52px;
    --radius: 6px;
    --transition: 150ms ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== UTILITY ===== */
.hidden { display: none !important; }

/* ===== ACCESS GATE ===== */
.access-gate {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.access-gate-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 40px 36px 32px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 400px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.access-gate-logo {
    position: relative;
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.5);
    margin: -40px 0 -28px;
}

.access-gate-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin: 0;
}

.access-gate-sub {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 2px 0 12px;
    text-align: center;
    line-height: 1.4;
}

.access-gate-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.access-gate-input {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color var(--transition);
    text-align: left;
    letter-spacing: normal;
    box-sizing: border-box;
}

/* OTP input — centered, spaced digits */
.access-gate-input[inputmode="numeric"] {
    text-align: center;
    letter-spacing: 6px;
    font-size: 1.35rem;
    font-weight: 600;
    padding: 12px 14px;
}

.access-gate-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
}

.access-gate-input::placeholder {
    color: var(--text-muted);
    letter-spacing: normal;
    font-weight: 400;
    font-size: 0.95rem;
}

.access-gate-error {
    color: var(--error);
    font-size: 0.8rem;
    text-align: center;
    min-height: 0;
}
.access-gate-error:empty {
    display: none;
}

.access-gate-submit {
    width: 100%;
    padding: 11px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition);
    margin-top: 2px;
}

.access-gate-submit:hover {
    background: var(--accent-hover);
}

.access-gate-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.access-gate-back {
    margin-top: 4px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: underline;
    width: 100%;
    text-align: center;
    padding: 4px;
    font-family: inherit;
}
.access-gate-back:hover {
    color: var(--text-primary);
}

/* ===== HOME VIEW ===== */
#home-view {
    height: 100vh;
    overflow-y: auto;
    scroll-behavior: smooth;
    position: relative;
}

/* ===== LOGO TECH DOCK ===== */
.logo-dock {
    position: absolute;
    top: 24px;
    left: 28px;
    z-index: 10;
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Rotating outer rings */
.logo-ring {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 1.5px solid transparent;
    border-top-color: rgba(43, 124, 233, 0.6);
    border-right-color: rgba(46, 204, 113, 0.3);
    animation: logo-spin 8s linear infinite;
}

.logo-ring-2 {
    inset: -18px;
    border-top-color: rgba(46, 204, 113, 0.4);
    border-right-color: rgba(43, 124, 233, 0.15);
    border-left-color: rgba(43, 124, 233, 0.1);
    animation: logo-spin-reverse 12s linear infinite;
}

@keyframes logo-spin {
    to { transform: rotate(360deg); }
}

@keyframes logo-spin-reverse {
    to { transform: rotate(-360deg); }
}

/* Glass frame with tech corners */
.logo-frame {
    position: relative;
    width: 140px;
    height: 140px;
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(43, 124, 233, 0.08) 0%, rgba(15, 20, 25, 0.9) 50%, rgba(46, 204, 113, 0.06) 100%);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(43, 124, 233, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow:
        0 0 20px rgba(43, 124, 233, 0.1),
        inset 0 0 30px rgba(43, 124, 233, 0.03);
}

/* Tech bracket corners */
.logo-corner {
    position: absolute;
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.logo-corner::before,
.logo-corner::after {
    content: '';
    position: absolute;
    background: linear-gradient(90deg, #2B7CE9, #2ecc71);
    border-radius: 1px;
}

.logo-corner-tl { top: 8px; left: 8px; }
.logo-corner-tl::before { width: 18px; height: 1.5px; top: 0; left: 0; }
.logo-corner-tl::after  { width: 1.5px; height: 18px; top: 0; left: 0; }

.logo-corner-tr { top: 8px; right: 8px; }
.logo-corner-tr::before { width: 18px; height: 1.5px; top: 0; right: 0; }
.logo-corner-tr::after  { width: 1.5px; height: 18px; top: 0; right: 0; }

.logo-corner-bl { bottom: 8px; left: 8px; }
.logo-corner-bl::before { width: 18px; height: 1.5px; bottom: 0; left: 0; }
.logo-corner-bl::after  { width: 1.5px; height: 18px; bottom: 0; left: 0; }

.logo-corner-br { bottom: 8px; right: 8px; }
.logo-corner-br::before { width: 18px; height: 1.5px; bottom: 0; right: 0; }
.logo-corner-br::after  { width: 1.5px; height: 18px; bottom: 0; right: 0; }

/* Logo image */
.logo-img {
    width: 110px;
    height: 110px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(43, 124, 233, 0.3));
    position: relative;
    z-index: 2;
}

/* Background glow pulse */
.logo-glow {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(43, 124, 233, 0.15) 0%, rgba(46, 204, 113, 0.05) 40%, transparent 70%);
    animation: logo-pulse 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes logo-pulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50%      { opacity: 1;   transform: scale(1.15); }
}

/* --- Hero Section --- */
.home-hero {
    position: relative;
    padding: 60px 40px 50px;
    text-align: center;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(43,124,233,0.08) 0%, transparent 60%),
        var(--bg-primary);
    border-bottom: 1px solid var(--border);
}

.hero-content {
    max-width: 700px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #62A0EA;
    background: rgba(43,124,233,0.1);
    border: 1px solid rgba(43,124,233,0.2);
    margin-bottom: 20px;
}

.home-hero h2 {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #E6EDF3, #62A0EA);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.home-hero p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 28px;
}

/* Hero CTA */
.hero-actions {
    margin-bottom: 36px;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 32px;
    background: linear-gradient(135deg, #1A5FB4 0%, #2B7CE9 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 16px rgba(43, 124, 233, 0.35);
}

.hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(43, 124, 233, 0.5);
}

.hero-cta:active {
    transform: translateY(0);
}

.hero-cta svg {
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

/* Hero stats bar */
.hero-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 28px;
}

.hero-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.hero-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.hero-stat-divider {
    width: 1px;
    height: 36px;
    background: var(--border);
}

/* --- Domain Showcase (large image cards) --- */
.domain-showcase {
    padding: 40px 40px 60px;
    max-width: 1440px;
    margin: 0 auto;
}

.domain-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 20px;
}

.domain-card {
    position: relative;
    height: 280px;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.06);
    transition: all 300ms ease;
}

.domain-card:hover {
    transform: translateY(-6px);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.5),
        0 0 0 1px var(--domain-accent, #2B7CE9),
        0 0 30px -5px color-mix(in srgb, var(--domain-accent, #2B7CE9) 30%, transparent);
}

.domain-card-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 500ms ease;
}

.domain-card:hover .domain-card-bg {
    transform: scale(1.08);
}

.domain-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(15, 20, 25, 0.15) 0%,
        rgba(15, 20, 25, 0.6) 50%,
        rgba(15, 20, 25, 0.92) 100%
    );
    transition: background 300ms ease;
}

.domain-card:hover .domain-card-overlay {
    background: linear-gradient(
        to bottom,
        rgba(15, 20, 25, 0.05) 0%,
        rgba(15, 20, 25, 0.5) 50%,
        rgba(15, 20, 25, 0.88) 100%
    );
}

.domain-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
}

.domain-card-title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.domain-card-desc {
    font-size: 13px;
    color: rgba(255,255,255,0.75);
    line-height: 1.5;
    margin-bottom: 10px;
}

.domain-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    font-weight: 500;
}

.domain-card-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
}

/* --- Domain Popup (overlay with module cards) --- */
.domain-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 150ms ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.domain-popup {
    background: var(--bg-secondary, #161B22);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 720px;
    max-width: 92vw;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    animation: popIn 200ms ease;
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.96) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.domain-popup-header {
    position: relative;
    height: 180px;
    overflow: hidden;
    flex-shrink: 0;
}

.domain-popup-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.domain-popup-header-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(15, 20, 25, 0.2) 0%,
        rgba(15, 20, 25, 0.85) 100%
    );
}

.domain-popup-header-content {
    position: absolute;
    bottom: 20px;
    left: 28px;
    right: 28px;
}

.domain-popup-header-content h2 {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.domain-popup-header-content p {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    line-height: 1.5;
}

.domain-popup-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 150ms ease;
    z-index: 1;
}

.domain-popup-close:hover {
    background: rgba(207, 34, 46, 0.7);
}

.domain-popup-body {
    padding: 24px 28px 28px;
    overflow-y: auto;
    flex: 1;
}

.domain-popup-section-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.domain-popup-modules {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Module card inside domain popup */
.domain-popup-module-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    border-radius: 12px;
    background: var(--bg-tertiary, #1C2128);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 200ms ease;
}

.domain-popup-module-card:hover {
    background: rgba(43, 124, 233, 0.06);
    border-color: var(--domain-accent, #2B7CE9);
    transform: translateX(4px);
}

.dpmc-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
}

.dpmc-icon svg {
    width: 24px;
    height: 24px;
}

.dpmc-icon.processing     { background: rgba(43,124,233,0.12);  color: #2B7CE9; }
.dpmc-icon.reconstruction { background: rgba(45,164,78,0.12);   color: #2DA44E; }
.dpmc-icon.registration   { background: rgba(130,80,223,0.12);  color: #8250DF; }
.dpmc-icon.implicit       { background: rgba(47,163,115,0.12);  color: #2FA373; }
.dpmc-icon.features       { background: rgba(207,34,46,0.12);   color: #CF222E; }
.dpmc-icon.conversion     { background: rgba(191,135,72,0.12);  color: #BF8748; }
.dpmc-icon.segmentation   { background: rgba(210,153,34,0.12);  color: #D29922; }
.dpmc-icon.stereo         { background: rgba(219,135,68,0.12);  color: #DB8744; }
.dpmc-icon.lidar          { background: rgba(45,164,78,0.12);   color: #2DA44E; }
.dpmc-icon.collision      { background: rgba(207,34,46,0.12);   color: #CF222E; }
.dpmc-icon.medical        { background: rgba(43,124,233,0.12);  color: #2B7CE9; }

.dpmc-info {
    flex: 1;
    min-width: 0;
}

.dpmc-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.dpmc-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dpmc-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
}

.dpmc-methods {
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg-primary, #0F1419);
}

.dpmc-video-badge {
    display: flex;
    align-items: center;
    gap: 3px;
    color: #CF222E;
    font-weight: 500;
}

.dpmc-arrow {
    color: var(--text-muted);
    flex-shrink: 0;
    opacity: 0.4;
    transition: all 200ms ease;
}

.domain-popup-module-card:hover .dpmc-arrow {
    opacity: 1;
    color: var(--domain-accent, #2B7CE9);
    transform: translateX(3px);
}

.module-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 200ms ease;
    position: relative;
    overflow: hidden;
}

.module-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border-color: rgba(43, 124, 233, 0.4);
}

.module-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 18px 10px;
}

.module-card-body {
    padding: 0 18px 16px;
}

.module-card-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 20px;
    flex-shrink: 0;
}

.module-card-icon svg {
    width: 20px;
    height: 20px;
}

.module-card-icon.segmentation   { background: rgba(210,153,34,0.12);  color: #D29922; }
.module-card-icon.reconstruction { background: rgba(45,164,78,0.12);   color: #2DA44E; }
.module-card-icon.registration   { background: rgba(130,80,223,0.12);  color: #8250DF; }
.module-card-icon.implicit       { background: rgba(47,163,115,0.12);  color: #2FA373; }
.module-card-icon.features       { background: rgba(207,34,46,0.12);   color: #CF222E; }
.module-card-icon.conversion     { background: rgba(191,135,72,0.12);  color: #BF8748; }
.module-card-icon.processing     { background: rgba(43,124,233,0.12);  color: #2B7CE9; }
.module-card-icon.stereo         { background: rgba(219,135,68,0.12);  color: #DB8744; }
.module-card-icon.lidar          { background: rgba(45,164,78,0.12);   color: #2DA44E; }
.module-card-icon.collision      { background: rgba(207,34,46,0.12);   color: #CF222E; }
.module-card-icon.medical        { background: rgba(43,124,233,0.12);  color: #2B7CE9; }

.module-card-badges {
    display: flex;
    align-items: center;
    gap: 6px;
}

.module-badge-category {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(43, 124, 233, 0.1);
    color: #8B949E;
}

.module-badge-category.processing     { color: #2B7CE9; background: rgba(43,124,233,0.1); }
.module-badge-category.reconstruction { color: #2DA44E; background: rgba(45,164,78,0.1); }
.module-badge-category.registration   { color: #8250DF; background: rgba(130,80,223,0.1); }
.module-badge-category.implicit       { color: #2FA373; background: rgba(47,163,115,0.1); }
.module-badge-category.features       { color: #CF222E; background: rgba(207,34,46,0.1); }
.module-badge-category.conversion     { color: #BF8748; background: rgba(191,135,72,0.1); }
.module-badge-category.segmentation   { color: #D29922; background: rgba(210,153,34,0.1); }
.module-badge-category.stereo         { color: #DB8744; background: rgba(219,135,68,0.1); }
.module-badge-category.lidar          { color: #2DA44E; background: rgba(45,164,78,0.1); }
.module-badge-category.collision      { color: #CF222E; background: rgba(207,34,46,0.1); }
.module-badge-category.medical        { color: #2B7CE9; background: rgba(43,124,233,0.1); }

.module-badge-video {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: rgba(207, 34, 46, 0.12);
    color: #CF222E;
    transition: all 0.15s ease;
}

.module-card:hover .module-badge-video {
    background: rgba(207, 34, 46, 0.2);
}

.module-card-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.module-card-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.module-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    color: var(--text-muted);
}

.module-card-meta .method-count {
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg-tertiary);
}

.module-card-meta .coming-soon {
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(210, 153, 34, 0.12);
    color: var(--warning);
}

/* ===== PROJECT SIDEBAR ===== */
#project-sidebar {
    width: 260px;
    min-width: 260px;
    flex-shrink: 0;
    transition: width 200ms ease, min-width 200ms ease;
}

.project-sidebar {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #111318;
    border-right: 1px solid var(--border);
}

/* --- Collapsed state --- */
#project-sidebar.ps-collapsed {
    width: 48px;
    min-width: 48px;
}
.ps-collapsed .ps-body {
    display: none;
}
.ps-collapsed .ps-title {
    display: none;
}
.ps-collapsed .ps-header {
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    gap: 6px;
}
.ps-collapsed .ps-title-row {
    display: none;
}

.ps-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 14px 6px;
}

/* Round white home icon */
.ps-home-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: var(--text-primary);
    border: none;
    border-radius: 50%;
    color: var(--bg-primary);
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--transition);
}
.ps-home-btn:hover {
    background: var(--accent);
    color: #fff;
    transform: scale(1.05);
}
.ps-collapsed .ps-home-btn {
    width: 28px;
    height: 28px;
}

.ps-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.ps-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.ps-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: none;
    border: none;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}
.ps-toggle-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* --- Body (hides on collapse) --- */
.ps-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* --- Action buttons row --- */
.ps-actions {
    display: flex;
    gap: 6px;
    padding: 4px 10px 8px;
}

.ps-new-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}
.ps-new-btn:hover {
    background: rgba(43, 124, 233, 0.12);
    border-color: var(--accent);
    color: var(--accent);
}
.ps-new-btn svg { flex-shrink: 0; }

/* --- Delete button on project items --- */
.ps-item-delete {
    flex-shrink: 0;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: none;
    border: none;
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: all var(--transition);
}
.ps-item:hover .ps-item-delete { opacity: 0.6; }
.ps-item-delete:hover {
    opacity: 1 !important;
    color: var(--danger, #f85149);
    background: rgba(248, 81, 73, 0.12);
}

/* --- Delete confirm button --- */
.ps-modal-btn-delete {
    background: var(--danger, #f85149);
    border-color: var(--danger, #f85149);
    color: #fff;
}
.ps-modal-btn-delete:hover {
    background: #da3633;
    border-color: #da3633;
}
.ps-modal-msg {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
}

/* --- Project list --- */
.ps-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 8px;
}

.ps-empty {
    padding: 24px 16px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.ps-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: 2px;
}
.ps-item:hover {
    background: var(--bg-tertiary);
}

.ps-item-active {
    background: rgba(43, 124, 233, 0.15);
}
.ps-item-active .ps-item-name {
    color: var(--accent);
    font-weight: 500;
}
.ps-item-active .ps-item-icon svg {
    stroke: var(--accent);
}

.ps-item-icon {
    flex-shrink: 0;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.ps-item-name {
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- New Project Modal (uses ne-modal base) --- */
.ps-modal-new {
    min-width: 380px;
    max-width: 440px;
}

.ps-modal-field {
    margin-bottom: 16px;
}

.ps-modal-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.ps-modal-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: border-color var(--transition);
}
.ps-modal-input::placeholder {
    color: var(--text-muted);
}
.ps-modal-input:focus {
    border-color: var(--accent);
}
.ps-modal-input-error {
    border-color: var(--error) !important;
}

.ps-modal-error {
    font-size: 12px;
    color: var(--error);
    min-height: 18px;
    margin-bottom: 8px;
}

.ps-modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.ps-modal-btn {
    padding: 9px 20px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all var(--transition);
}

.ps-modal-btn-cancel {
    color: var(--text-secondary);
    background: var(--bg-tertiary);
}
.ps-modal-btn-cancel:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.ps-modal-btn-create {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
}
.ps-modal-btn-create:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}
.ps-modal-btn-create:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* --- API Modal --- */
.ps-modal-api {
    min-width: 520px;
    max-width: 600px;
}

.ps-modal-api-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.api-key-display label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.api-key-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.api-key-box code {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--accent);
    word-break: break-all;
}

.api-copy-btn {
    flex-shrink: 0;
    padding: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.api-copy-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.api-usage {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.api-docs {
    padding: 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.api-docs h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.api-docs pre {
    margin: 0;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 10px;
}

.api-docs code {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: var(--text-primary);
    line-height: 1.6;
}

.api-docs-note {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.api-info {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.ps-modal-btn-primary {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
}

.ps-modal-btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.ps-modal-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ps-modal-btn-danger {
    background: #d32f2f;
    color: white;
    border-color: #d32f2f;
}

.ps-modal-btn-danger:hover {
    background: #b71c1c;
    border-color: #b71c1c;
}

.ps-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 28px;
    height: 28px;
    padding: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
}

.ps-modal-close:hover {
    color: var(--text-primary);
}

/* ===== WORKSPACE: 50/50 SPLIT LAYOUT ===== */
#workspace-app {
    display: flex;
    height: 100vh;
}

#left-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    overflow: hidden;
}

#right-panel {
    flex: 1;
    min-width: 0;
    position: relative;
    overflow: hidden;
    background: var(--bg-primary);
}

/* ===== PANEL HEADER (back + title) — hidden in universal toolbox mode ===== */
.panel-header {
    display: none;
}

.panel-header h2 {
    font-size: 15px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}

.btn-back:hover {
    color: var(--text-primary);
    border-color: var(--accent);
    background: rgba(43, 124, 233, 0.05);
}

.back-arrow {
    font-size: 14px;
}

/* ===== TAB BAR — inside header, visible only in workspace ===== */
#tab-bar {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
}
#tab-bar.hidden {
    display: none;
}

.tab-btn {
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-icon {
    font-size: 14px;
}

/* ===== TAB CONTENT ===== */
#tab-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* Workflow tab uses flex layout for node editor when active */
#tab-workflow.active {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    flex: 1;
}

/* ===== VIDEO TAB ===== */
.video-container {
    margin-bottom: 20px;
}

.video-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-primary);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ===== WORKFLOW TAB ===== */
.wf-panel {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 12px;
}

.wf-panel h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

/* Upload zone */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--accent);
    background: rgba(43, 124, 233, 0.05);
}

.upload-icon {
    font-size: 28px;
    margin-bottom: 8px;
    opacity: 0.6;
}

.upload-zone p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.upload-link {
    color: var(--accent);
    cursor: pointer;
}

.upload-formats {
    font-size: 11px !important;
    color: var(--text-muted) !important;
    margin-top: 8px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 8px;
}

#file-name {
    font-size: 13px;
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#file-size {
    font-size: 12px;
    color: var(--text-muted);
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}

.btn-icon:hover {
    color: var(--error);
    background: rgba(248, 81, 73, 0.1);
}

/* Method section */
#method-select {
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    margin-bottom: 12px;
}

#method-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.param-group {
    margin-bottom: 10px;
}

.param-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.param-group label .param-value {
    color: var(--accent);
    font-weight: 600;
    font-family: monospace;
}

.param-group input[type="range"] {
    width: 100%;
    accent-color: var(--accent);
}

.param-group .param-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.btn-primary {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    margin-top: 8px;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* No methods */
.no-methods-text {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}

.no-methods-text code {
    font-size: 12px;
    padding: 1px 5px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--accent);
}

/* ===== JOB TRACKER ===== */
.job-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.badge {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.badge.pending { background: rgba(210, 153, 34, 0.15); color: var(--warning); }
.badge.running { background: rgba(43, 124, 233, 0.15); color: var(--accent); }
.badge.completed { background: rgba(63, 185, 80, 0.15); color: var(--success); }
.badge.failed { background: rgba(248, 81, 73, 0.15); color: var(--error); }

#job-elapsed {
    font-size: 12px;
    color: var(--text-muted);
    font-family: monospace;
}

#job-progress-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 2px;
    overflow: hidden;
}

#job-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 300ms ease;
}

#job-progress-fill.indeterminate {
    width: 30%;
    animation: indeterminate 1.5s ease-in-out infinite;
}

@keyframes indeterminate {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}

.error-text {
    font-size: 12px;
    color: var(--error);
    margin-top: 8px;
    word-break: break-word;
}

/* ===== SCIENTIFIC TAB / THEORY ===== */
#theory-overview,
#theory-method {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}

.theory-heading {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.theory-body {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.8;
}

.theory-body p {
    margin-bottom: 8px;
}

.theory-placeholder {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

/* KaTeX dark theme overrides */
.katex {
    color: var(--text-primary);
    font-size: 1.05em;
}

.katex-display {
    margin: 1em 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 0;
}

.katex-display > .katex {
    color: #62A0EA;
}

/* ===== EMPTY TAB STATE ===== */
.empty-tab-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.empty-tab-state p {
    font-size: 14px;
    color: var(--text-muted);
}

/* ===== VIEWPORT ===== */
#viewport-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

#viewport {
    width: 100%;
    height: 100%;
    display: block;
}

#viewport-overlay {
    position: absolute;
    bottom: 12px;
    left: 12px;
    display: flex;
    gap: 12px;
    font-size: 11px;
    font-family: monospace;
    color: var(--text-primary);
    background: rgba(22, 27, 34, 0.75);
    padding: 4px 8px;
    border-radius: 4px;
    pointer-events: none;
    backdrop-filter: blur(4px);
}

#viewport-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

#viewport-empty p {
    font-size: 15px;
    color: rgba(200, 210, 225, 0.6);
}

/* ===== SLICER MODE ===== */
/* ===== SLICER 2x2 GRID (3D Slicer MPR Layout) =====
 *  ┌─────────────┬─────────────┐
 *  │  SAGITTAL   │   CORONAL   │
 *  ├─────────────┼─────────────┤
 *  │    AXIAL    │  3D VOLUME  │
 *  └─────────────┴─────────────┘
 */
.slicer-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 0;
    background: none;
    pointer-events: none;
}

.slicer-panel {
    position: relative;
    pointer-events: auto;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: none;
    cursor: crosshair;
}

.slicer-panel-volume3d {
    overflow: visible;
    cursor: default;
}

.slicer-label {
    position: absolute;
    top: 6px;
    left: 8px;
    z-index: 2;
    font-size: 11px;
    font-family: monospace;
    color: #e6edf3;
    background: rgba(0, 0, 0, 0.65);
    padding: 2px 8px 2px 12px;
    border-radius: 3px;
    border-left: 3px solid #888;
    pointer-events: none;
    backdrop-filter: blur(4px);
}

.slicer-slice-info {
    position: absolute;
    top: 6px;
    right: 8px;
    z-index: 2;
    font-size: 10px;
    font-family: monospace;
    color: #8b949e;
    background: rgba(0, 0, 0, 0.55);
    padding: 2px 6px;
    border-radius: 3px;
    pointer-events: none;
}

.slicer-slider-wrap {
    position: absolute;
    bottom: 6px;
    left: 8px;
    right: 8px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 6px;
}

.slicer-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.slicer-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #2B7CE9;
    border: 2px solid #fff;
    cursor: pointer;
}

.slicer-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #2B7CE9;
    border: 2px solid #fff;
    cursor: pointer;
}

/* ===== LOADING OVERLAY ===== */
.loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    pointer-events: none;
}
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: loading-spin 0.8s linear infinite;
}
@keyframes loading-spin { to { transform: rotate(360deg); } }
.loading-text {
    color: #ddd;
    margin-top: 12px;
    font-size: 13px;
    font-weight: 400;
}

/* Hide normal overlays in slicer mode */
.slicer-active .viewer-toolbar,
.slicer-active .obj-panel,
.slicer-active #viewport-overlay,
.slicer-active #viewport-empty {
    display: none !important;
}

/* ===== REGISTRATION PANEL (kept for RegistrationPanel.js compatibility) ===== */
.reg-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    z-index: 200;
    overflow-y: auto;
    font-size: 13px;
    color: var(--text-primary);
}

.reg-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 14px;
}

.reg-panel-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.reg-panel-close:hover {
    color: var(--error);
}

.reg-panel-section {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}

.reg-panel-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.reg-panel-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

/* Buttons */
.reg-btn {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    white-space: nowrap;
}
.reg-btn:hover {
    background: var(--bg-primary);
    border-color: var(--accent);
}
.reg-btn-ct { border-left: 3px solid #4a9eff; }
.reg-btn-mri { border-left: 3px solid #ff6b6b; }
.reg-btn-tfm { border-left: 3px solid #ffd93d; }
.reg-btn-sm {
    padding: 4px 10px;
    font-size: 11px;
}

.reg-file-label {
    font-size: 11px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

/* Radio & Checkbox labels */
.reg-radio-label,
.reg-checkbox-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}

.reg-radio-label input,
.reg-checkbox-label input {
    accent-color: var(--accent);
    cursor: pointer;
}

/* Sliders */
.reg-slider {
    flex: 1;
    min-width: 60px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}
.reg-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
}
.reg-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--accent);
    border: none;
    border-radius: 50%;
    cursor: pointer;
}
.reg-slider-wide { min-width: 100px; }

.reg-slider-label {
    font-size: 11px;
    color: var(--text-secondary);
    min-width: 28px;
    white-space: nowrap;
}

.reg-slider-value {
    font-size: 11px;
    color: var(--text-muted);
    min-width: 32px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1199px) {
    #left-panel { flex: 1.4; }
    #right-panel { flex: 1; }
}

@media (max-width: 767px) {
    #project-sidebar {
        display: none;
    }
    #workspace-app {
        flex-direction: column;
    }
    #left-panel,
    #right-panel {
        flex: none;
        width: 100%;
        height: 50%;
    }
    #left-panel {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
}

/* ===== SCROLLBARS ===== */
#tab-content::-webkit-scrollbar { width: 6px; }
#tab-content::-webkit-scrollbar-track { background: transparent; }
#tab-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

#home-view::-webkit-scrollbar { width: 6px; }
#home-view::-webkit-scrollbar-track { background: transparent; }
#home-view::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* ============================================================
   NODE EDITOR — Simplified pipeline: [Inputs] → [Process] → [Execute]
   ============================================================ */

/* Container fills the workflow tab */
.ne-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    background: var(--bg-primary);
}

/* --- Toolbar: buttons center + zoom right --- */
.ne-toolbar {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.ne-toolbar-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.ne-zoom-group {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}
.ne-zoom-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}
.ne-zoom-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent);
}
.ne-zoom-level {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 38px;
    text-align: center;
    font-family: monospace;
}

.ne-tool-btn {
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all var(--transition);
}
.ne-tool-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent);
    background: rgba(43, 124, 233, 0.08);
}
.ne-tool-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Selector buttons (Inputs, Process) */
.ne-tool-selector {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.ne-tool-selector.ne-has-selection {
    color: var(--accent);
    border-color: rgba(43, 124, 233, 0.4);
    background: rgba(43, 124, 233, 0.06);
}
.ne-selector-label {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ne-dropdown-arrow {
    font-size: 10px;
    opacity: 0.6;
}

/* Section label in modals (e.g. "Primitives", "Open3D Datasets") */
.ne-modal-section-label {
    grid-column: 1 / -1;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 8px 0 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2px;
}
.ne-modal-section-label:first-child {
    padding-top: 0;
}

/* Empty state in modals */
.ne-modal-empty {
    color: var(--text-muted);
    font-size: 13px;
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
}

.ne-modal-note {
    background: rgba(106, 170, 255, 0.1);
    border: 1px solid rgba(106, 170, 255, 0.3);
    border-radius: var(--radius);
    padding: 12px;
    margin: 16px 0;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Log popup */
.ne-modal-logs {
    width: 750px;
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}
.ne-log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}
.ne-log-header .ne-modal-title {
    margin: 0;
    padding: 0;
}
.ne-log-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: 10px;
}
.ne-log-status.pending   { color: var(--text-muted); background: rgba(139,148,158,0.12); }
.ne-log-status.running   { color: #58a6ff; background: rgba(88,166,255,0.12); }
.ne-log-status.completed { color: var(--success, #2DA44E); background: rgba(45,164,78,0.12); }
.ne-log-status.failed    { color: var(--error, #CF222E); background: rgba(207,34,46,0.12); }
.ne-log-status.running .ne-pulse {
    width: 6px; height: 6px; border-radius: 50%;
    background: #58a6ff;
    animation: ne-pulse-anim 1.2s ease-in-out infinite;
}
@keyframes ne-pulse-anim {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.7); }
}
.ne-log-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.ne-log-close:hover {
    color: var(--error);
}
.ne-log-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    margin: 0;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 12px;
    line-height: 1.6;
    color: #c9d1d9;
    background: #0d1117;
    border-radius: 0 0 var(--radius) var(--radius);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 60vh;
}
/* Loguru-style log coloring */
.ne-log-content .log-timestamp { color: #8b949e; }
.ne-log-content .log-level-info     { color: #58a6ff; font-weight: 600; }
.ne-log-content .log-level-success  { color: #2da44e; font-weight: 600; }
.ne-log-content .log-level-warning  { color: #d29922; font-weight: 600; }
.ne-log-content .log-level-error    { color: #f85149; font-weight: 600; }
.ne-log-content .log-level-critical { color: #ff7b72; font-weight: 700; background: rgba(248,81,73,0.1); }
.ne-log-content .log-level-debug    { color: #8b949e; }
.ne-log-content .log-source  { color: #7ee787; }
.ne-log-content .log-message { color: #c9d1d9; }
.ne-log-content .log-number  { color: #d2a8ff; }
.ne-log-content .log-line-error { background: rgba(248,81,73,0.06); display: block; }
.ne-log-content .log-line-warning { background: rgba(210,153,34,0.06); display: block; }

/* Execute button (icon only) */
.ne-tool-execute {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ne-tool-execute:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}
.ne-tool-execute:disabled {
    opacity: 0.4;
    cursor: wait;
}

/* Save button in toolbar (icon only) */
.ne-tool-save {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: var(--text-secondary);
    border-color: var(--border);
}
.ne-tool-save svg { flex-shrink: 0; }
.ne-tool-save:hover {
    color: var(--success, #2da44e);
    border-color: var(--success, #2da44e);
    background: rgba(45, 164, 78, 0.08);
}

/* API button in toolbar (icon only) */
.ne-tool-api {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: var(--text-secondary);
    border-color: var(--border);
}
.ne-tool-api svg { flex-shrink: 0; }
.ne-tool-api:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(43, 124, 233, 0.08);
}

.ne-save-flash {
    background: rgba(45, 164, 78, 0.2) !important;
    border-color: var(--success, #2da44e) !important;
    color: var(--success, #2da44e) !important;
}

/* --- Wrapper parent: holds scrollable area (no overflow itself) --- */
.ne-wrapper-parent {
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* --- Pannable wrapper (click-drag to pan, scrollbars hidden) --- */
.ne-wrapper {
    width: 100%;
    height: 100%;
    overflow: auto;
    cursor: grab;
    scrollbar-width: none;          /* Firefox */
    -ms-overflow-style: none;       /* IE/Edge */
}
.ne-wrapper::-webkit-scrollbar {
    display: none;                  /* Chrome/Safari */
}
.ne-wrapper.ne-panning {
    cursor: grabbing;
    user-select: none;
}

/* --- Sizer: determines scrollable area (width/height set by JS) --- */
.ne-sizer {
    position: relative;
}

/* --- Zoom layer: CSS transform scale, all content inside --- */
.ne-zoom-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 3000px;
    height: 2000px;
    transform-origin: 0 0;
    background:
        radial-gradient(circle, var(--border) 1px, transparent 1px);
    background-size: 24px 24px;
}

.ne-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: visible;
}

.ne-canvas {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 2;
}

/* --- Connection lines --- */
.ne-conn-line {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-linecap: round;
    opacity: 0.6;
    transition: opacity 150ms, stroke-width 150ms;
}
.ne-conn-line:hover {
    opacity: 1;
    stroke-width: 3;
    filter: drop-shadow(0 0 3px rgba(43, 124, 233, 0.4));
}
.ne-conn-temp {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-dasharray: 8 4;
    opacity: 0.7;
    transition: stroke-width 100ms, opacity 100ms;
    filter: drop-shadow(0 0 3px rgba(43, 124, 233, 0.3));
}

/* --- Block: the draggable node element --- */
.ne-block {
    position: absolute;
    width: 260px;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: default;
    user-select: none;
    transition: box-shadow 150ms, border-color 150ms;
    z-index: 10;
}
.ne-block:hover {
    border-color: rgba(43, 124, 233, 0.4);
}
.ne-block.ne-dragging {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    border-color: var(--accent);
    z-index: 100;
}

/* Block header */
.ne-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: 7px 7px 0 0;
    cursor: grab;
    user-select: none;
}
.ne-block.ne-dragging .ne-block-header {
    cursor: grabbing;
}

.ne-block-file-input .ne-block-header {
    background: rgba(43, 124, 233, 0.12);
}
.ne-block-process .ne-block-header {
    background: rgba(94, 140, 174, 0.15);
}

.ne-block-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.ne-block-video {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 3px;
    line-height: 1;
    border-radius: 3px;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    opacity: 0.5;
}
.ne-block-video:hover {
    color: #CF222E;
    opacity: 1;
    background: rgba(207, 34, 46, 0.1);
}
.ne-block-log {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 3px;
    line-height: 1;
    border-radius: 3px;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    opacity: 0.5;
}
.ne-block-log:hover {
    color: #2B7CE9;
    opacity: 1;
    background: rgba(43, 124, 233, 0.1);
}
.ne-block-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    border-radius: 3px;
    transition: all var(--transition);
}
.ne-block-delete:hover {
    color: var(--error);
    background: rgba(207, 34, 46, 0.15);
}

/* Block body: contains ports + content */
.ne-block-body {
    display: flex;
    padding: 6px 0;
    min-height: 30px;
}

/* Ports columns */
.ne-ports {
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
    flex-shrink: 0;
}
.ne-ports-left { padding-left: 0; }
.ne-ports-right { padding-right: 0; }
.ne-ports-top,
.ne-ports-bottom {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 2px 0;
}
.ne-ports-top { border-bottom: 1px solid var(--border); }
.ne-ports-bottom { border-top: 1px solid var(--border); }
.ne-ports-top .ne-port,
.ne-ports-bottom .ne-port {
    flex-direction: column;
    padding: 3px 6px;
}
.ne-ports-top .ne-port-label,
.ne-ports-bottom .ne-port-label {
    font-size: 9px;
}

/* Single port: dot + label */
.ne-port {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    cursor: pointer;
}
.ne-port:hover .ne-port-dot {
    transform: scale(1.4);
    box-shadow: 0 0 6px var(--accent);
}

.ne-port-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-secondary);
    flex-shrink: 0;
    transition: transform 150ms, box-shadow 150ms, background 150ms;
    cursor: crosshair;
    /* Larger invisible hit area */
    position: relative;
}
.ne-port-dot::after {
    content: '';
    position: absolute;
    top: -8px; left: -8px; right: -8px; bottom: -8px;
    border-radius: 50%;
}
.ne-port-in .ne-port-dot {
    background: var(--success);
}
.ne-port-out .ne-port-dot {
    background: var(--accent);
}

/* Pulsing glow on compatible ports while dragging a connection */
.ne-port-target .ne-port-dot {
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(43, 124, 233, 0.6);
    animation: ne-port-pulse 1s ease-in-out infinite;
}
.ne-port-target.ne-port-in .ne-port-dot {
    box-shadow: 0 0 8px rgba(39, 174, 96, 0.6);
}
@keyframes ne-port-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Snap highlight — when cursor is near enough to connect */
.ne-port-snap {
    transform: scale(1.8) !important;
    box-shadow: 0 0 12px var(--accent), 0 0 20px rgba(43, 124, 233, 0.4) !important;
    animation: none !important;
}
.ne-port-in .ne-port-snap {
    box-shadow: 0 0 12px var(--success), 0 0 20px rgba(39, 174, 96, 0.4) !important;
}

.ne-port-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Block content area (between ports) */
.ne-block-content {
    flex: 1;
    padding: 4px 6px;
    min-width: 0;
}

/* File input inside block */
.ne-file-drop {
    border: 1.5px dashed var(--border);
    border-radius: 4px;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
}
.ne-file-drop:hover,
.ne-file-drop.ne-drag-over {
    border-color: var(--accent);
    background: rgba(43, 124, 233, 0.06);
}
.ne-file-label {
    font-size: 11px;
    color: var(--text-muted);
}
.ne-file-info {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: background var(--transition);
}
.ne-file-info:hover {
    background: rgba(43, 124, 233, 0.08);
}
.ne-file-name {
    flex: 1;
    color: var(--text-primary);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ne-file-clear {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 0 2px;
}
.ne-file-clear:hover {
    color: var(--error);
}

/* Parameter sliders inside blocks */
.ne-param {
    margin-bottom: 6px;
}
.ne-param label {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}
.ne-pval {
    color: var(--accent);
    font-weight: 600;
    font-family: monospace;
}
.ne-param input[type="range"] {
    width: 100%;
    height: 4px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* Block status bar */
.ne-block-status {
    padding: 4px 10px;
    border-top: 1px solid var(--border);
    border-radius: 0 0 7px 7px;
}

.ne-badge {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-muted);
}
.ne-badge.idle       { background: var(--bg-tertiary); color: var(--text-muted); }
.ne-badge.running    { background: rgba(43, 124, 233, 0.15); color: var(--accent); animation: ne-pulse 1.5s infinite; }
.ne-badge.completed  { background: rgba(45, 164, 78, 0.15); color: var(--success); }
.ne-badge.failed     { background: rgba(207, 34, 46, 0.15); color: var(--error); }

@keyframes ne-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* --- Process Selection Popup (structured) --- */
.ne-modal-process {
    position: relative;
    min-width: 720px;
    max-width: 860px;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

/* Header */
.ne-proc-header {
    padding: 28px 32px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.ne-proc-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 2px;
}
.ne-proc-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0 0 14px;
}
.ne-proc-search-wrap {
    position: relative;
}
.ne-proc-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
.ne-proc-search {
    width: 100%;
    padding: 8px 12px 8px 34px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}
.ne-proc-search:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(43, 124, 233, 0.15);
}
.ne-proc-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 150ms ease;
}
.ne-proc-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Scrollable body */
.ne-proc-body {
    overflow-y: auto;
    padding: 20px 32px 28px;
    flex: 1;
}
.ne-proc-body::-webkit-scrollbar { width: 6px; }
.ne-proc-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.ne-proc-body::-webkit-scrollbar-track { background: transparent; }

/* Domain section */
.ne-proc-domain {
    margin-bottom: 24px;
}
.ne-proc-domain:last-child { margin-bottom: 0; }

.ne-proc-domain-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.ne-proc-domain-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--domain-accent) 12%, transparent);
    color: var(--domain-accent);
    flex-shrink: 0;
}
.ne-proc-domain-icon svg {
    width: 16px;
    height: 16px;
}
.ne-proc-domain-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ne-proc-domain-count {
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 10px;
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

/* Module cards grid */
.ne-proc-module-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

/* Module card */
.ne-proc-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-primary);
    padding: 14px 16px 12px;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}
.ne-proc-card:hover {
    border-color: var(--domain-accent, var(--accent));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--domain-accent, var(--accent)) 20%, transparent);
}

.ne-proc-card-top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}
.ne-proc-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ne-proc-card-icon svg {
    width: 18px;
    height: 18px;
}
/* Category colors (reuse dpmc-icon colors) */
.ne-proc-card-icon.processing     { background: rgba(43,124,233,0.12);  color: #2B7CE9; }
.ne-proc-card-icon.reconstruction { background: rgba(45,164,78,0.12);   color: #2DA44E; }
.ne-proc-card-icon.registration   { background: rgba(130,80,223,0.12);  color: #8250DF; }
.ne-proc-card-icon.implicit       { background: rgba(47,163,115,0.12);  color: #2FA373; }
.ne-proc-card-icon.features       { background: rgba(207,34,46,0.12);   color: #CF222E; }
.ne-proc-card-icon.conversion     { background: rgba(191,135,72,0.12);  color: #BF8748; }
.ne-proc-card-icon.segmentation   { background: rgba(210,153,34,0.12);  color: #D29922; }
.ne-proc-card-icon.stereo         { background: rgba(219,135,68,0.12);  color: #DB8744; }
.ne-proc-card-icon.lidar          { background: rgba(45,164,78,0.12);   color: #2DA44E; }
.ne-proc-card-icon.collision      { background: rgba(207,34,46,0.12);   color: #CF222E; }
.ne-proc-card-icon.medical        { background: rgba(88,166,255,0.12);  color: #58a6ff; }

.ne-proc-card-info {
    flex: 1;
    min-width: 0;
}
.ne-proc-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.ne-proc-card-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Method buttons */
.ne-proc-card-methods {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.ne-proc-method-btn {
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 150ms ease;
    white-space: nowrap;
}
.ne-proc-method-btn:hover {
    color: var(--domain-accent, var(--accent));
    border-color: var(--domain-accent, var(--accent));
    background: color-mix(in srgb, var(--domain-accent, var(--accent)) 8%, transparent);
}

/* --- Selected state for sample cards --- */
.ne-sample-card.ne-selected {
    border-color: var(--accent);
    background: rgba(43, 124, 233, 0.12);
    box-shadow: 0 0 0 1px var(--accent);
}

/* --- Sample Selection Modal --- */
.ne-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(2px);
}
.ne-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    min-width: 420px;
    max-width: 560px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}
.ne-modal.ne-modal-samples {
    max-width: 620px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}
.ne-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    text-align: center;
}
.ne-modal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
.ne-sample-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 200ms ease;
    text-align: center;
}
.ne-sample-card:hover {
    border-color: var(--accent);
    background: rgba(43, 124, 233, 0.08);
    transform: translateY(-1px);
}
.ne-sample-icon {
    font-size: 28px;
    line-height: 1;
}
.ne-sample-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}
.ne-sample-badge {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 2px 6px;
    border-radius: 8px;
}
.ne-sample-badge-mesh {
    background: rgba(130, 80, 223, 0.15);
    color: #8250DF;
}
.ne-sample-badge-pointcloud {
    background: rgba(43, 124, 233, 0.15);
    color: var(--accent);
}
.ne-sample-badge-volume {
    background: rgba(240, 81, 51, 0.15);
    color: #f05133;
}
.ne-sample-badge-structured_grid,
.ne-sample-badge-unstructured_grid {
    background: rgba(57, 211, 83, 0.15);
    color: #39d353;
}
.ne-sample-badge-format {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    font-size: 8px;
}
.ne-sample-badge-size {
    background: rgba(255, 170, 0, 0.2);
    color: #ffaa00;
    font-size: 8px;
}
.ne-sample-card.ne-sample-unavailable {
    opacity: 0.6;
    border-style: dashed;
}
.ne-sample-card.ne-sample-unavailable:hover {
    opacity: 0.85;
}
.ne-sample-download-btn {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 3px 6px;
    font-size: 9px;
    border: 1px solid rgba(255, 170, 0, 0.4);
    border-radius: 4px;
    background: rgba(255, 170, 0, 0.1);
    color: #ffaa00;
    cursor: pointer;
    transition: background 0.15s;
}
.ne-sample-download-btn:hover:not(:disabled) {
    background: rgba(255, 170, 0, 0.25);
}
.ne-sample-download-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}
/* --- Tab bar for Open3D / PyVista --- */
.ne-tab-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}
.ne-tab {
    flex: 1;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 200ms ease;
    text-align: center;
}
.ne-tab:hover {
    color: var(--text-primary);
}
.ne-tab.ne-tab-active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
/* Scrollable sample area */
.ne-modal-scroll {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    max-height: 55vh;
    margin-bottom: 12px;
    padding-right: 4px;
}
.ne-modal-scroll::-webkit-scrollbar {
    width: 6px;
}
.ne-modal-scroll::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}
.ne-modal-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.ne-tab-pane { }
.ne-modal-upload-btn {
    display: block;
    width: 100%;
    padding: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}
.ne-modal-upload-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(43, 124, 233, 0.06);
}

/* ==================================================================
   Object List Panel — per-object controls overlay (viewport top-right)
   ================================================================== */

.obj-panel {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 260px;
    max-height: calc(100% - 60px);
    background: rgba(22, 27, 34, 0.92);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    z-index: 20;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(8px);
    font-size: 12px;
    color: var(--text-primary);
}

.obj-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
}

.obj-panel-title {
    font-weight: 600;
    font-size: 12px;
}

.obj-panel-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    line-height: 1;
}

.obj-panel-body {
    overflow-y: auto;
    max-height: 400px;
}

.obj-row {
    border-bottom: 1px solid var(--border);
    padding: 6px 8px;
    transition: background var(--transition);
}

.obj-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.obj-row.selected {
    background: rgba(43, 124, 233, 0.08);
    border-left: 2px solid var(--accent);
    padding-left: 6px;
}

.obj-row-header {
    display: flex;
    align-items: center;
    gap: 6px;
}

.obj-vis-btn,
.obj-frame-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 3px;
    line-height: 1;
    border-radius: 3px;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.obj-vis-btn:active,
.obj-frame-btn:active {
    background: var(--bg-tertiary);
}

.obj-vis-btn:hover,
.obj-frame-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.obj-type-icon {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.obj-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
}

.obj-name:hover {
    color: var(--accent);
}

.obj-row-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-top: 4px;
}

.obj-ctrl {
    min-width: 0;
}

.obj-ctrl label {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.obj-ctrl input[type="color"] {
    width: 28px;
    height: 20px;
    border: 1px solid var(--border);
    border-radius: 3px;
    cursor: pointer;
    padding: 0;
    background: none;
}

.obj-ctrl input[type="range"] {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    background: var(--bg-tertiary);
    border-radius: 2px;
    outline: none;
}

.obj-ctrl input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}

.obj-ctrl select {
    width: 100%;
    font-size: 10px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 2px 4px;
    outline: none;
}

.obj-checkbox-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    margin-top: 2px;
}

.obj-checkbox-label input[type="checkbox"] {
    width: 12px;
    height: 12px;
    accent-color: var(--accent);
    cursor: pointer;
}

.obj-normals-btn {
    width: 100%;
    font-size: 9px;
    font-weight: 600;
    padding: 3px 6px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 3px;
    cursor: pointer;
    transition: all var(--transition);
    margin-top: 2px;
}

.obj-normals-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.obj-normals-btn.active {
    background: rgba(43, 124, 233, 0.15);
    color: var(--accent);
    border-color: var(--accent);
}

.obj-normals-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* ==================================================================
   Viewer Toolbar — camera + gizmo + export buttons (viewport top-left)
   ================================================================== */

.viewer-toolbar {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    gap: 2px;
    background: rgba(22, 27, 34, 0.88);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3px;
    z-index: 20;
    backdrop-filter: blur(8px);
}

.vt-btn {
    height: 30px;
    min-width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
    padding: 0 6px;
    white-space: nowrap;
    transition: all var(--transition);
    position: relative;
}

.vt-btn svg {
    flex-shrink: 0;
}

.vt-label {
    font-size: 10px;
}

.vt-tooltip {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: #0F1419;
    color: #E6EDF3;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 4px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 100;
}

.vt-btn:hover .vt-tooltip {
    opacity: 1;
}

.vt-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.vt-btn.active {
    background: rgba(43, 124, 233, 0.15);
    color: var(--accent);
    border-color: var(--accent);
}

.vt-separator {
    width: 1px;
    background: var(--border);
    margin: 4px 2px;
}



/* Workflow selector overlay scrollbar */
.workflow-selector-menu::-webkit-scrollbar {
    width: 8px;
}

.workflow-selector-menu::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
}

.workflow-selector-menu::-webkit-scrollbar-thumb {
    background: rgba(43, 124, 233, 0.5);
    border-radius: 4px;
}

.workflow-selector-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(43, 124, 233, 0.7);
}

/* =========================================
   AUTH — User button, menu, modal
   ========================================= */

.auth-user-btn {
    position: fixed;
    top: 16px;
    right: 20px;
    z-index: 500;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 200ms ease;
}
.auth-user-btn:hover {
    border-color: var(--accent);
    color: var(--text-primary);
    background: var(--bg-tertiary);
}
.auth-avatar {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.5px;
}

/* User dropdown menu */
.auth-user-menu {
    position: fixed;
    z-index: 10001;
    min-width: 220px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 0;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
}
.auth-menu-info {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.auth-menu-info strong {
    font-size: 14px;
    color: var(--text-primary);
}
.auth-menu-info span {
    font-size: 12px;
    color: var(--text-secondary);
}
.auth-menu-sep {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}
.auth-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 150ms ease;
}
.auth-menu-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}
.auth-menu-logout:hover {
    color: #cf222e;
}

/* Auth modal */
.auth-modal {
    min-width: 380px;
    max-width: 420px;
}
.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.auth-tab {
    flex: 1;
    padding: 10px 0;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 200ms ease;
}
.auth-tab:hover { color: var(--text-primary); }
.auth-tab-active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.auth-form-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.auth-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.auth-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.auth-input {
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 200ms ease;
}
.auth-input:focus {
    border-color: var(--accent);
}
.auth-error {
    color: #cf222e;
    font-size: 13px;
    min-height: 18px;
}
.auth-submit-btn {
    padding: 11px 0;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 200ms ease;
    margin-top: 4px;
}
.auth-submit-btn:hover:not(:disabled) {
    filter: brightness(1.1);
}
.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== LEFT PANEL SUB-TAB BAR ===== */
#left-tab-bar {
    display: flex;
    gap: 2px;
    padding: 6px 8px;
    background: var(--bg-primary, #0F1419);
    border-bottom: 1px solid var(--border-color, #30363D);
    flex-shrink: 0;
}
.left-tab-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted, #484F58);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.left-tab-btn:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary, #8B949E);
}
.left-tab-btn.active {
    background: rgba(43,124,233,0.12);
    color: var(--accent, #2B7CE9);
}
.left-tab-btn svg {
    flex-shrink: 0;
}

/* ===== IMAGE PROCESSING TAB ===== */
.imgproc-panel {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100%;
    overflow-y: auto;
}
.imgproc-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #E6EDF3);
}
.imgproc-header svg {
    color: var(--accent, #2B7CE9);
}

/* Upload slots */
.imgproc-uploads {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.imgproc-upload-slot {
    position: relative;
}
.imgproc-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px 10px;
    border: 2px dashed rgba(255,255,255,0.12);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    min-height: 100px;
}
.imgproc-drop span {
    font-size: 11px;
    color: var(--text-muted, #484F58);
}
.imgproc-drop:hover, .imgproc-drop.drag-over {
    border-color: var(--accent, #2B7CE9);
    background: rgba(43,124,233,0.06);
}
.imgproc-preview {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color, #30363D);
}
.imgproc-preview img {
    width: 100%;
    height: auto;
    max-height: 140px;
    object-fit: cover;
    display: block;
}
.imgproc-filename {
    padding: 4px 8px;
    font-size: 10px;
    color: var(--text-secondary, #8B949E);
    background: var(--bg-secondary, #161B22);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.imgproc-remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Method selector */
.imgproc-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary, #8B949E);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: block;
}
.imgproc-select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color, #30363D);
    background: var(--bg-secondary, #161B22);
    color: var(--text-primary, #E6EDF3);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
}
.imgproc-method-desc {
    font-size: 11px;
    color: var(--text-muted, #484F58);
    margin-top: 4px;
    min-height: 14px;
}

/* Params */
.imgproc-param-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.imgproc-param-row label {
    font-size: 12px;
    color: var(--text-secondary, #8B949E);
    min-width: 80px;
}
.imgproc-param-row input {
    flex: 1;
    padding: 5px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color, #30363D);
    background: var(--bg-secondary, #161B22);
    color: var(--text-primary, #E6EDF3);
    font-size: 12px;
    font-family: inherit;
}

/* Run button */
.imgproc-run-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, #2B7CE9, #1a5fb4);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.imgproc-run-btn:hover:not(:disabled) {
    filter: brightness(1.15);
}
.imgproc-run-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Status */
.imgproc-status {
    font-size: 11px;
    color: var(--text-muted, #484F58);
    min-height: 16px;
}

/* Result */
.imgproc-result {
    border-top: 1px solid var(--border-color, #30363D);
    padding-top: 12px;
}
.imgproc-result-img {
    width: 100%;
    border-radius: 6px;
    border: 1px solid var(--border-color, #30363D);
    margin-top: 6px;
}
.imgproc-zip-result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    background: var(--bg-secondary, #161B22);
    border-radius: 6px;
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-secondary, #8B949E);
}
.imgproc-result-info {
    margin-top: 8px;
    padding: 8px;
    background: var(--bg-secondary, #161B22);
    border-radius: 4px;
    font-size: 11px;
    font-family: var(--font-mono, monospace);
    color: var(--text-secondary, #8B949E);
    white-space: pre-wrap;
    max-height: 120px;
    overflow-y: auto;
}
.imgproc-download-btn {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 14px;
    border-radius: 4px;
    background: rgba(43,124,233,0.15);
    color: var(--accent, #2B7CE9);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s;
}
.imgproc-download-btn:hover {
    background: rgba(43,124,233,0.25);
}

/* Service selector bar */
.imgproc-service-bar {
    display: flex;
    gap: 4px;
    padding: 3px;
    background: var(--bg-secondary, #161B22);
    border-radius: 8px;
    border: 1px solid var(--border-color, #30363D);
}
.imgproc-service-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 10px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted, #484F58);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.imgproc-service-btn:hover {
    color: var(--text-secondary, #8B949E);
    background: rgba(255,255,255,0.04);
}
.imgproc-service-btn.active {
    color: var(--text-primary, #E6EDF3);
    background: var(--bg-tertiary, #1C2128);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Full-width upload slot for Trellis */
.imgproc-upload-full {
    grid-column: 1 / -1;
}

/* Trellis generate button accent */
.trellis-run-btn {
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
}

/* Spinning icon for loading */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.spin-icon {
    animation: spin 1s linear infinite;
}

/* Trellis result section */
.trellis-result {
    border-top: 1px solid var(--border-color, #30363D);
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Video container */
.trellis-video-container {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color, #30363D);
    background: #000;
}
.trellis-video-container video {
    width: 100%;
    display: block;
    max-height: 240px;
    object-fit: contain;
}

/* Trellis download buttons */
.trellis-downloads {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.trellis-dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 4px;
    background: rgba(124,58,237,0.15);
    color: #a78bfa;
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s;
}
.trellis-dl-btn:hover {
    background: rgba(124,58,237,0.25);
}

/* Trellis progress bar */
.trellis-progress {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    border-radius: 8px;
    background: var(--bg-tertiary, #1C2128);
    border: 1px solid var(--border-color, #30363D);
}
.trellis-progress[hidden] {
    display: none !important;
}
.trellis-progress-bar-track {
    height: 6px;
    border-radius: 3px;
    background: rgba(124,58,237,0.15);
    overflow: hidden;
}
.trellis-progress-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
    width: 0%;
    transition: width 0.5s ease;
}
.trellis-progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-secondary, #8B949E);
}
.trellis-progress-stage {
    display: flex;
    align-items: center;
    gap: 6px;
}
.trellis-progress-stage .spin-icon {
    width: 12px;
    height: 12px;
}
.trellis-progress-pct {
    font-variant-numeric: tabular-nums;
    color: #a78bfa;
    font-weight: 500;
}

.methods-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    color: var(--text-secondary);
    font-size: 13px;
}

/* Trellis activation popup */
.trellis-activation-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    backdrop-filter: blur(4px);
}
.trellis-activation-dialog {
    background: var(--bg-secondary, #161B22);
    border: 1px solid var(--border-color, #30363D);
    border-radius: 12px;
    padding: 32px;
    max-width: 380px;
    width: 90%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.trellis-activation-icon {
    color: #a78bfa;
    margin-bottom: 4px;
}
.trellis-activation-icon.activating {
    color: #60a5fa;
}
.trellis-activation-icon.error {
    color: #ef4444;
}
.trellis-activation-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #E6EDF3);
}
.trellis-activation-desc {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary, #8B949E);
    line-height: 1.5;
}
.trellis-activation-note {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted, #484F58);
    font-style: italic;
}
.trellis-activate-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.2s;
}
.trellis-activate-btn:hover {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}
.trellis-cancel-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary, #8B949E);
    font-size: 13px;
    cursor: pointer;
    padding: 6px 16px;
}
.trellis-cancel-btn:hover {
    color: var(--text-primary, #E6EDF3);
}
.trellis-activation-progress {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.trellis-activation-progress-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}
.trellis-activation-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
    border-radius: 3px;
    width: 0%;
    transition: width 0.5s ease;
}
.trellis-activation-progress-label {
    font-size: 12px;
    color: var(--text-secondary, #8B949E);
}
