/* Luci QIP Premium Design System */
:root {
    --bg-deep: #050709;
    --bg-card: rgba(15, 18, 25, 0.7);
    --accent: #f43f5e;
    --accent-glow: rgba(244, 63, 94, 0.2);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #475569;
    --border: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.12);
    --success: #10b981;
    --font-sans: 'Inter', system-ui, sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* --- Glass Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Custom for dark theme containers */
.glass-card::-webkit-scrollbar-thumb,
.manual-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.03);
}

.glass-card::-webkit-scrollbar-thumb:hover,
.manual-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.08);
}

body.qip-root {
    background-color: var(--bg-deep);
    color: var(--text-primary);
    font-family: var(--font-sans);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

.dashboard-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10;
}

/* --- Background Effects --- */
.bg-scanline {
    position: fixed;
    inset: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.2) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 1;
    opacity: 0.1;
}

.bg-glow-layer {
    position: fixed;
    top: -10%;
    right: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    filter: blur(80px);
    pointer-events: none;
    z-index: 1;
}

/* --- Top Navigation --- */
.top-nav {
    height: 80px;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 18, 25, 0.5);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-logo {
    width: 44px;
    height: 44px;
    background: var(--accent);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(45deg);
    box-shadow: 0 0 20px var(--accent-glow);
}

.logo-inner {
    transform: rotate(-45deg);
    font-weight: 800;
    font-size: 1.4rem;
    color: white;
    font-family: var(--font-heading);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.brand-name .accent {
    color: var(--accent);
}

.brand-subtitle {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--text-muted);
    font-weight: 600;
}

.nav-status {
    display: flex;
    align-items: center;
    gap: 24px;
}

.status-badge {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.75rem;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent);
    animation: pulse 2s infinite;
}

.status-label {
    color: var(--text-secondary);
}

.status-label .value {
    color: var(--accent);
    font-weight: 700;
    font-family: var(--font-mono);
}

.btn-primary {
    background: white;
    color: black;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.1);
}

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

.btn-secondary {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

/* --- Content Grid --- */
.content-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 24px;
    padding: 24px 40px;
    overflow: hidden;
}

/* --- Sidebar --- */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
    padding-right: 8px;
    padding-bottom: 80px;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

.card {
    border-radius: 20px;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.glass-card {
    backdrop-filter: blur(10px);
}

.card:hover {
    border-color: var(--accent-glow);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-header i {
    color: var(--accent);
    font-size: 0.9rem;
}

.card-header h2 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
}

.card-body {
    padding: 24px;
    position: relative;
}

/* Internal Scrollbars for long cards */
.global-coherence .card-body,
.reach-parameters .card-body {
    max-height: 250px;
    overflow-y: scroll !important; /* Force visibility of glass scrollbar */
    scrollbar-gutter: stable;
    padding-bottom: 120px !important; /* Extreme padding for bottom buttons */
}

.signature-actions {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 180px; /* Ensure space for 3 rows of buttons */
    padding-bottom: 20px;
}

.global-coherence .card-body::-webkit-scrollbar,
.reach-parameters .card-body::-webkit-scrollbar {
    width: 4px;
}

.global-coherence .card-body::-webkit-scrollbar-thumb,
.reach-parameters .card-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
}

.global-coherence .card-body::-webkit-scrollbar-thumb:hover,
.reach-parameters .card-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.1);
}

.param-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}

.param-item .label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.param-item .value {
    font-size: 0.85rem;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.param-item .value.highlight {
    color: var(--accent);
    font-weight: 700;
}

.param-item .value.success {
    color: var(--success);
}

.range-control {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.range-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.range-header label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    font-weight: 700;
}

.range-header span {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--accent-glow);
    transition: var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* --- Shard Biz --- */
.shard-viz {
    height: 140px;
    display: flex;
    align-items: flex-end;
    gap: 4px;
    padding: 0 10px;
}

.shard-bar {
    width: 6px;
    background: var(--primary);
    border-radius: 3px;
    transition: height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0.6;
    animation: pulse-height 2s ease-in-out infinite alternate;
}

@keyframes pulse-height {
    from { opacity: 0.3; filter: brightness(0.8); }
    to { opacity: 0.8; filter: brightness(1.2); }
}

.shard-bar:hover {
    opacity: 0.6;
}

.viz-footer {
    margin-top: 16px;
    text-align: center;
}

.viz-footer span {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-muted);
}

/* --- Health Bar --- */
.node-health {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.health-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 700;
}

.health-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.health-progress {
    height: 100%;
    background: var(--success);
    border-radius: 2px;
    box-shadow: 0 0 10px var(--success);
}

.health-value {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    text-align: right;
}

/* --- Visualizer Panel --- */
.visualizer-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.viz-container {
    flex: 1;
    background: #0a0c10;
    border: 1px solid var(--border);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

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

.badge-tag {
    padding: 4px 10px;
    background: var(--accent-glow);
    color: var(--accent);
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    border-radius: 4px;
    margin-right: 16px;
}

.breadcrumb {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    display: inline-block;
}

#node-count {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

.canvas-wrapper {
    flex: 1;
    position: relative;
    cursor: crosshair;
}

#mesh-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.viz-overlay {
    position: absolute;
    padding: 24px;
    pointer-events: none;
}

.top-left { top: 0; left: 0; }
.bottom-right { bottom: 0; right: 0; }

.protocol-status {
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.protocol-status .label {
    display: block;
    font-size: 8px;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 4px;
}

.protocol-status .value {
    font-family: var(--font-mono);
    font-size: 14px;
    letter-spacing: -0.02em;
}

.engine-quote {
    max-width: 240px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.engine-quote p {
    font-size: 11px;
    line-height: 1.6;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 8px;
}

.engine-quote .tag {
    font-family: var(--font-mono);
    font-size: 8px;
    font-weight: 800;
    color: var(--text-muted);
}

.viz-footer-strip {
    height: 50px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 32px;
}

.footer-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.footer-item i {
    color: var(--accent);
    font-size: 0.8rem;
}

.footer-divider {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 24px;
}

/* --- Energy Grid Specifics --- */
.energy-tag {
    background: rgba(0, 243, 255, 0.2);
    color: #00f3ff;
}

.energy-wrapper {
    background: radial-gradient(circle at center, rgba(0, 243, 255, 0.05) 0%, transparent 70%);
}

.energy-status .label {
    color: #00f3ff;
}

.energy-footer .footer-item i {
    color: #00f3ff;
}

.energy-container {
    border-color: rgba(0, 243, 255, 0.2);
}

/* --- App Footer --- */
.app-footer {
    height: 40px;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
}

.app-footer span {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--text-muted);
    font-weight: 600;
}

.security-lock {
    display: flex;
    align-items: center;
    gap: 8px;
}

.security-lock i {
    color: var(--accent);
}

/* --- Animations --- */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.6; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

.brand-logo {
    animation: float 4s ease-in-out infinite;
}

/* --- Identity Gate Overlay --- */
#identity-gate {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(2, 11, 18, 0.95);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

#identity-gate.active {
    opacity: 1;
    pointer-events: auto;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    border-radius: 32px;
    background: rgba(15, 18, 25, 0.8);
    border: 1px solid var(--border);
    box-shadow: 0 0 50px rgba(244, 63, 94, 0.1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.auth-logo {
    font-size: 48px;
    margin-bottom: 24px;
    color: var(--accent);
    filter: drop-shadow(0 0 10px var(--accent-glow));
    animation: auth-pulse 3s infinite;
}

@keyframes auth-pulse {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.auth-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 900;
    color: white;
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-muted);
    margin-bottom: 32px;
    font-weight: 700;
}

.mesh-input-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px 20px;
    margin-bottom: 24px;
    text-align: left;
    transition: var(--transition);
}

