/* ══════════════════════════════════════════════════════════
   NLO Explorer — public product surface
   Extends portal.css without changing the shared theme tokens.
   ══════════════════════════════════════════════════════════ */

.explorer-shell {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* --- Header + universal search --- */
.explorer-header-wrap {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.explorer-header-bar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 18px;
}

.explorer-header-bar .page-header-brand {
    align-items: center;
}

.explorer-header-bar .page-header-logo-shell {
    width: 54px;
    height: 54px;
}

.explorer-header-bar .page-header-logo {
    width: 42px;
    height: 42px;
}

.explorer-search-shell {
    justify-self: center;
    width: min(100%, 760px);
}

.explorer-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--bg-elev-1);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.explorer-search-input {
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.96rem;
    padding: 4px 8px;
    width: 100%;
}

.explorer-search-input:focus {
    outline: none;
}

.explorer-search-hint,
.explorer-search-feedback {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.explorer-search-feedback {
    min-height: 18px;
}

.explorer-search-feedback.feedback-error {
    color: var(--red);
}

.explorer-search-feedback.feedback-success {
    color: var(--green);
}

/* --- Tabs + breadcrumb --- */
.explorer-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-elev-1);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
    flex-wrap: wrap;
}

.explorer-tab {
    padding: 10px 18px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: var(--radius-xs);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.explorer-tab:hover,
.explorer-tab:focus-visible {
    color: var(--text-primary);
    background: var(--bg-elev-2);
}

.explorer-tab.active {
    color: var(--text-primary);
    background: var(--bg-elev-3);
}

.explorer-breadcrumb {
    min-height: 22px;
}

.breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
}

.breadcrumb-link {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumb-link:hover {
    color: var(--text-primary);
}

.breadcrumb-current,
.breadcrumb-sep {
    color: var(--text-muted);
}

/* --- Panels / sections --- */
.explorer-panel { display: none; }
.explorer-panel.active { display: block; }

.explorer-section {
    background: var(--bg-elev-1);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 22px;
}

.explorer-section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.explorer-section-head-stack {
    flex-direction: column;
    align-items: stretch;
}

.explorer-section-title {
    margin: 0;
    font-family: 'Sora', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.explorer-section-copy {
    margin: 6px 0 0;
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.5;
}

.overview-hero,
.explorer-summary-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.overview-hero {
    margin-bottom: 18px;
}

.explorer-stat-card,
.skel-stat-card {
    background: var(--bg-elev-1);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 20px;
}

.explorer-stat-card .stat-label {
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.explorer-stat-card .stat-value {
    color: var(--text-primary);
    font-family: 'Sora', sans-serif;
    font-size: 1.42rem;
    font-weight: 600;
}

.explorer-stat-card .stat-value.stat-value-positive {
    color: var(--green);
}

.explorer-stat-card .stat-sub {
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.overview-grid,
.status-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr);
    gap: 16px;
}

.explorer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

/* --- Overview --- */
.overview-activity-list,
.position-activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.overview-activity-item,
.position-activity-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-soft);
}

.overview-activity-item:last-child,
.position-activity-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.activity-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.94rem;
    font-weight: 700;
    background: var(--bg-elev-2);
    color: var(--text-primary);
}

.activity-icon.act-deposit {
    background: var(--green-soft);
    color: var(--green);
}

.activity-icon.act-withdrawal {
    background: var(--orange-soft);
    color: var(--orange);
}

.activity-icon.act-rotation,
.activity-icon.act-reward {
    background: rgba(48, 164, 255, 0.14);
    color: #7ac5ff;
}

