/* ==========================================================================
   PROFILE PAGE SPECIFIC STYLES
   ========================================================================== */

/* Error Container */
.error-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50vh;
    text-align: center;
    padding: 2rem;
}

.error-content {
    max-width: 500px;
}

.error-content i {
    font-size: 3rem;
    color: #dc3545;
    margin-bottom: 1rem;
}

.error-content h2 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.error-content p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.5;
}

/* Profile Container */
.profile-container {
    width: var(--container-width, 90%);
    max-width: var(--max-content-width, 1200px);
    margin: 0 auto;
    padding: 2rem 0;
}

/* Profile Header */
.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1.25rem 0 0.75rem 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.profile-basic-info {
    flex: 1;
    min-width: 0;
}

.profile-header .node-alias {
    font-size: 2.3rem;
    font-weight: 600;
    color: var(--secondary);
    margin: 0 0 0.9rem 0;
    line-height: 1.2;
}

.node-pubkey-container {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    position: relative;
}

.node-pubkey {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    word-break: break-all;
}

.copy-btn {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--primary);
    padding: 0.28rem 0.48rem;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(42,51,66,0.12);
    transition: background 0.15s ease, color 0.15s ease,
                box-shadow 0.15s ease, transform 0.08s ease;
}

.copy-btn:hover {
    background: #fff7f2; /* light warm tint, in family with --primary */
    color: var(--primary);
    box-shadow: 0 2px 6px rgba(42,51,66,0.16);
    transform: translateY(-1px);
}

.copy-pubkey-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.copy-tooltip {
    position: absolute;
    top: 120%;
    right: 0;
    min-width: 190px;
    padding: 0.4rem 0;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(42,51,66,0.16);
    border: 1px solid var(--border);
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.copy-pubkey-wrapper:hover .copy-tooltip {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.copy-tooltip-item {
    width: 100%;
    padding: 0.45rem 0.9rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    text-align: left;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.copy-tooltip-item:hover {
    background: #fff7f2;
    color: var(--secondary);
}

.copy-tooltip-hint {
    padding: 0.35rem 0.9rem 0.25rem;
    font-size: 0.7rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--bg-secondary);
}

@media (max-width: 640px) {
    .copy-tooltip {
        right: auto;
        left: 0;
    }
}

.node-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.35rem;
}

.node-entity-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--ghibli-slate-bg);
    color: var(--ghibli-slate);
    border: 1px solid var(--ghibli-slate-border);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    letter-spacing: 0.02em;
}

.node-role-desc {
    font-size: 0.92rem;
    color: var(--text-secondary);
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
}

.node-software-line {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin: 0 0 0.75rem 0;
}

.node-software-line #nodeSoftwareVersion {
    font-weight: 700;
    color: var(--text-primary, inherit);
}

.node-software-line .fa-info-circle {
    margin-left: 0.25rem;
    opacity: 0.6;
    cursor: help;
}