.mesh-input-box:focus-within {
    border-color: var(--accent);
}

.mesh-input-box.disabled {
    opacity: 0.3;
    pointer-events: none;
}

.mesh-input-box label {
    display: block;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.mesh-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 14px;
}

.mesh-select {
    width: 100%;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    outline: none;
    color: var(--text-primary);
    font-size: 11px;
    cursor: pointer;
    font-family: var(--font-mono);
}

.mesh-select option {
    background-color: var(--bg-deep);
    color: var(--text-primary);
}

.auth-btn {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    background: var(--accent-glow);
    border: 1px solid var(--accent);
    color: var(--accent);
    font-weight: 800;
    letter-spacing: 2px;
    cursor: pointer;
    transition: var(--transition);
}

.auth-btn:hover:not(.disabled) {
    background: var(--accent);
    color: white;
    box-shadow: 0 0 20px var(--accent-glow);
}

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

.buy-btn {
    padding: 4px 12px;
    background: var(--accent-glow);
    border: 1px solid var(--accent);
    border-radius: 8px;
    color: var(--accent);
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    transition: var(--transition);
}

.buy-btn:hover {
    background: var(--accent);
    color: white;
}

.switch-btn {
    display: block;
    margin: 16px auto 0;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: var(--transition);
}

.switch-btn:hover {
    color: var(--accent);
}

.auth-toast {
    margin-top: 24px;
    padding: 12px;
    background: var(--accent-glow);
    border: 1px solid var(--accent);
    border-radius: 12px;
    color: var(--accent);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: auth-pulse 2s infinite;
}

.auth-security-footer {
    margin-top: 24px;
    font-size: 8px;
    color: var(--text-muted);
    letter-spacing: 2px;
    font-weight: 600;
}

.hidden {
    display: none !important;
}

.preview-mode-btn {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--transition);
}

.preview-mode-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

.hidden-badge {
    display: none;
}

.preview-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--accent-glow);
    border: 1px solid var(--accent);
    color: var(--accent);
    font-size: 8px;
    font-weight: 900;
    text-transform: uppercase;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
    animation: auth-pulse 2s infinite;
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 900;
    color: white;
    line-height: 1;
}

/* --- Hardware Sync & Multiplier --- */
.hardware-sync {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(244, 63, 94, 0.05);
    border: 1px solid rgba(244, 63, 94, 0.2);
    border-radius: 20px;
    font-size: 9px;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: 1px;
    transition: var(--transition);
}

.hardware-sync.connected {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.hardwar.identity-pill.authenticated {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

/* Neural Sync Badge */
.neural-sync-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(0, 242, 255, 0.1);
    border: 1px solid rgba(0, 242, 255, 0.3);
    border-radius: 20px;
    color: #00f2ff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    animation: neural-pulse 2s infinite;
}

@keyframes neural-pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 242, 255, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(0, 242, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 242, 255, 0); }
}

.signature-box {
    margin-top: 6px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: rgba(0, 242, 255, 0.8);
    word-break: break-all;
    max-height: 60px;
    overflow-y: auto;
}

.signature-box::-webkit-scrollbar {
    width: 4px;
}
.signature-box::-webkit-scrollbar-thumb {
    background: rgba(0, 242, 255, 0.2);
    border-radius: 2px;
}

.multiplier-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 171, 0, 0.05);
    border: 1px solid rgba(255, 171, 0, 0.2);
    border-radius: 20px;
    font-size: 9px;
    font-weight: 800;
    color: #ffab00;
    letter-spacing: 1px;
}

.multiplier-pill i {
    animation: auth-pulse 2s infinite;
}

.btn-primary {
    cursor: pointer;
    border: none;
    outline: none;
    transition: var(--transition);
}

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

.brand-title span {
    display: none;
}

.brand-title .preview-badge {
    display: inline-block;
}

/* --- High-Speed BIDC Toggle --- */
.high-speed-toggle {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.switch-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.switch-label i {
    color: #ffab00;
}

.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-toggle {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 34px;
}

.slider-toggle:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider-toggle {
    background-color: #ffab00;
}

input:checked + .slider-toggle:before {
    transform: translateX(16px);
}

.high-speed-active .packet-boost {
    filter: drop-shadow(0 0 5px #ffab00);
}

.high-speed-active #mesh-canvas {
    filter: contrast(1.1) brightness(1.1);
}

.oriki-deep-row {
    margin-top: 12px;
    padding-top: 12px;
}

.oriki-slider:before {
    background-color: #00f2ff;
}

input:checked + .oriki-slider {
    background-color: rgba(0, 242, 255, 0.3);
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.2);
}

input:checked + .oriki-slider:before {
    background-color: #00f2ff;
}

.switch-label i.fa-atom {
    color: #00f2ff;
    animation: rotate 4s linear infinite;
}

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

.oriki-active .packet-boost {
    filter: drop-shadow(0 0 8px #00f2ff) hue-rotate(180deg);
}

.oriki-active #mesh-canvas {
    filter: contrast(1.2) brightness(1.2) saturate(1.2);
}

/* --- Academic Index --- */
.academic-index {
    max-height: 250px;
    overflow-y: auto;
}

.paper-item {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.2s ease;
}

.paper-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.paper-item:last-child {
    border-bottom: none;
}

.paper-title {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 4px;
}

.paper-doi {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: var(--primary);
    opacity: 0.7;
}

/* Global Coherence & ISP Metrics */
.global-coherence .stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
}

.coherence-meter {
    margin-top: 12px;
}