.activity-description {
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.activity-time {
    color: var(--text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
}

.top-pools-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.overview-deployed-row {
    cursor: pointer;
}

.top-pool-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
    background: var(--bg-elev-2);
    cursor: pointer;
    transition: var(--transition-fast);
}

.top-pool-card:hover,
.top-pool-card:focus-visible {
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.top-pool-pair {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.94rem;
}

.top-pool-meta {
    color: var(--text-secondary);
    font-size: 0.78rem;
    margin-top: 6px;
}

.top-pool-metrics {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
}

/* --- Portfolio --- */
.empty-state-panel {
    text-align: center;
    padding: 48px 24px;
}

.empty-state-title {
    margin: 0 0 8px;
    font-family: 'Sora', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.empty-state-copy {
    margin: 0;
    color: var(--text-secondary);
    max-width: 440px;
    margin-inline: auto;
    line-height: 1.6;
}

.explorer-vault-card,
.explorer-position-card {
    background: var(--bg-elev-1);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 18px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.explorer-vault-card:hover,
.explorer-vault-card:focus-visible,
.explorer-position-card:hover,
.explorer-position-card:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.12);
}

.explorer-vault-card.vault-selected,
.explorer-position-card.position-selected,
.pool-primary-row.pool-highlight td {
    box-shadow: inset 0 0 0 1px rgba(255, 105, 28, 0.35);
}

.vault-card-header,
.position-card-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.vault-card-title,
.position-card-title {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.96rem;
}

.vault-card-meta,
.position-card-meta {
    color: var(--text-secondary);
    font-size: 0.78rem;
    margin-top: 5px;
}

.vault-card-metrics,
.position-card-metrics,
.detail-metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.metric-label {
    color: var(--text-muted);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.metric-value {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
}

.vault-card-sparkline,
.detail-chart-canvas {
    width: 100%;
    height: 54px;
    display: block;
    margin: 14px 0;
    border-radius: var(--radius-xs);
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0));
}

.portfolio-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.back-link {
    color: var(--orange);
    text-decoration: none;
    cursor: pointer;
    font-size: 0.82rem;
}

.back-link:hover {
    text-decoration: underline;
}

.position-detail-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.detail-heading {
    margin: 0;
    color: var(--text-primary);
    font-family: 'Sora', sans-serif;
    font-size: 1.08rem;
}

.detail-subcopy {
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.detail-card {
    background: var(--bg-elev-2);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 16px;
}

.detail-card-title {
    margin: 0 0 12px;
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 600;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-soft);
    font-size: 0.82rem;
}

.detail-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-row-label {
    color: var(--text-muted);
}

.detail-row-value {
    color: var(--text-primary);
    text-align: right;
}

.detail-link {
    color: var(--orange);
    text-decoration: none;
}

.detail-link:hover {
    text-decoration: underline;
}

/* --- Pools --- */
.pools-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 12px;
    align-items: center;
}

.discovery-mode-buttons {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.mode-btn {
    border: 1px solid var(--border-soft);
    background: var(--bg-elev-2);
    color: var(--text-secondary);
    padding: 9px 14px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.mode-btn.active {
    color: var(--text-primary);
    background: var(--bg-elev-3);
    border-color: rgba(255, 105, 28, 0.35);
}

.mode-btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    color: var(--text-muted);
    border-color: var(--border-soft);
    background: rgba(255, 255, 255, 0.02);
}

.pool-table-shell {
    overflow-x: auto;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: var(--bg-elev-1);
}

.explorer-table {
    width: 100%;
    border-collapse: collapse;
}

.pool-discovery-table {
    table-layout: fixed;
}

.pool-discovery-table col.pool-col-pair { width: 24%; }
.pool-discovery-table col.pool-col-dex { width: 16%; }
.pool-discovery-table col.pool-col-network { width: 14%; }
.pool-discovery-table col.pool-col-tvl { width: 15%; }
.pool-discovery-table col.pool-col-volume { width: 19%; }
.pool-discovery-table col.pool-col-apr { width: 12%; }

.explorer-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-soft);
    white-space: nowrap;
}

.explorer-table td {
    padding: 16px;
    font-size: 0.84rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-soft);
    vertical-align: top;
}

.pool-discovery-table th,
.pool-discovery-table td {
    vertical-align: middle;
}

.pool-discovery-table td:first-child .position-card-meta {
    overflow-wrap: anywhere;
}

.explorer-table tr:hover td {
    background: var(--bg-elev-2);
}

.explorer-table a {
    color: var(--orange);
    text-decoration: none;
}

.explorer-table a:hover {
    text-decoration: underline;
}

.portfolio-table-meta {
    color: var(--text-muted);
    font-size: 0.78rem;
    white-space: nowrap;
}

.tx-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.tx-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    display: inline-block;
}

.tx-status-confirmed .tx-status-dot {
    background: var(--green);
    box-shadow: 0 0 0 4px rgba(45, 212, 123, 0.15);
}

.tx-status-failed .tx-status-dot {
    background: var(--red);
    box-shadow: 0 0 0 4px rgba(255, 86, 86, 0.15);
}

.tx-status-pending .tx-status-dot {
    background: var(--orange);
    box-shadow: 0 0 0 4px rgba(255, 162, 26, 0.15);
}

.tx-link {
    color: var(--orange) !important;
}

.tx-pagination {
    display: grid;
    grid-template-columns: auto 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    padding: 16px 4px 4px;
}

.tx-pagination-status,
.tx-pagination-range {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.tx-pagination-status {
    text-align: center;
    font-weight: 600;
}

.tx-pagination-range {
    text-align: right;
}

.tx-pagination-btn {
    border: 1px solid var(--border-soft);
    background: var(--bg-elev-2);
    color: var(--text-primary);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.tx-pagination-btn:disabled {
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    cursor: not-allowed;
}

.sortable-th {
    cursor: pointer;
    user-select: none;
}

.sortable-th.sort-active {
    color: var(--text-primary);
}

.text-right { text-align: right; }

.pool-primary-row {
    cursor: pointer;
}

.pool-detail-row td {
    background: var(--bg-elev-2);
}

.pool-detail-card {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
    gap: 18px;
}

.pool-detail-meta {
    display: grid;
    gap: 12px;
}

.pool-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px 16px;
}

.pool-history-card {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
    padding: 14px;
}

.pool-history-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    color: var(--text-secondary);
    font-size: 0.76rem;
}