/* Profile Actions Bar (Step 3.4 Requirement) */
.profile-actions-bar {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.profile-actions-bar a.profile-action-btn,
a.profile-action-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.45rem !important;
    padding: 0.45rem 0.95rem !important;
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color, #E5E1DC) !important;
    border-radius: 999px !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

.profile-actions-bar a.profile-action-btn:hover,
a.profile-action-btn:hover {
    background: var(--primary-light, #FBF2ED) !important;
    color: var(--primary-dark, #A95137) !important;
    border-color: var(--primary-border, #ECCDC1) !important;
    text-decoration: none !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(42, 51, 66, 0.08) !important;
}

/* Node type badge using primary accent */
.node-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    background: transparent;
    font-size: 0.82rem;
    font-weight: 700;
}

.type-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid transparent;
    line-height: 1.2;
}
.type-pill.pill-exchange { background: var(--ghibli-amber-bg, #FEF7EA); color: var(--ghibli-amber, #9A6715); border-color: var(--ghibli-amber-border, #F5E2B8); }
.type-pill.pill-lsp { background: var(--ghibli-heather-bg, #F2EEF8); color: var(--ghibli-heather, #583F7A); border-color: #E2D9EE; }
.type-pill.pill-routing { background: var(--ghibli-slate-bg, #EDF3F7); color: var(--ghibli-slate, #2C5672); border-color: #D8E5EE; }
.type-pill.pill-wallet { background: var(--ghibli-sage-bg, #EDF5F0); color: var(--ghibli-sage, #2E7559); border-color: var(--ghibli-sage-border, #D1E5D8); }
.type-pill.pill-payment { background: var(--primary-light, #FBF2ED); color: var(--primary-dark, #A95137); border-color: var(--primary-border, #ECCDC1); }
.type-pill.pill-defi { background: #F8EFF4; color: #7A4065; border-color: #ECDCE5; }
.type-pill.pill-pleb { background: #F2EFEB; color: #565049; border-color: #E0DDD7; }

/* Category Badges Group (Step 3.4 Requirement) */
.category-badges-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.cat-badge.cat-freeway {
    background: var(--cat-freeway-bg);
    color: var(--cat-freeway);
    border-color: var(--cat-freeway-border);
}

.cat-badge.cat-highway {
    background: var(--cat-highway-bg);
    color: var(--cat-highway);
    border-color: var(--cat-highway-border);
}

.cat-badge.cat-myway {
    background: var(--cat-myway-bg);
    color: var(--cat-myway);
    border-color: var(--cat-myway-border);
}

/* Right-Side Dedicated Node Vitals Cockpit */
.profile-vitals-cockpit {
    width: 380px;
    max-width: 100%;
    flex-shrink: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.1rem 1.25rem;
    box-shadow: 0 4px 16px rgba(42, 51, 66, 0.05);
}

.vitals-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
}

.vitals-title {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--secondary);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.vitals-title i {
    color: var(--primary);
    font-size: 0.8rem;
}

.vitals-live-status {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--ghibli-sage, #2E7559);
    background: var(--ghibli-sage-bg, #EDF5F0);
    border: 1px solid var(--ghibli-sage-border, #D1E5D8);
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.vitals-live-status .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ghibli-sage, #2E7559);
    box-shadow: 0 0 6px var(--ghibli-sage, #2E7559);
}

.vitals-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.7rem;
}

.vital-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.65rem 0.8rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.vital-card:hover {
    border-color: var(--primary-border, #ECCDC1);
    transform: translateY(-1px);
}

.vital-card.vital-rank {
    background: var(--primary-light, #FBF2ED);
    border-color: var(--primary-border, #ECCDC1);
}

.vital-lbl {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.vital-lbl i {
    color: var(--primary);
    font-size: 0.72rem;
}

.vital-val {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--secondary);
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.vital-val.highlight {
    color: var(--primary);
    font-weight: 900;
}

.vital-sub {
    font-size: 0.66rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    opacity: 0.85;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--bg-secondary);
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s ease;
    position: relative;
}

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

.tab-btn.active {
    color: var(--primary);
    background: var(--bg-primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

/* Tab Content */
.tab-content {
    position: relative;
}

.tab-pane {
    display: none !important;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    width: 100%;
    user-select: text !important;
    pointer-events: auto !important;
    min-height: auto;
}

.tab-pane.active {
    display: block !important;
    opacity: 1;
}

.tab-pane * {
    user-select: text !important;
    pointer-events: auto !important;
}

.tab-pane button, .tab-pane .btn, .tab-pane .tab-btn {
    user-select: none !important;
}

.tab-pane a, .info-item a, .info-value a {
    pointer-events: auto !important;
    user-select: text !important;
    cursor: pointer !important;
}

/* Overview Tab */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.overview-section {
    background: var(--bg-primary);
    border: 1px solid var(--bg-secondary);
    border-radius: 12px;
    padding: 2rem;
}

.overview-section h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.info-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--bg-secondary);
}

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

.info-label {
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 120px;
}

.info-value {
    color: var(--text-primary);
    text-align: right;
    flex: 1;
    word-break: break-word;
}

.pubkey-display {
    font-family: monospace;
    font-size: 0.8rem;
    background: var(--bg-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Rankings Tab */
.rankings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.ranking-card {
    background: var(--bg-primary);
    border: 1px solid var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.ranking-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.ranking-header i {
    color: var(--primary);
}

.ranking-header h4 {
    margin: 0;
    font-size: 1rem;
}

.ranking-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.ranking-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Channels Section - Treemap */
#channelsTreemapPane {
    width: 100%;
}

#channelsTreemap {
    width: 100% !important;
    height: 520px !important;
    min-height: 500px;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-primary);
    overflow: hidden;
    display: block;
}

/* Spec Value Copy Actions in Network Diagnostics */
.spec-val-group {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    max-width: 65%;
    justify-content: flex-end;
}

.spec-val-group .spec-val {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spec-copy-btn {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.spec-copy-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-light);
}

/* Channel Details Tab */
#channels-table {
    margin-top: 0;
    padding-top: 0;
}

#channels-table .section-header {
    margin-top: 0;
    margin-bottom: 1.5rem;
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--bg-secondary);
}

#channels-table .section-header h3 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 600;
}

#channels-table .section-header h3 i {
    color: var(--primary);
}

#channels-table .section-header p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 1rem;
    line-height: 1.4;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 768px) {
    .profile-container {
        padding: 1rem;
    }

    .profile-header {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .profile-actions {
        width: 100%;
        justify-content: stretch;
    }

    .profile-actions .btn-primary,
    .profile-actions .btn-secondary {
        flex: 1;
        justify-content: center;
    }

    .profile-header .node-alias {
        font-size: 2rem;
    }

    .profile-header {
        flex-direction: column;
        gap: 1.5rem;
    }

    .profile-vitals-cockpit {
        width: 100%;
    }

    .tab-navigation {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: 1;
        justify-content: center;
        min-width: 120px;
    }

    .overview-grid {
        grid-template-columns: 1fr;
    }

    .rankings-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .info-value {
        text-align: left;
    }

    .selection-form {
        flex-direction: column;
        align-items: stretch;
    }

    .node-input {
        min-width: auto;
    }

    .nodes-grid {
        grid-template-columns: 1fr;
    }

    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .value {
        text-align: left;
    }
}

/* Category Counts Styling */
#categoryCounts ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: right;
}

#categoryCounts li {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    color: var(--text-primary);
}

@media (max-width: 480px) {
    .channels-table {
        min-width: 900px;
    }
    
    .channels-table th,
    .channels-table td {
        padding: 0.4rem 0.3rem;
    }
}

/* Peer Link */
.peer-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-block;
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
}

.peer-link:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
    transform: translateX(2px);
}

/* Expandable Rows */
.peer-group-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.peer-group-row:hover {
    background-color: var(--bg-secondary);
}

.peer-group-row .expand-icon {
    transition: transform 0.3s ease;
    display: inline-block;
    margin-right: 0.5rem;
    color: var(--text-secondary);
}

.peer-group-row.expanded .expand-icon {
    transform: rotate(90deg);
}

.channel-details-row {
    background-color: var(--bg-secondary);
}

.channel-details-row td {
    padding: 0 !important; /* Remove default padding for seamless nested table */
}

.nested-table-container {
    padding: 1rem 2rem;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
}

.nested-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.nested-table th,
.nested-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.nested-table th {
    font-weight: 600;
    color: var(--text-secondary);
    background-color: var(--bg-primary);
}

.nested-table tr:last-child td {
    border-bottom: none;
}

/* ==========================================================================
   PROFILE COMMAND CENTER: RADAR, DIAGNOSTICS & UNIFIED TOPOLOGY
   ========================================================================== */

.profile-persona-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: var(--primary-light, #FBF2ED);
    color: var(--primary-dark, #A95137);
    border: 1px solid var(--primary-border, #ECCDC1);
}

.profile-command-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: stretch;
}

.profile-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.4rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
}

.profile-card-header {
    margin-bottom: 1.1rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--border);
}

.profile-card-eyebrow {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.25rem;
}

.profile-card-header h3 {
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--secondary);
    margin: 0 0 0.2rem 0;
    letter-spacing: -0.3px;
}

.profile-card-sub {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

/* Radar Hexagon Layout */
.radar-layout-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.radar-svg-container {
    width: 100%;
    max-width: 360px;
    height: 280px;
    margin: 0 auto;
    position: relative;
}

.radar-svg-container svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.radar-grid-polygon {
    fill: none;
    stroke: var(--border);
    stroke-width: 1px;
}

.radar-spoke {
    stroke: var(--border);
    stroke-width: 1px;
    stroke-dasharray: 2 2;
}

.radar-polygon {
    fill: rgba(44, 86, 114, 0.12);
    stroke: var(--ghibli-slate, #2C5672);
    stroke-width: 1.5px;
    stroke-linejoin: round;
    transition: all 0.3s ease;
}

.radar-polygon:hover {
    fill: rgba(44, 86, 114, 0.22);
}

.radar-dot {
    fill: var(--ghibli-slate, #2C5672);
    stroke: #ffffff;
    stroke-width: 2px;
    cursor: pointer;
    transition: r 0.15s ease, fill 0.15s ease;
}

.radar-dot:hover {
    r: 6;
    fill: var(--secondary, #242D38);
}

.radar-label {
    font-size: 0.68rem;
    font-weight: 600;
    fill: var(--text-secondary);
    font-family: inherit;
}

.radar-label-rank {
    font-size: 0.72rem;
    font-weight: 700;
    fill: var(--secondary, #242D38);
}

.radar-ring-label {
    font-size: 0.58rem;
    fill: var(--text-muted, #9aa3ad);
    font-family: inherit;
}

.metric-desc {
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.radar-tooltip {
    position: absolute;
    background: var(--secondary);
    color: #fff;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    font-size: 0.72rem;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 10;
    transform: translate(-50%, -120%);
    white-space: nowrap;
    transition: opacity 0.15s ease;
}

/* Centrality Progress Rows */
.centrality-progress-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.centrality-progress-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.progress-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.metric-name {
    font-weight: 600;
    color: var(--secondary);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.metric-rank-group {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.metric-rank-val {
    font-weight: 700;
    color: var(--secondary);
}

.metric-pct-pill {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
}

.pct-elite { background: var(--ghibli-amber-bg, #FEF7EA); color: var(--ghibli-amber, #9A6715); border: 1px solid var(--ghibli-amber-border, #F5E2B8); }
.pct-top { background: var(--ghibli-slate-bg, #EDF3F7); color: var(--ghibli-slate, #2C5672); border: 1px solid #D8E5EE; }
.pct-core { background: var(--ghibli-sage-bg, #EDF5F0); color: var(--ghibli-sage, #2E7559); border: 1px solid var(--ghibli-sage-border, #D1E5D8); }
.pct-standard { background: var(--bg-secondary); color: var(--text-secondary); border: 1px solid var(--border); }

.progress-track {
    width: 100%;
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--ghibli-slate, #2C5672);
    border-radius: 999px;
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Persona & Diagnostics in Right Column */
.diagnostics-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.persona-diagnosis-card {
    background: linear-gradient(135deg, rgba(212, 115, 85, 0.06) 0%, rgba(254, 249, 244, 0.3) 100%);
    border: 1px solid var(--primary-border, #ECCDC1);
    border-radius: 12px;
    padding: 0.95rem 1.05rem;
}

.persona-title-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 0.35rem;
}

.persona-title-row i {
    color: var(--primary);
}

.persona-desc-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
}

/* Fee Benchmark Box */
.fee-benchmark-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.95rem 1.05rem;
}

.fee-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.fee-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--secondary);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.fee-benchmark-pill {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

.fee-low { background: var(--ghibli-sage-bg, #EDF5F0); color: var(--ghibli-sage, #2E7559); border: 1px solid var(--ghibli-sage-border, #D1E5D8); }
.fee-comp { background: var(--ghibli-slate-bg, #EDF3F7); color: var(--ghibli-slate, #2C5672); border: 1px solid #D8E5EE; }
.fee-high { background: var(--primary-light, #FBF2ED); color: var(--primary-dark, #A95137); border: 1px solid var(--primary-border, #ECCDC1); }

.fee-metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.fee-stat-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.45rem 0.65rem;
}

.fee-stat-lbl {
    font-size: 0.68rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 0.15rem;
}

.fee-stat-val {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--secondary);
}

/* Specs & Metadata List */
.specs-meta-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    font-size: 0.82rem;
}

.spec-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
}

.spec-row:last-child {
    border-bottom: none;
}

.spec-lbl {
    color: var(--text-secondary);
    font-weight: 500;
}

.spec-val {
    color: var(--secondary);
    font-weight: 600;
    text-align: right;
    font-family: monospace;
    font-size: 0.8rem;
}

/* Channels Section Card & Switcher */
.channels-section-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.4rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    margin-bottom: 2rem;
}

.channels-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.channels-header-row h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.channels-switcher {
    display: inline-flex;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.2rem;
    gap: 0.2rem;
}

.channel-view-btn {
    border: none;
    background: transparent;
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.channel-view-btn:hover {
    color: var(--text-primary);
}

.channel-view-btn.active {
    background: var(--surface);
    color: var(--secondary);
    font-weight: 700;
    box-shadow: 0 1px 4px rgba(42, 51, 66, 0.08);
}

@media (max-width: 992px) {
    .profile-command-grid {
        grid-template-columns: 1fr;
    }
}
.vitals-live-status.is-stale {
    color: var(--text-secondary);
    background: var(--bg-secondary);
}

.vitals-live-status.is-stale .status-dot {
    background: var(--text-secondary);
    animation: none;
}

/* ==========================================================================
   CHANNELS TABLE (profile-channels-table.js). Its generic .data-table styles were
   removed in the 2026-09-26 redesign; scoped here so other tables are unaffected.
   ========================================================================== */
#channelsTableContainer .table-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
}

#channelsTableContainer .search-container {
    position: relative;
    flex: 1 1 260px;
    max-width: 380px;
    margin: 0;
}

#channelsTableContainer .search-input {
    width: 100%;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
    font-size: 0.88rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface, #fff);
}

#channelsTableContainer .search-icon {
    position: absolute;
    left: auto;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 0.8rem;
    pointer-events: none;
}

#channelsTableContainer .table-meta {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

#channelsTableContainer .page-size-select {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.3rem 0.5rem;
    font-size: 0.82rem;
    background: var(--surface, #fff);
    color: var(--text-primary);
}

#channelsTableContainer .table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
}

#channelsTableContainer .data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

#channelsTableContainer .data-table th {
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

#channelsTableContainer .data-table th.sortable {
    cursor: pointer;
    user-select: none;
}

#channelsTableContainer .data-table th i {
    margin-left: 0.2rem;
    opacity: 0.55;
}

#channelsTableContainer .data-table td {
    padding: 0.55rem 0.8rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

#channelsTableContainer .data-table > tbody > tr:last-child > td {
    border-bottom: none;
}

#channelsTableContainer .channel-row:hover {
    background: var(--bg-secondary);
}

#channelsTableContainer .peer-link {
    padding: 0;
}

#channelsTableContainer .capacity-cell {
    white-space: nowrap;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

#channelsTableContainer .birth-tx-cell a {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 1px dotted var(--text-secondary);
}

#channelsTableContainer .chan-fee-cell {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    cursor: help;
}

#channelsTableContainer .chan-fee {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

#channelsTableContainer .chan-fee-inbound {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

#channelsTableContainer .chan-disabled {
    color: var(--text-secondary);
}

#channelsTableContainer .chan-status {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    white-space: nowrap;
}

#channelsTableContainer .chan-status.ok {
    background: var(--ghibli-sage-bg, #EDF5F0);
    color: var(--ghibli-sage, #2E7559);
    border: 1px solid var(--ghibli-sage-border, #D1E5D8);
}

#channelsTableContainer .chan-status.warn {
    background: var(--ghibli-amber-bg, #FEF7EA);
    color: var(--ghibli-amber, #9A6715);
    border: 1px solid var(--ghibli-amber-border, #F5E2B8);
}

#channelsTableContainer .chan-status.off {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

#channelsTableContainer .group-summary {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

#channelsTableContainer .nested-table-container {
    padding: 0.5rem 1rem 0.75rem 2.25rem;
}

#channelsTableContainer .nested-table {
    font-size: 0.84rem;
}

#channelsTableContainer .nested-table th,
#channelsTableContainer .nested-table td {
    padding: 0.45rem 0.75rem;
}

#channelsTableContainer .nested-table th {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

#channelsTableContainer > .pagination-info,
#channelsTableContainer .pagination-container {
    margin-top: 0.85rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   NODE PAGE LAYOUT (2026-10-10): compact header, KPI strip, position + details,
   channels. Same tokens and card style as the rest of the site.
   ========================================================================== */
.profile-container {
    padding-top: 0.25rem;
}

/* Header */
.np-hero {
    margin-bottom: 1.1rem;
}

.np-hero .node-alias {
    font-size: 2rem;
    font-weight: 600;
    color: var(--secondary);
    margin: 0;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.np-hero .node-title-row,
.np-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.6rem;
    margin-bottom: 0.3rem;
}

.np-hero .node-role-desc {
    margin: 0 0 0.45rem 0;
    font-size: 0.9rem;
}

.np-meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem 0.9rem;
    font-size: 0.84rem;
    color: var(--text-secondary);
    margin-bottom: 0.7rem;
}

.np-types {
    display: inline-flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.np-types .type-pill {
    font-size: 0.72rem;
    padding: 0.15rem 0.55rem;
}

.np-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.np-meta-item + .np-meta-item::before,
.np-types + .np-meta-item::before {
    content: "·";
    color: var(--text-muted);
    margin-right: 0.55rem;
}

.np-gossip .status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ghibli-sage, #2E7559);
}

.np-gossip.is-stale .status-dot {
    background: var(--text-muted);
}

.np-meta-row .node-software-line {
    margin: 0;
    font-size: inherit;
}

.np-meta-row .node-software-line strong {
    color: var(--text-primary);
}

.np-id-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
}

.np-id-row .node-pubkey {
    font-size: 0.78rem;
    padding: 0.35rem 0.6rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.np-links {
    display: inline-flex;
    gap: 0.4rem;
}

.np-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    transition: color 0.15s ease, border-color 0.15s ease;
}

.np-link:hover {
    color: var(--primary-dark);
    border-color: var(--primary-border);
}

/* KPI strip */
.np-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    margin-bottom: 1.1rem;
    overflow: hidden;
}

.np-kpi {
    padding: 0.85rem 1.1rem;
    border-left: 1px solid var(--border-subtle, #EFEBE4);
    min-width: 0;
}

.np-kpi:first-child {
    border-left: none;
}

.np-kpi-lbl {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.np-kpi-val {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--secondary);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.np-kpi-rank .np-kpi-val {
    color: var(--primary);
}

.np-kpi-sub {
    font-size: 0.76rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.np-kpi-sub .fee-benchmark-pill:empty {
    display: none;
}

.np-kpi-sub .fee-benchmark-pill {
    cursor: help;
}

/* Analysis row */
.np-analysis {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    gap: 1.1rem;
    margin-bottom: 1.1rem;
    align-items: start;
}

.np-analysis .profile-card {
    padding: 1.1rem 1.25rem;
}

.np-card-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    padding-bottom: 0.6rem;
    margin-bottom: 0.8rem;
    border-bottom: 1px solid var(--border);
}

.np-card-head h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--secondary);
    margin: 0;
}

.np-card-note {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.np-position-body {
    display: grid;
    grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
    gap: 1rem 1.25rem;
    align-items: start;
}

.np-position-body .radar-svg-container {
    max-width: 340px;
    height: auto;
    aspect-ratio: 360 / 280;
    margin: 0.25rem 0 0;
}

.np-position-body .centrality-progress-list {
    gap: 0.5rem;
}

.np-position-body .centrality-progress-row {
    gap: 0.15rem;
}

.np-position-body .progress-track {
    height: 3px;
}

.np-position-body .progress-label-row {
    font-size: 0.8rem;
}

.np-position-body .metric-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.np-section-lbl {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.np-role {
    margin-bottom: 0.9rem;
}

.np-role-desc {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.np-role-desc strong {
    color: var(--secondary);
}

.np-sizes {
    margin-bottom: 0.6rem;
}

.np-sizebar {
    display: flex;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    gap: 2px;
    background: var(--bg-secondary);
    margin: 0.25rem 0 0.45rem;
}

.np-seg-freeway { background: var(--cat-freeway, #2E7559); }
.np-seg-highway { background: var(--cat-highway, #9A6715); }
.np-seg-myway { background: var(--ghibli-slate, #2C5672); }

.np-size-legend {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.8rem;
    color: var(--text-primary);
}

.np-size-legend > span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.np-size-legend strong {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
}

.np-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    display: inline-block;
}

.np-muted {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.np-details .specs-meta-list {
    gap: 0;
}

.np-details .spec-row {
    padding: 0.45rem 0;
}

.np-details .spec-lbl {
    white-space: nowrap;
    margin-right: 1rem;
}

.np-details .spec-val-group {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
}

.np-details .spec-val {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Channels card sits closer to the analysis row */
.channels-section-card {
    padding: 1.1rem 1.25rem;
}

.channels-header-row {
    margin-bottom: 0.85rem;
}

.channels-header-row h3 {
    font-size: 1.05rem;
}

@media (max-width: 1100px) {
    .np-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .np-kpi:nth-child(4) { border-left: none; }
    .np-kpi:nth-child(n+4) { border-top: 1px solid var(--border-subtle, #EFEBE4); }
    .np-analysis { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .np-hero .node-alias { font-size: 1.6rem; }
    .np-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .np-kpi:nth-child(n) { border-left: none; border-top: 1px solid var(--border-subtle, #EFEBE4); }
    .np-kpi:nth-child(-n+2) { border-top: none; }
    .np-kpi:nth-child(even) { border-left: 1px solid var(--border-subtle, #EFEBE4); }
    .np-kpi-val { font-size: 1.2rem; }
    .np-position-body { grid-template-columns: 1fr; }
    .np-position-body .radar-svg-container { margin: 0 auto; }
    .np-id-row .node-pubkey { font-size: 0.7rem; }
    /* copy button sits at the right edge here: open the menu leftwards */
    .np-id-row .copy-tooltip { left: auto; right: 0; }
}