.meter-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.meter-fill {
    height: 100%;
    background: linear-gradient(90deg, #f43f5e, #fb7185);
    box-shadow: 0 0 10px rgba(244, 63, 94, 0.5);
    transition: width 0.5s ease;
}

.oriki-slider { background: linear-gradient(90deg, #8b5cf6, #d946ef); }
.pro-slider { background: linear-gradient(90deg, #0ea5e9, #22c55e); }
.q-slider { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.anyon-slider { background: linear-gradient(90deg, #ec4899, #8b5cf6); }
.latent-slider { background: linear-gradient(90deg, #22c55e, #10b981); }
.sentience-slider { background: linear-gradient(90deg, #3b82f6, #06b6d4); }

.quaternary-glow {
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.8)) !important;
    stroke: #fbbf24 !important;
}

.anyonic-glow {
    filter: drop-shadow(0 0 12px rgba(236, 72, 153, 0.9)) !important;
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.4) inset !important;
}

.latent-pulse {
    animation: latent-breath 2s infinite ease-in-out;
}

@keyframes latent-breath {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.sentient-path-active {
    stroke: #06b6d4 !important;
    stroke-width: 3px !important;
    filter: drop-shadow(0 0 10px rgba(6, 182, 212, 0.8));
    animation: sentient-pulse 1.5s infinite;
}

@keyframes sentient-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.meter-label {
    font-size: 10px;
    opacity: 0.6;
    text-transform: uppercase;
}
/* --- Modal Manual --- */
.manual-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.manual-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.manual-container {
    width: 100%;
    max-width: 900px;
    max-height: 80vh;
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow-y: auto;
    padding: 60px;
    position: relative;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
}

.manual-content {
    font-family: 'Inter', sans-serif;
    color: var(--text-light);
    line-height: 1.6;
}

.manual-content h1 { font-family: 'Outfit', sans-serif; color: white; margin-bottom: 24px; }
.manual-content h2 { font-family: 'Outfit', sans-serif; color: white; margin-top: 40px; margin-bottom: 16px; font-size: 1.5rem; }
.manual-content p { margin-bottom: 16px; opacity: 0.8; }
.manual-content hr { border: none; border-top: 1px solid rgba(255, 255, 255, 0.1); margin: 32px 0; }
.manual-content table { width: 100%; border-collapse: collapse; margin: 24px 0; }
.manual-content th { text-align: left; padding: 12px; border-bottom: 2px solid rgba(255, 255, 255, 0.1); color: var(--primary); font-size: 12px; text-transform: uppercase; }
.manual-content td { padding: 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); font-size: 13px; }

.btn-close-manual {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.btn-close-manual:hover { opacity: 1; }

/* --- Quantum Drive & Tab System --- */
.main-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 600px;
}

.tab-header {
    display: flex;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tab-btn {
    padding: 10px 24px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-dim);
    font-size: 14px;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.tab-btn i { font-size: 14px; opacity: 0.7; }

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.tab-btn.active {
    background: var(--primary);
    color: var(--bg-dark);
    border-color: var(--primary);
    font-weight: 600;
    box-shadow: 0 0 20px rgba(255, 171, 0, 0.2);
}

.tab-btn.active i { opacity: 1; }

.tab-content {
    display: none;
    flex: 1;
    position: relative;
    overflow: hidden;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    animation: tab-fade-in 0.4s ease-out;
}


@keyframes tab-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Drive Explorer Styles */
.drive-container {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    height: 100%;
    overflow-y: auto;
}

.drive-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    padding: 24px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
}

.drive-header::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 171, 0, 0.03));
    pointer-events: none;
}

.storage-info {
    flex: 1;
}

.storage-label {
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--primary);
    letter-spacing: 2px;
    font-weight: 700;
}

.storage-meta h2 {
    font-size: 28px;
    font-family: 'Outfit', sans-serif;
    margin: 6px 0 16px 0;
    letter-spacing: -0.5px;
}

.storage-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 500px;
}

.storage-bar {
    flex: 1;
    height: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.storage-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #10b981);
    box-shadow: 0 0 20px rgba(255, 171, 0, 0.4);
    transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.drive-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sync-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    animation: pulse-sync 3s infinite ease-in-out;
}

@keyframes pulse-sync {
    0%, 100% { opacity: 0.8; box-shadow: 0 0 5px rgba(16, 185, 129, 0.2); }
    50% { opacity: 1; box-shadow: 0 0 15px rgba(16, 185, 129, 0.4); }
}

.drive-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
}

.drive-breadcrumbs i {
    font-size: 14px;
    color: var(--primary);
}

.breadcrumb-item {
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 2px 4px;
    border-radius: 4px;
}

.breadcrumb-item:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.breadcrumb-item:not(:last-child)::after {
    content: "›";
    margin-left: 12px;
    opacity: 0.3;
}

.drive-breadcrumbs .breadcrumb-item {
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--accent-primary);
    transition: all 0.2s ease;
}

.drive-breadcrumbs .breadcrumb-item:hover {
    color: #fff;
    text-shadow: 0 0 10px var(--accent-primary);
}

.drive-item.folder-type {
    cursor: pointer;
}

.drive-item.folder-type:hover .shard-name {
    color: var(--primary);
    text-decoration: underline;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 10px 20px;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.shard-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.shard-stat-card {
    background: rgba(20, 20, 20, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.shard-stat-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.shard-stat-card.moth .stat-icon { background: rgba(168, 85, 247, 0.15); color: #a855f7; box-shadow: 0 0 20px rgba(168, 85, 247, 0.1); }
.shard-stat-card.queen .stat-icon { background: rgba(236, 72, 153, 0.15); color: #ec4899; box-shadow: 0 0 20px rgba(236, 72, 153, 0.1); }
.shard-stat-card.mother .stat-icon { background: rgba(244, 63, 94, 0.15); color: #f43f5e; box-shadow: 0 0 20px rgba(244, 63, 94, 0.1); }
.shard-stat-card.empress .stat-icon { background: rgba(16, 185, 129, 0.15); color: #10b981; box-shadow: 0 0 20px rgba(16, 185, 129, 0.1); }

.stat-info .label { font-size: 11px; opacity: 0.5; display: block; margin-bottom: 2px; font-weight: 500; }
.stat-info .value { font-size: 20px; font-weight: 700; font-family: 'Outfit', sans-serif; }

.file-explorer {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 400px;
    border-radius: 20px;
    overflow: hidden;
}

.explorer-header {
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1.5px;
    font-weight: 600;
}

.explorer-refresh { cursor: pointer; transition: all 0.3s; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255,255,255,0.05); }
.explorer-refresh:hover { color: var(--primary); background: rgba(255, 171, 0, 0.1); }

.file-list {
    flex: 1;
    overflow-y: auto;
}

.empty-drive {
    height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0.3;
}

.empty-drive i { font-size: 56px; margin-bottom: 20px; color: var(--primary); }
.empty-drive p { font-family: 'Inter', sans-serif; font-size: 15px; }

.drive-item {
    display: grid;
    grid-template-columns: 1fr 140px 140px 80px;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.2s ease;
}

.drive-item:hover { background: rgba(255, 255, 255, 0.03); }

.file-name-cell {
    display: flex;
    align-items: center;
    gap: 16px;
}

.file-name-cell i { color: var(--primary); font-size: 18px; opacity: 0.7; }

.name-box {
    display: flex;
    flex-direction: column;
}

.shard-name {
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
}

.shard-path {
    font-size: 9px;
    opacity: 0.3;
    font-family: 'JetBrains Mono', monospace;
    margin-top: 2px;
}

.level-badge {
    font-size: 10px;
    padding: 4px 12px;
    border-radius: 6px;
    text-transform: uppercase;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    text-align: center;
}

.level-badge.moth { background: rgba(168, 85, 247, 0.2); color: #a855f7; border: 1px solid rgba(168, 85, 247, 0.3); }
.level-badge.queen { background: rgba(236, 72, 153, 0.2); color: #ec4899; border: 1px solid rgba(236, 72, 153, 0.3); }
.level-badge.mother { background: rgba(244, 63, 94, 0.2); color: #f43f5e; border: 1px solid rgba(244, 63, 94, 0.3); }
.level-badge.empress { background: rgba(16, 185, 129, 0.2); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }

.size-cell { 
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: 'JetBrains Mono', monospace; 
    margin-right: 20px;
}

.original-size {
    font-size: 10px;
    opacity: 0.3;
    text-decoration: line-through;
}

.folded-size {
    font-size: 12px;
    font-weight: 600;
    color: #10b981;
}

.action-cell { 
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.action-cell i {
    cursor: pointer; 
    opacity: 0.3; 
    transition: all 0.2s; 
    width: 28px; height: 28px; 
    display: flex; align-items: center; justify-content: center; 
    border-radius: 8px;
}

.action-cell i:hover { opacity: 1; background: rgba(255, 255, 255, 0.05); }
.download-btn:hover { color: #3b82f6; }
.delete-btn:hover { color: #ef4444; background: rgba(244, 63, 94, 0.1) !important; }

/* Folding Animation Overlay */
#folding-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 20px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#folding-overlay.active {
    opacity: 1;
    pointer-events: all;
}

@keyframes folding-pulse {
    0% { transform: scale(0.8) rotate(0deg); opacity: 0.5; filter: hue-rotate(0deg); }
    50% { transform: scale(1.1) rotate(180deg); opacity: 1; border-color: #10b981; filter: hue-rotate(90deg); box-shadow: 0 0 30px rgba(16, 185, 129, 0.4); }
    100% { transform: scale(0.9) rotate(360deg); opacity: 0.7; filter: hue-rotate(0deg); }
}

.folding-hex {
    width: 80px;
    height: 80px;
    border: 4px solid var(--primary);
    border-radius: 20px;
    animation: folding-pulse 2s infinite ease-in-out;
    position: relative;
}

.folding-hex::after {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 40px; height: 40px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.8) 0%, transparent 70%);
    border-radius: 50%;
    animation: quantum-pulse 1s infinite alternate ease-in-out;
}

@keyframes quantum-pulse {
    from { transform: translate(-50%, -50%) scale(0.5); opacity: 0.2; }
    to { transform: translate(-50%, -50%) scale(2); opacity: 0.8; }
}

.folding-text {
    margin-top: 32px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 4px;
    color: white;
    text-transform: uppercase;
}

.folding-sub {
    margin-top: 8px;
    font-size: 11px;
    opacity: 0.5;
    letter-spacing: 1px;
}

/* --- Phase 13/14: Quantum Signature & BIDC Assistant --- */
.signature-box {
    word-break: break-all;
    max-height: 60px;
    overflow-y: auto;
    font-size: 10px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    margin-top: 8px;
    font-family: var(--font-mono);
    color: var(--accent);
    line-height: 1.4;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.signature-actions {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.signature-btns-row {
    display: flex;
    gap: 8px;
}

.btn-mini {
    flex: 1;
    font-size: 11px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    text-transform: uppercase;
    font-weight: 800;
}

.btn-mini:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    transform: scale(1.02);
}

.btn-offload {
    background: rgba(34, 197, 94, 0.15);
    border: 1.5px solid #22c55e;
    color: #22c55e;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.3);
    animation: btn-glow-green 2s infinite alternate;
}

@keyframes btn-glow-green {
    from { box-shadow: 0 0 5px rgba(34, 197, 94, 0.2); }
    to { box-shadow: 0 0 20px rgba(34, 197, 94, 0.6); }
}

.btn-resonate {
    background: rgba(14, 165, 233, 0.15);
    border: 1.5px solid #0ea5e9;
    color: #0ea5e9;
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.3);
    animation: btn-glow-blue 2s infinite alternate;
}

@keyframes btn-glow-blue {
    from { box-shadow: 0 0 5px rgba(14, 165, 233, 0.2); }
    to { box-shadow: 0 0 20px rgba(14, 165, 233, 0.6); }
}

.btn-rr-test {
    background: rgba(168, 85, 247, 0.15);
    border: 1.5px solid #a855f7;
    color: #a855f7 !important;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
    animation: btn-glow-purple 2s infinite alternate;
    margin-top: 8px;
}

@keyframes btn-glow-purple {
    from { box-shadow: 0 0 5px rgba(168, 85, 247, 0.2); }
    to { box-shadow: 0 0 20px rgba(168, 85, 247, 0.6); }
}

.btn-resonate:hover {
    background: rgba(14, 165, 233, 0.25);
    border-color: rgba(14, 165, 233, 0.4);
}

/* --- End of Styles --- */

/* --- Phase 15: Mobile Resiliency & Responsive UI Calibration --- */
@media (max-width: 1200px) {
    .content-grid {
        grid-template-columns: 350px 1fr;
        padding: 24px 20px;
    }
}

@media (max-width: 1024px) {
    body.qip-root {
        overflow-y: auto;
        height: auto;
        min-height: 100vh;
    }
    .dashboard-container {
        height: auto;
        min-height: 100vh;
    }
    .content-grid {
        display: flex;
        flex-direction: column;
        height: auto;
        overflow: visible;
        padding-bottom: 60px;
    }
    .sidebar {
        width: 100%;
        height: auto;
        overflow: visible;
        padding-right: 0;
        padding-bottom: 0;
    }
    .main-panel {
        width: 100%;
        height: 600px;
    }
    .reach-parameters .card-body,
    .global-coherence .card-body {
        max-height: none;
        overflow: visible !important;
        padding-bottom: 40px !important;
    }
    .hidden-tablet { display: none !important; }
}

@media (max-width: 768px) {
    .top-nav {
        height: auto;
        padding: 20px;
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    .nav-brand {
        flex-direction: column;
        gap: 10px;
    }
    .nav-status {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }
    .status-badge {
        width: 100%;
        justify-content: center;
    }
    .hidden-mobile { display: none !important; }
}

@media (max-width: 480px) {
    .brand-title { font-size: 1.25rem; }
    .brand-subtitle { font-size: 8px; }
    .content-grid { padding: 15px; }
    .card-header { padding: 15px 20px; }
    .card-body { padding: 15px 20px; }
    .main-panel { height: 500px; }
    .tab-header { gap: 10px; }
    .tab-btn { font-size: 11px; padding: 8px 12px; }
    
    .shard-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .auth-card {
        padding: 30px 20px;
        border-radius: 24px;
        width: 90%;
    }
    
    .manual-container {
        width: 95%;
        height: 90%;
        padding: 20px;
    }

    /* Touch Optimizations */
    button, .tab-btn, .auth-btn, .btn-mini {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .mesh-input {
        font-size: 16px !important; /* Prevents auto-zoom on mobile browsers */
    }
    
    .signature-actions {
        min-height: auto;
        gap: 15px;
    }
    
    .signature-btns-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-mini {
        width: 100%;
    }

    /* Range Slider Touch Scaling */
    input[type="range"]::-webkit-slider-thumb {
        width: 28px;
        height: 28px;
    }

    /* Breadcrumb Horizontal Scroll */
    .drive-breadcrumbs {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 10px;
        scrollbar-width: none;
    }
    .drive-breadcrumbs::-webkit-scrollbar {
        display: none;
    }
}
/* --- Mobile Services (MVNO) --- */
.mobile-container {
    padding: 32px;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    padding: 24px 32px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.subscriber-meta .subscriber-label {
    font-size: 10px;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: 2px;
}

.subscriber-meta h2 {
    font-size: 1.5rem;
    font-family: var(--font-heading);
    margin-top: 4px;
}

.data-usage-wrapper {
    margin-top: 12px;
    width: 300px;
}

.usage-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.usage-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #ff7e5f);
    box-shadow: 0 0 15px var(--accent-glow);
    transition: width 1s ease;
}

.usage-percent {
    font-size: 11px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.mobile-actions {
    display: flex;
    gap: 16px;
}

.mobile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.plan-card .card-body {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.plan-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.plan-item {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
}

.plan-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
}

.plan-item.active {
    background: var(--accent-glow);
    border-color: var(--accent);
}

.plan-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.plan-name {
    font-weight: 700;
    font-size: 0.95rem;
}

.plan-desc {
    font-size: 11px;
    color: var(--text-muted);
}

.plan-price {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--accent);
}

.esim-display {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    text-align: center;
}

.esim-empty {
    color: var(--text-muted);
}

.esim-empty i {
    font-size: 3rem;
    margin-bottom: 20px;
    opacity: 0.2;
}

.esim-empty p {
    font-weight: 600;
    margin-bottom: 8px;
}

.esim-empty .subtext {
    font-size: 12px;
    opacity: 0.6;
}

.esim-details {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.qr-placeholder {
    padding: 16px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.qr-box {
    width: 120px;
    height: 120px;
    background: #eee;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-dots {
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(black 20%, transparent 20%),
        radial-gradient(black 20%, transparent 20%);
    background-position: 0 0, 5px 5px;
    background-size: 10px 10px;
    opacity: 0.8;
}

.qr-lock {
    position: absolute;
    font-size: 32px;
    color: var(--accent);
    background: white;
    padding: 8px;
    border-radius: 50%;
}

.sim-metadata {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.meta-row .label {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-muted);
}

.meta-row .value {
    font-size: 11px;
    font-family: var(--font-mono);
}

.privacy-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.p-stat {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.p-stat .label {
    font-size: 9px;
    font-weight: 800;
    color: var(--text-muted);
}

.p-stat .value {
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-mono);
}

.privacy-message {
    padding: 16px;
    background: rgba(244, 63, 94, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(244, 63, 94, 0.1);
}

.privacy-message p {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Animations */
@keyframes rotate-pulse {
    0% { filter: hue-rotate(0deg) brightness(1); }
    50% { filter: hue-rotate(90deg) brightness(1.5); }
    100% { filter: hue-rotate(0deg) brightness(1); }
}

.rotating-identity {
    animation: rotate-pulse 2s infinite;
}

.full-width { width: 100%; }
/* --- Rocksolid Toast System --- */
.toast-container {
    position: fixed;
    bottom: 32px;
    right: 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    min-width: 300px;
    padding: 16px 20px;
    background: rgba(15, 18, 25, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: white;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    transform: translateX(120%);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.active {
    transform: translateX(0);
}

.toast-icon {
    font-size: 1.2rem;
    color: var(--accent);
}

.toast-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toast-label {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
}

.toast-message {
    font-size: 13px;
    font-weight: 500;
}

/* Toast Variants */
.toast.success { border-left: 4px solid var(--success); }
.toast.success .toast-icon { color: var(--success); }
.toast.error { border-left: 4px solid var(--accent); }
.toast.error .toast-icon { color: var(--accent); }
.toast.system { border-left: 4px solid #3b82f6; }
.toast.system .toast-icon { color: #3b82f6; }

/* --- Hardware Handshake --- */
.handshake-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(2, 11, 18, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.handshake-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.handshake-card {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    text-align: center;
}

.handshake-icon {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 24px;
    animation: auth-pulse 2s infinite;
}

.handshake-progress-wrapper {
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    margin: 24px 0;
    overflow: hidden;
}

.handshake-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
    transition: width 0.3s ease;
}

.handshake-status {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

/* --- VoIP Interface --- */
.voip-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 32px;
}

.voip-dialer {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 24px;
}

.dialer-screen {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    text-align: right;
}

#dialer-input {
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    font-family: var(--font-mono);
    width: 100%;
    text-align: right;
    outline: none;
}

.dialer-status {
    font-size: 8px;
    color: var(--success);
    font-weight: 800;
    margin-top: 4px;
    letter-spacing: 1px;
}

.dialer-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.key {
    aspect-ratio: 1;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: white;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.key:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
    transform: scale(1.05);
}

.key.call {
    background: var(--success);
    border-color: transparent;
}

.key.secondary {
    background: rgba(255, 255, 255, 0.02);
    font-size: 14px;
}

/* --- Call Overlay --- */
.call-overlay {
    position: fixed;
    inset: 0;
    z-index: 4000;
    background: rgba(2, 11, 18, 0.95);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.call-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.call-card {
    text-align: center;
    width: 100%;
    max-width: 400px;
}

.call-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--accent), var(--accent-glow));
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    box-shadow: 0 0 50px var(--accent-glow);
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% { transform: scale(1); box-shadow: 0 0 50px var(--accent-glow); }
    50% { transform: scale(1.05); box-shadow: 0 0 80px var(--accent-glow); }
    100% { transform: scale(1); box-shadow: 0 0 50px var(--accent-glow); }
}

.call-identity h2 { font-size: 32px; margin-bottom: 8px; font-weight: 800; color: white; }
.call-identity p { font-size: 12px; color: var(--accent); letter-spacing: 2px; font-weight: 800; }

.call-waveform {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 40px 0;
}

.wave {
    width: 4px;
    height: 10px;
    background: var(--accent);
    border-radius: 2px;
    animation: wave-bounce 1s infinite alternate;
}

.wave:nth-child(2) { animation-delay: 0.1s; }
.wave:nth-child(3) { animation-delay: 0.2s; }
.wave:nth-child(4) { animation-delay: 0.1s; }
.wave:nth-child(5) { animation-delay: 0.3s; }

@keyframes wave-bounce {
    from { height: 10px; }
    to { height: 40px; }
}

.call-actions {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 40px;
}

.call-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.call-btn.end {
    background: #ef4444;
    border-color: transparent;
}

.call-btn:hover { transform: scale(1.1); }

.call-encryption {
    font-size: 10px;
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 1px;
    font-weight: 800;
}

.voip-history {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 24px;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.history-count {
    background: var(--accent);
    color: black;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 800;
}

.empty-history {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* --- Quantum Messaging --- */
.messages-container {
    height: 700px;
    padding: 0 !important;
    overflow: hidden;
}

.messages-layout {
    display: grid;
    grid-template-columns: 310px 1fr;
    height: 100%;
}

.messages-sidebar {
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.02);
}

.sidebar-header {
    padding: 20px;
    display: flex;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

#contact-search {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 16px;
    color: white;
    font-size: 13px;
    flex: 1;
    outline: none;
}

#contact-search:focus {
    border-color: var(--accent);
}

.conversation-list {
    flex: 1;
    overflow-y: auto;
}

.conv-item {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.conv-item.active {
    background: rgba(43, 145, 255, 0.1);
    border-left: 3px solid var(--accent);
}

.conv-target {
    font-weight: 700;
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
}

.conv-preview {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.messages-main {
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.1);
}

.chat-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-align: center;
}

.chat-empty-state i {
    font-size: 4rem;
    margin-bottom: 24px;
    opacity: 0.1;
}

.chat-active-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.secure-tag {
    font-size: 9px;
    color: var(--success);
    font-weight: 800;
    letter-spacing: 1px;
}

.message-thread {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.msg-bubble {
    max-width: 70%;
    padding: 12px 18px;
    border-radius: 20px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    animation: msg-slide 0.3s ease-out;
}

@keyframes msg-slide {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.msg-bubble.sent {
    align-self: flex-end;
    background: var(--accent);
    color: black;
    border-bottom-right-radius: 4px;
}

.msg-bubble.received {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border);
}

.msg-meta {
    font-size: 9px;
    margin-top: 4px;
    opacity: 0.5;
    display: flex;
    justify-content: flex-end;
    gap: 4px;
}

.chat-input-area {
    padding: 20px;
    display: flex;
    gap: 12px;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

#message-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 10px 20px;
    color: white;
    outline: none;
}

#message-input:focus {
    border-color: var(--accent);
}

.typing-indicator {
    padding: 8px 24px;
    display: flex;
    gap: 4px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

@keyframes statusPulse {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}

.pulse { animation: statusPulse 2s infinite ease-in-out; }
.pulse-fast { animation: statusPulse 0.5s infinite ease-in-out; }

.active-call-pill {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 255, 0, 0.2);
    color: #4ade80;
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid rgba(74, 222, 128, 0.4);
    font-size: 12px;
    font-weight: 700;
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(0, 255, 0, 0.1);
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
    from { transform: translate(-50%, -100%); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
    transform: scale(1.05);
}

/* Network Badges */
.conv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.network-badge {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.badge-quantum {
    background: rgba(0, 255, 255, 0.15);
    color: #00ffff;
    border: 1px solid rgba(0, 255, 255, 0.3);
}

.badge-legacy {
    background: rgba(255, 165, 0, 0.15);
    color: #ffa500;
    border: 1px solid rgba(255, 165, 0, 0.3);
}

/* ══════════════════════════════════════════════════════════════════════════════
   VIDEO CALL OVERLAY — Luci QIP v2.2
   ══════════════════════════════════════════════════════════════════════════════ */

.video-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: #0a0a0f;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.3s ease;
}

.video-overlay.hidden {
    display: none;
}

.video-overlay.active {
    display: flex;
}

/* Video panels — remote fills screen, local is PiP */
.video-panels {
    position: relative;
    flex: 1;
    background: #000;
    overflow: hidden;
}

.remote-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #000;
}

.local-video {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: clamp(100px, 22vw, 200px);
    height: clamp(75px, 16vw, 150px);
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid rgba(0, 255, 200, 0.4);
    background: #111;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.7);
    z-index: 10;
}

/* HUD overlaid on the video area */
.vc-hud {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 100%);
    padding: 24px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.vc-target-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vc-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 255, 200, 0.15);
    border: 1px solid rgba(0, 255, 200, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #00ffc8;
    flex-shrink: 0;
}

.vc-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.vc-meta span:first-child {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.5px;
}

.vc-enc {
    font-size: 10px !important;
    color: rgba(0, 255, 200, 0.7) !important;
    letter-spacing: 0.8px;
    font-weight: 400 !important;
}

.vc-timer {
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px;
    color: #00ffc8;
    letter-spacing: 1px;
    flex-shrink: 0;
}

/* Control buttons row */
.vc-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.vc-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s, transform 0.1s;
    backdrop-filter: blur(4px);
}

.vc-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(0, 255, 200, 0.5);
    transform: scale(1.08);
}

.vc-btn:active {
    transform: scale(0.95);
}

.vc-btn.vc-end {
    background: rgba(239, 68, 68, 0.8);
    border-color: rgba(239, 68, 68, 0.9);
    width: 60px;
    height: 60px;
    font-size: 20px;
}

.vc-btn.vc-end:hover {
    background: rgba(239, 68, 68, 1);
    border-color: #ef4444;
}

.vc-btn.vc-btn-active {
    background: rgba(0, 255, 200, 0.2);
    border-color: rgba(0, 255, 200, 0.6);
    color: #00ffc8;
}

/* State label (CONNECTING..., SCREEN SHARE, etc.) */
.vc-state-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: rgba(0, 255, 200, 0.9);
    letter-spacing: 2px;
    text-align: center;
    pointer-events: none;
    text-shadow: 0 0 16px rgba(0, 255, 200, 0.5);
    z-index: 5;
}

/* ── Call overlay timer ─────────────────────────────────────────────────────── */
.call-timer {
    font-family: 'JetBrains Mono', monospace;
    font-size: 18px;
    font-weight: 700;
    color: #00ffc8;
    letter-spacing: 2px;
    text-align: center;
    margin: 4px 0 12px;
    text-shadow: 0 0 10px rgba(0, 255, 200, 0.4);
}

/* ── Call history items ──────────────────────────────────────────────────────── */
.history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 6px;
    font-size: 12px;
    color: #c0c0d0;
    transition: background 0.15s;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.07);
}

.history-item .fas {
    width: 20px;
    text-align: center;
    font-size: 13px;
}

.history-item.call-ok .fas { color: #22c55e; }
.history-item.call-missed .fas { color: #ef4444; }
.history-item.call-declined .fas { color: #f97316; }

.hi-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hi-target {
    font-weight: 600;
    color: #e0e0f0;
    font-size: 12px;
}

.hi-dur {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    font-family: 'JetBrains Mono', monospace;
}

.hi-time {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.35);
    font-family: 'JetBrains Mono', monospace;
    flex-shrink: 0;
}

/* ── SMS Attachment styles ───────────────────────────────────────────────────── */
.msg-has-attachment {
    padding: 6px !important;
    flex-direction: column;
    gap: 4px;
}

.msg-attachment-img {
    max-width: 220px;
    max-height: 180px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.msg-fname {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    font-family: 'JetBrains Mono', monospace;
    word-break: break-all;
}

/* ── Mobile: video call button in chat header ────────────────────────────────── */
#btn-chat-video {
    color: #00ffc8;
    border-color: rgba(0, 255, 200, 0.3);
}

#btn-chat-video:hover {
    background: rgba(0, 255, 200, 0.1);
}

/* ── Responsive tweaks for small screens ────────────────────────────────────── */
@media (max-width: 480px) {
    .vc-controls {
        gap: 10px;
    }
    .vc-btn {
        width: 46px;
        height: 46px;
        font-size: 16px;
    }
    .vc-btn.vc-end {
        width: 54px;
        height: 54px;
        font-size: 18px;
    }
    .local-video {
        width: 90px;
        height: 68px;
        bottom: 8px;
        right: 8px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   QELOCITY BROWSER — HTTQ Proxy Browser Interface
   ═══════════════════════════════════════════════════════════════════════ */

.qelocity-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* ── Toolbar ── */
.qelocity-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.qelocity-address-bar {
    flex: 1;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.qelocity-address-bar:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.15);
}

.qelocity-protocol-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: rgba(34, 197, 94, 0.1);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    color: #22c55e;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    white-space: nowrap;
    user-select: none;
}

.qelocity-protocol-badge i {
    font-size: 12px;
}

.qelocity-url-input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-family: var(--font-mono);
    font-size: 13px;
    padding: 10px 16px;
    outline: none;
    min-width: 0;
}

.qelocity-url-input::placeholder {
    color: rgba(255, 255, 255, 0.2);
    font-family: var(--font-body);
    font-size: 12px;
}

.qelocity-go-btn {
    padding: 10px 18px;
    background: var(--primary);
    border: none;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qelocity-go-btn:hover {
    background: #0284c7;
}

.qelocity-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.qelocity-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
}

.qelocity-nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.qelocity-nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.qelocity-status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
}

.qelocity-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.qelocity-status-dot.idle {
    background: var(--text-muted);
}

.qelocity-status-dot.connecting {
    background: #f59e0b;
    animation: qelocity-pulse 1s infinite alternate;
}

.qelocity-status-dot.connected {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.qelocity-status-dot.error {
    background: #ef4444;
}

@keyframes qelocity-pulse {
    from { opacity: 0.4; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1.2); }
}

/* ── Body (History + Viewport) ── */
.qelocity-body {
    flex: 1;
    display: flex;
    overflow: hidden;
    min-height: 0;
}

/* ── History Sidebar ── */
.qelocity-history {
    width: 220px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.15);
}

.qelocity-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.qelocity-history-header h3 {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.qelocity-history-header h3 i {
    color: var(--primary);
    font-size: 12px;
}

.qelocity-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.qelocity-history-list::-webkit-scrollbar { width: 4px; }
.qelocity-history-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.qelocity-history-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-bottom: 4px;
}

.qelocity-history-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.qelocity-history-item .history-title {
    font-size: 11px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.qelocity-history-item .history-url {
    font-size: 9px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qelocity-history-item .history-meta {
    font-size: 8px;
    color: rgba(255, 255, 255, 0.2);
    margin-top: 4px;
}

.qelocity-empty-history {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(255, 255, 255, 0.15);
    gap: 12px;
    padding: 20px;
    text-align: center;
}

.qelocity-empty-history i {
    font-size: 2rem;
    opacity: 0.3;
}

.qelocity-empty-history p {
    font-size: 11px;
    margin: 0;
}

/* ── Viewport ── */
.qelocity-viewport-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.qelocity-viewport {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
    display: none;
}

.qelocity-viewport.active {
    display: block;
}

/* ── Welcome Screen ── */
.qelocity-welcome {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, rgba(14, 165, 233, 0.04) 0%, transparent 60%);
}

.qelocity-welcome.hidden { display: none; }

.qelocity-welcome-content {
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
}

.qelocity-welcome-content > i {
    font-size: 4rem;
    margin-bottom: 24px;
    opacity: 0.15;
}

.qelocity-welcome-content h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 8px;
}

.qelocity-welcome-content p {
    font-size: 13px;
    margin-bottom: 32px;
}

.qelocity-welcome-features {
    display: flex;
    gap: 32px;
    justify-content: center;
}

.qelocity-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.25);
}

.qelocity-feature i {
    font-size: 1.2rem;
    color: var(--primary);
    opacity: 0.4;
}

/* ── Loading Bar ── */
.qelocity-loading {
    height: 3px;
    background: rgba(255, 255, 255, 0.02);
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
}

.qelocity-loading.hidden { display: none; }

.qelocity-loading-bar {
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    animation: qelocity-load 1.2s infinite ease-in-out;
    border-radius: 2px;
}

@keyframes qelocity-load {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

/* ── Error State ── */
.qelocity-error {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    padding: 40px;
}

.qelocity-error.hidden { display: none; }

.qelocity-error i {
    font-size: 3rem;
    color: #ef4444;
    opacity: 0.5;
}

.qelocity-error h3 {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

.qelocity-error p {
    font-size: 12px;
    margin: 0;
    max-width: 300px;
}

/* ── Footer Stats ── */
.qelocity-footer {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.qelocity-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
}

.qelocity-stat i {
    color: var(--primary);
    font-size: 10px;
    opacity: 0.6;
}

.qelocity-stat strong {
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

/* ── Qelocity Responsive ── */
@media (max-width: 768px) {
    .qelocity-history { display: none; }
    .qelocity-toolbar {
        flex-direction: column;
        padding: 10px;
    }
    .qelocity-address-bar { width: 100%; }
    .qelocity-toolbar-actions { width: 100%; justify-content: space-between; }
    .qelocity-footer {
        flex-wrap: wrap;
        gap: 12px;
    }
    .qelocity-welcome-features {
        flex-direction: column;
        gap: 16px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   POP — Participatory Ontology Protocol (Wave 6)
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --pop-accent: #00ffaa;
    --pop-accent-dim: rgba(0, 255, 170, 0.1);
    --pop-accent-glow: 0 0 20px rgba(0, 255, 170, 0.3);
    --pop-pi: #f0b429;
    --pop-rose: #f43f5e;
    --pop-violet: #a855f7;
}

.pop-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 0;
    overflow: hidden;
}

/* ── POP Sub-Navigation ── */
.pop-subnav {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.pop-subtab {
    padding: 8px 18px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-body);
    letter-spacing: 0.3px;
}

.pop-subtab:hover {
    color: var(--pop-accent);
    background: rgba(0, 255, 170, 0.05);
}

.pop-subtab.active {
    color: #fff;
    background: rgba(0, 255, 170, 0.1);
    border-color: rgba(0, 255, 170, 0.3);
}

.pop-subnav-status {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--pop-accent);
    text-transform: uppercase;
}

.pop-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--pop-accent);
    animation: pop-pulse 2s infinite ease-in-out;
}

@keyframes pop-pulse {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.3); box-shadow: 0 0 12px var(--pop-accent); }
}

/* ── POP Sub-Tab Content ── */
.pop-subtab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.pop-subtab-content.active {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ══ POP Dashboard ══ */
.pop-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.pop-metric-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    backdrop-filter: blur(12px);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.pop-metric-card:hover {
    border-color: rgba(0, 255, 170, 0.25);
    box-shadow: var(--pop-accent-glow);
}

.pop-metric-icon {
    font-size: 18px;
    color: var(--pop-accent);
    opacity: 0.6;
}

.pop-metric-pi .pop-metric-icon { color: var(--pop-pi); }
.pop-metric-nodes .pop-metric-icon { color: var(--pop-violet); }
.pop-metric-phase .pop-metric-icon { color: #00e5ff; }

.pop-metric-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pop-metric-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.pop-metric-value {
    font-size: 1.8rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: #fff;
    letter-spacing: 1px;
}

.pop-metric-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
}

.pop-metric-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--pop-accent), #00e5ff);
    border-radius: 2px;
    transition: width 0.6s ease;
}

.pop-fill-pi {
    background: linear-gradient(90deg, var(--pop-pi), #f59e0b);
}

.pop-dashboard-bottom {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 16px;
    flex: 1;
    min-height: 0;
}

.pop-canvas-card .card-body {
    flex: 1;
    min-height: 200px;
    position: relative;
}

#pop-mesh-canvas {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
}

.pop-log-card {
    display: flex;
    flex-direction: column;
}

.pop-log-card .card-header {
    flex-shrink: 0;
}

.pop-log-controls {
    margin-left: auto;
    display: flex;
    gap: 6px;
}

.pop-log {
    flex: 1;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    max-height: 300px;
}

.pop-log-entry {
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    line-height: 1.5;
}

.pop-log-entry:last-child { border-bottom: none; }

/* ══ POP Ledger ══ */
.pop-ledger-header {
    flex-shrink: 0;
}

.pop-ledger-stats {
    display: flex;
    gap: 24px;
}

.pop-ledger-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pop-ledger-stat .label {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.pop-ledger-stat .value {
    font-size: 1.4rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--pop-accent);
}

.pop-ledger-table-wrap {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pop-ledger-table-header {
    display: grid;
    grid-template-columns: 1.2fr 1fr 0.8fr 2fr 0.5fr 1.5fr 1fr;
    gap: 8px;
    padding: 12px 16px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.pop-ledger-table {
    flex: 1;
    overflow-y: auto;
}

.pop-ledger-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr 0.8fr 2fr 0.5fr 1.5fr 1fr;
    gap: 8px;
    padding: 10px 16px;
    font-size: 11px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-family: var(--font-mono);
    transition: background 0.15s;
}

.pop-ledger-row:hover {
    background: rgba(0, 255, 170, 0.03);
}

.pop-ledger-row .type-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    background: var(--pop-accent-dim);
    color: var(--pop-accent);
    text-align: center;
}

.pop-ledger-row .hash-val {
    opacity: 0.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pop-ledger-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.15);
    gap: 12px;
    text-align: center;
}

.pop-ledger-empty i { font-size: 2rem; opacity: 0.3; }
.pop-ledger-empty p { font-size: 12px; margin: 0; }

/* ══ POP Agents (Collective) ══ */
.pop-agents-header {
    flex-shrink: 0;
}

.pop-agents-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.pop-agents-header p {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

.pop-agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.pop-agent-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.pop-agent-card:hover {
    border-color: rgba(0, 255, 170, 0.2);
}

.pop-agent-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pop-agent-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.pop-agent-info h3 {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 2px;
}

.pop-agent-info p {
    font-size: 10px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

.pop-agent-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.pop-agent-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.pop-agent-output {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-secondary);
    line-height: 1.5;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    min-height: 40px;
}

.pop-agent-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 9px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* ══ POP Inference (Chat) ══ */
.pop-inference-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.pop-chat-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
}

.pop-chat-title {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pop-chat-title > span:first-child {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.pop-chat-subtitle {
    font-size: 10px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.pop-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pop-msg {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 85%;
    animation: pop-msg-in 0.3s ease-out;
}

@keyframes pop-msg-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.pop-msg-label {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.5;
}

.pop-msg-bubble {
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.6;
}

.pop-msg-user {
    align-self: flex-end;
}

.pop-msg-user .pop-msg-bubble {
    background: var(--pop-accent-dim);
    border: 1px solid rgba(0, 255, 170, 0.3);
    color: #fff;
}

.pop-msg-collective {
    align-self: flex-start;
}

.pop-msg-collective .pop-msg-bubble {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

.pop-msg-system .pop-msg-bubble {
    background: none;
    border-left: 2px solid var(--pop-accent);
    border-radius: 0 8px 8px 0;
    color: var(--text-muted);
    font-size: 11px;
    font-style: italic;
}

.pop-msg-agent .pop-msg-bubble {
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #c4b5fd;
    font-family: var(--font-mono);
    font-size: 11px;
}

.pop-msg-meta {
    font-size: 9px;
    font-family: var(--font-mono);
    color: rgba(255, 255, 255, 0.2);
}

.pop-chat-input-area {
    display: flex;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.pop-chat-input-area input {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    color: #fff;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    font-family: var(--font-body);
}

.pop-chat-input-area input:focus {
    border-color: var(--pop-accent);
}

/* ══ POP Settings ══ */
.pop-settings-card {
    max-width: 700px;
}

.pop-settings-card h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 24px;
}

.pop-settings-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pop-setting {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pop-setting-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.pop-setting-input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 12px;
    outline: none;
}

.pop-setting-range {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pop-setting-range input[type="range"] {
    flex: 1;
}

.pop-setting-range span {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--pop-accent);
    min-width: 60px;
    text-align: right;
}

/* ══ POP Responsive ══ */
@media (max-width: 900px) {
    .pop-metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .pop-dashboard-bottom { grid-template-columns: 1fr; }
    .pop-agents-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .pop-metrics-grid { grid-template-columns: 1fr; }
    .pop-subnav { flex-wrap: wrap; }
    .pop-ledger-table-header,
    .pop-ledger-row { grid-template-columns: 1fr 1fr 1fr; }
    .pop-ledger-table-header span:nth-child(n+4),
    .pop-ledger-row span:nth-child(n+4) { display: none; }
}