.copy-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    margin-left: 8px;
}

.copy-btn:hover,
.copy-btn.copied {
    color: var(--green);
}

.discovery-page-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 14px;
    flex-wrap: wrap;
}

.discovery-pagination {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.page-btn {
    border: 1px solid var(--border-soft);
    background: var(--bg-elev-2);
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.78rem;
}

.page-btn.page-active {
    background: var(--bg-elev-3);
    color: var(--text-primary);
}

.page-btn.disabled,
.page-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.page-ellipsis {
    color: var(--text-muted);
    font-size: 0.78rem;
}

/* --- Status --- */
.status-banner {
    background: var(--bg-elev-1);
    border: 1px solid var(--border-soft);
    border-left-width: 4px;
    border-radius: var(--radius-sm);
    padding: 20px 22px;
    margin-bottom: 16px;
}

.status-operational { border-left-color: var(--green); }
.status-degraded { border-left-color: var(--orange); }
.status-disruption { border-left-color: var(--red); }

.status-banner-title {
    margin: 0;
    color: var(--text-primary);
    font-family: 'Sora', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
}

.status-banner-copy {
    margin: 8px 0 0;
    color: var(--text-secondary);
    font-size: 0.84rem;
}

.network-card {
    background: var(--bg-elev-2);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 16px;
}

.network-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.network-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
    margin-right: 8px;
}

.network-dot.active { background: var(--green); }
.network-dot.issue { background: var(--red); }

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: 0.84rem;
    font-weight: 600;
}

.rebalance-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 5, 12, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 120;
}

.modal-card {
    width: min(100%, 640px);
    background: var(--bg-elev-1);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 20px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.modal-title {
    margin: 0;
    color: var(--text-primary);
    font-family: 'Sora', sans-serif;
    font-size: 1rem;
}

.modal-copy {
    margin: 6px 0 0;
}

.modal-close {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.modal-close:hover {
    color: var(--text-primary);
}

/* --- Utilities / shared display --- */
.badge,
.chain-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
}

.badge-green { background: var(--green-soft); color: var(--green); }
.badge-orange { background: var(--orange-soft); color: var(--orange); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-dim { background: var(--bg-elev-3); color: var(--text-secondary); }
.chain-tag { background: rgba(255,255,255,0.05); color: var(--text-secondary); }

.text-muted { color: var(--text-muted); }
.hidden { display: none !important; }
.empty-state {
    color: var(--text-muted);
    text-align: center;
    padding: 24px 16px;
}

/* --- Skeletons --- */
.skel,
.skel-card,
.skel-pos-card,
.skel-stat-card,
.skel-table-row {
    position: relative;
    overflow: hidden;
}

.skel::after,
.skel-card::after,
.skel-pos-card::after,
.skel-stat-card::after,
.skel-table-row::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    animation: explorerShimmer 1.3s infinite;
}

.skel {
    display: block;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
}

.skel-label { width: 92px; height: 10px; margin-bottom: 10px; }
.skel-value { width: 140px; height: 18px; }
.skel-line { width: 100%; height: 12px; }
.skel-line-short { width: 68%; height: 10px; margin-top: 10px; }
.skel-canvas { width: 100%; height: 56px; margin-top: 12px; border-radius: var(--radius-xs); }
.skel-block { border-radius: var(--radius-xs); }

.skel-card,
.skel-pos-card {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
    background: var(--bg-elev-1);
    padding: 18px;
}

.skel-pos-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
}

.skel-table-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    padding: 12px 0;
}

@keyframes explorerShimmer {
    100% { transform: translateX(100%); }
}

/* --- Accessibility --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Responsive --- */
@media (max-width: 1100px) {
    .explorer-header-bar,
    .overview-grid,
    .status-grid,
    .pool-detail-card {
        grid-template-columns: 1fr;
    }

    .explorer-search-shell {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .explorer-shell {
        gap: 18px;
    }

    .explorer-search-form,
    .detail-header,
    .discovery-page-footer {
        grid-template-columns: 1fr;
        display: grid;
    }

    .pools-toolbar,
    .explorer-section-head {
        flex-direction: column;
        align-items: stretch;
    }

    .explorer-table {
        font-size: 0.78rem;
    }

    .explorer-table th,
    .explorer-table td {
        padding: 12px 10px;
    }

    .tx-pagination {
        grid-template-columns: 1fr 1fr;
    }

    .tx-pagination-status,
    .tx-pagination-range {
        text-align: left;
    }
}
