/* CheckYourMorpho: Components CSS */

/* --- 1. SEARCH BAR & DROPDOWN --- */
.search-container {
  position: relative;
  width: 340px;
  max-width: 100%;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(18, 18, 18, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  padding: 8px 16px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.search-box:focus-within {
  background: rgba(22, 22, 22, 0.95);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25), 0 4px 20px rgba(0, 0, 0, 0.6);
}

.search-icon {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 13px;
  font-family: var(--font-sans);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-shortcut {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  user-select: none;
}

/* Autocomplete Dropdown Right-Aligned */
.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 420px;
  max-width: 90vw;
  background: rgba(14, 14, 14, 0.95);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  z-index: 100;
  max-height: 380px;
  display: flex;
  flex-direction: column;
}

.dropdown-header {
  display: flex;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.02);
}

.results-list {
  list-style: none;
  overflow-y: auto;
  padding: 6px;
}

.result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.result-item:hover, .result-item.selected {
  background: rgba(255, 255, 255, 0.08);
}

.result-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.result-chain {
  font-size: 9px;
  font-family: var(--font-mono);
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.result-chain.base, .result-chain.robinhood {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.result-names {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.result-title {
  font-size: 13px;
  font-weight: 500;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.result-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
  font-family: var(--font-mono);
}

.result-liq {
  font-size: 12px;
  font-weight: 500;
  color: #ffffff;
}

.result-apy {
  font-size: 11px;
  color: var(--accent-green);
}

/* --- 2. FLOATING LEFT AUDIT TERMINAL (Morphs from 3D particle) --- */
.audit-panel-widget {
  position: fixed;
  top: 18px;
  bottom: 18px;
  left: 20px;
  width: 480px;
  max-width: calc(50vw - 30px);
  z-index: 25;
  display: flex;
  flex-direction: column;
  background: rgba(14, 14, 14, 0.88);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 16px 18px 14px 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: opacity 400ms cubic-bezier(0.16, 1, 0.3, 1), transform 400ms cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.audit-panel-widget.hidden {
  opacity: 0;
  transform: translateX(-40px) scale(0.96);
  pointer-events: none;
}

/* Panel Header */
.audit-panel-header {
  flex-shrink: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.audit-header-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.audit-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.audit-fav-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.audit-fav-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.06);
}

.audit-fav-btn.active {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
}

.audit-fav-btn.active svg {
  fill: #ffffff;
  stroke: #ffffff;
}

.audit-close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.audit-close-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.06);
}

.audit-identity-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.audit-identity-meta {
  min-width: 0;
  flex: 1;
}

.audit-identity-meta .vault-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mini-Tabs Segmented Bar */
.audit-nav-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 3px;
  margin-top: 6px;
}

.audit-nav-tab {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 6px 10px;
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  white-space: nowrap;
}

.audit-nav-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}

.audit-nav-tab.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Scrollable Panel Body */
.audit-panel-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 4px 6px 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
  transition: opacity 200ms ease;
}

.audit-panel-body::-webkit-scrollbar {
  width: 5px;
}

.audit-panel-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.audit-tab-panel {
  display: none;
  animation: fadeInTab 220ms ease forwards;
}

.audit-tab-panel.active {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

@keyframes fadeInTab {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Compact Financials Grid */
.compact-financials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 10px;
}

.compact-financials-grid .fin-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.compact-financials-grid .fin-value {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vault-badges {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.badge {
  font-size: 9px;
  font-family: var(--font-mono);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
}

.badge-chain,
.badge-chain.ethereum,
.badge-chain.base,
.badge-chain.robinhood,
.badge-chain.arbitrum,
.badge-chain.optimism,
.badge-chain.polygon {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.badge-version {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.badge-listed {
  background: rgba(48, 209, 88, 0.15);
  color: var(--accent-green);
}

.vault-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #ffffff;
  line-height: 1.2;
}

.vault-curator {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.vault-curator span {
  color: #ffffff;
  font-weight: 500;
}

/* Safety Score Pill */
.safety-score-pill {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 8px 14px;
}

.score-label {
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}

.score-value-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.score-grade {
  font-size: 20px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent-green);
}

.score-number {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

/* Financial Highlights Row (Photo 4) */
.financials-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 0;
}

.fin-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fin-label {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.fin-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  font-family: var(--font-sans);
}

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

.fin-sub.highlight {
  color: #ffffff;
}

/* Vault Specifications Section */
.vault-specs-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.specs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.specs-title {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.spec-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  transition: border-color var(--transition-fast);
}

.spec-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.spec-label {
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.spec-value {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  font-family: var(--font-sans);
}

.spec-value.mono {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #ffffff;
}

.spec-sub {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* --- PANEL 2: RISK & EXIT AUDIT --- */
.panel-risk {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-section-title {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

.meter-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.meter-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

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

.meter-value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: #fff;
}

.meter-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  background: #ffffff;
  border-radius: 3px;
  transition: width 400ms ease;
}


.meter-fill.yellow {
  background: var(--accent-orange);
}

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

.twr-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.twr-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.twr-label {
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.twr-val {
  font-size: 15px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: #fff;
}

.curator-audit-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.curator-audit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.curator-audit-title {
  font-size: 12px;
  font-weight: 500;
  color: #fff;
}

.discipline-badge {
  font-size: 10px;
  font-family: var(--font-mono);
  background: rgba(48, 209, 88, 0.12);
  color: var(--accent-green);
  padding: 2px 6px;
  border-radius: 4px;
}

.curator-meta {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

/* Red Flags Section */
.red-flags-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.red-flags-header {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.flags-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 140px;
  overflow-y: auto;
}

.flag-item {
  font-size: 11px;
  padding: 8px 10px;
  border-radius: 6px;
  line-height: 1.4;
  border-left: 3px solid;
}

.flag-item.critical {
  background: rgba(255, 69, 58, 0.08);
  border-color: var(--accent-red);
  color: #ff9992;
}

.flag-item.high {
  background: rgba(255, 159, 10, 0.08);
  border-color: var(--accent-orange);
  color: #ffd188;
}

.flag-item.medium {
  background: rgba(255, 214, 10, 0.06);
  border-color: var(--accent-yellow);
  color: #ffe680;
}

.flag-item.clear {
  background: rgba(48, 209, 88, 0.06);
  border-color: var(--accent-green);
  color: #a8f0bc;
}

/* --- PANEL 3: UNDERLYING MARKETS --- */
.panel-markets {
  grid-column: 1 / 3;
  grid-row: 2 / 3;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.table-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 280px);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.table-wrapper::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  background: rgba(16, 16, 16, 0.96);
  backdrop-filter: blur(8px);
  z-index: 2;
}

.data-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-family: var(--font-mono);
  color: #ffffff;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

.tx-link {
  color: var(--accent-blue);
  text-decoration: none;
}

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

/* Responsive adjustments */
@media (max-width: 960px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .panel-main {
    grid-column: 1 / 2;
  }
  .panel-risk {
    grid-column: 1 / 2;
  }
  .panel-markets {
    grid-column: 1 / 2;
  }
  .financials-row {
    grid-template-columns: 1fr;
  }
}

/* --- 5A. PINNED VAULTS RICH INFORMATIONAL PILLS (LEFT DOCK) --- */
.pinned-rich-pills-container {
  position: fixed;
  top: 18px;
  bottom: 18px;
  left: 20px;
  width: 480px;
  max-width: calc(50vw - 30px);
  z-index: 15;
  pointer-events: none;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
  transition: opacity 320ms cubic-bezier(0.16, 1, 0.3, 1), transform 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

.pinned-rich-pills-container.hidden {
  opacity: 0;
  transform: translateX(-24px);
  pointer-events: none;
}

.pinned-rich-pills-container::-webkit-scrollbar {
  width: 4px;
}

.pinned-rich-pills-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

.pinned-rich-pill {
  pointer-events: auto;
  background: rgba(14, 14, 14, 0.88);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 220ms cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  user-select: none;
}

.pinned-rich-pill:hover {
  background: rgba(22, 22, 22, 0.94);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-2px);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.85);
}

.rich-pill-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.rich-pill-meta {
  min-width: 0;
  flex: 1;
}

.rich-pill-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.rich-pill-name {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

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

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

.rich-pill-mqi-badge {
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  letter-spacing: 0.03em;
  background: rgba(255, 255, 255, 0.04);
}

.rich-pill-mqi-badge.clean {
  color: var(--accent-green);
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.08);
}

.rich-pill-mqi-badge.flagged {
  color: var(--accent-orange);
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.08);
}

.rich-pill-star-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all var(--transition-fast);
}

.rich-pill-star-btn svg {
  fill: #ffffff;
}

.rich-pill-star-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.1);
}

.rich-pill-fin-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 0.8fr;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.rich-pill-fin-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.rich-pill-fin-label {
  font-size: 9px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rich-pill-fin-val {
  font-size: 13px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
}

.rich-pill-fin-val.green {
  color: var(--accent-green);
}

.rich-pill-fin-sub {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rich-pill-fin-sub.highlight {
  color: #a3a3a3;
  font-family: var(--font-mono);
}

/* Flying Ball Proxy for Pinned Rich Pills */
.rich-pill-fly-orb {
  position: fixed;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.8), 0 0 32px rgba(255, 255, 255, 0.4);
  pointer-events: none;
  z-index: 50;
  transition: left 440ms cubic-bezier(0.16, 1, 0.3, 1), top 440ms cubic-bezier(0.16, 1, 0.3, 1), opacity 440ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- 5. MASTER VAULT EXPLORER TERMINAL (FLOATING ROUNDED PILL CARD) --- */
.vault-explorer-widget {
  position: fixed;
  top: 18px;
  bottom: 18px;
  right: 20px;
  width: 480px;
  max-width: calc(50vw - 30px);
  z-index: 15;
  display: flex;
  flex-direction: column;
  background: rgba(14, 14, 14, 0.88);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 16px 18px 14px 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: opacity 350ms cubic-bezier(0.16, 1, 0.3, 1), transform 350ms cubic-bezier(0.16, 1, 0.3, 1);
}

.vault-explorer-widget.hidden {
  opacity: 0;
  transform: translateX(36px);
  pointer-events: none;
}

/* Header */
.explorer-header {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.explorer-tag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.explorer-tag {
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.explorer-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.explorer-fav-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 2px 7px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  transition: all 160ms ease;
}

.explorer-fav-filter-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.explorer-fav-filter-btn.active {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.6);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
}

.explorer-fav-filter-btn.active svg {
  fill: #ffffff;
  stroke: #ffffff;
}

.explorer-fav-filter-btn .fav-filter-count {
  font-size: 10px;
  font-family: var(--font-mono);
}

.vault-item-star-btn {
  background: transparent;
  border: none;
  padding: 2px 4px 2px 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.28);
  transition: all 150ms ease;
  flex-shrink: 0;
}

.vault-item-star-btn:hover {
  color: #ffffff;
  transform: scale(1.15);
}

.vault-item-star-btn.active {
  color: #ffffff;
}

.vault-item-star-btn.active svg {
  fill: #ffffff;
  stroke: #ffffff;
}

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

.explorer-heading {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.01em;
}

/* Search Box */
.explorer-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 10px;
  transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
}

.explorer-search-box:focus-within {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2), 0 4px 16px rgba(0, 0, 0, 0.6);
}

.explorer-search-box .search-icon {
  width: 14px;
  height: 14px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.explorer-search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 12px;
  font-family: var(--font-sans);
  min-width: 0;
}

.explorer-search-box input::placeholder {
  color: var(--text-muted);
}

.search-clear-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.search-clear-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.explorer-search-box .search-shortcut {
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1px 5px;
  border-radius: 4px;
  user-select: none;
  cursor: pointer;
  flex-shrink: 0;
}

/* Custom Dropdown Filters Grid */
.explorer-filters-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 10px;
  position: relative;
}

.custom-dropdown {
  position: relative;
  width: 100%;
}

.custom-dropdown.open {
  z-index: 90;
}

.dropdown-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: rgba(18, 18, 18, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
  outline: none;
  user-select: none;
}

.dropdown-trigger:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(26, 26, 26, 0.95);
}

.dropdown-trigger.open,
.custom-dropdown.open .dropdown-trigger {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(26, 26, 26, 0.98);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.dropdown-trigger.is-active {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
}

.dropdown-trigger.is-active .trigger-value {
  color: #ffffff;
  font-weight: 600;
}

.trigger-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}

.trigger-label {
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
}

.trigger-value {
  font-size: 11px;
  font-family: var(--font-sans);
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.dropdown-chevron {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1), color 200ms ease;
}

.custom-dropdown.open .dropdown-chevron {
  transform: rotate(180deg);
  color: #ffffff;
}

/* Floating Dropdown Menu */
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  min-width: 185px;
  max-height: 240px;
  overflow-y: auto;
  background: rgba(16, 16, 16, 0.98);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.88), 0 0 0 1px rgba(255, 255, 255, 0.08);
  padding: 4px;
  z-index: 100;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.custom-dropdown:nth-child(even) .dropdown-menu {
  left: auto;
  right: 0;
}

.custom-dropdown.open .dropdown-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: dropdownFadeIn 140ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 6px;
  font-size: 11px;
  color: #d4d4d8;
  cursor: pointer;
  user-select: none;
  transition: all var(--transition-fast);
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.dropdown-item.selected {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-weight: 600;
}

.item-text {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-check {
  width: 12px;
  height: 12px;
  stroke: #ffffff;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.dropdown-item.selected .item-check {
  opacity: 1;
}

/* Chain Indicator Dots */
.chain-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  opacity: 0.9;
}

.chain-dot.ethereum {
  background: #e4e4e7;
}

.chain-dot.base {
  background: #3b82f6;
}

.chain-dot.robinhood {
  background: #10b981;
}

.chain-dot.arbitrum {
  background: #06b6d4;
}

.chain-dot.optimism {
  background: #ef4444;
}

.chain-dot.polygon {
  background: #a855f7;
}

/* Active Filter Chips & Clear Toolbar */
.active-filter-chips {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  animation: dropdownFadeIn 150ms ease;
}

.chips-container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 10px;
  font-family: var(--font-sans);
  color: #ffffff;
  white-space: nowrap;
}

.chip-label {
  font-weight: 500;
}

.chip-remove {
  background: transparent;
  border: none;
  color: #a1a1aa;
  cursor: pointer;
  padding: 0;
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.chip-remove:hover {
  color: #ffffff;
  transform: scale(1.2);
}

.filter-reset-action {
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 500;
  color: #f87171;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 5px;
  padding: 3px 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.filter-reset-action:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.35);
  color: #ffffff;
}

/* Vaults List */
.explorer-vaults-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 -4px;
  padding: 4px 6px 8px 6px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.explorer-vaults-list::-webkit-scrollbar {
  width: 4px;
}

.explorer-vaults-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

/* Individual Vault Item Card */
.explorer-vault-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  user-select: none;
  content-visibility: auto;
  contain-intrinsic-size: 0 46px;
  position: relative;
}

.explorer-vault-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  transform: translateY(-1px);
}

.vault-item-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.vault-item-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.vault-chain-badge {
  font-size: 9px;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #d4d4d8;
  flex-shrink: 0;
}

.vault-chain-badge.robinhood,
.vault-chain-badge.base,
.vault-chain-badge.ethereum,
.vault-chain-badge.arbitrum,
.vault-chain-badge.optimism,
.vault-chain-badge.polygon {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #d4d4d8;
}

.vault-item-name {
  font-size: 13px;
  font-weight: 500;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vault-item-sub {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vault-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  flex-shrink: 0;
}

.vault-item-tvl {
  font-size: 13px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: #ffffff;
}

.vault-item-apy {
  font-size: 11px;
  font-family: var(--font-mono);
  color: #30d158;
}

.vault-mini-badge {
  display: inline-block;
  font-size: 9.5px;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 0.5px 5px;
  border-radius: 3px;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.vault-mini-badge.clean {
  background: rgba(48, 209, 88, 0.12);
  color: #30d158;
  border: 1px solid rgba(48, 209, 88, 0.25);
}

.vault-mini-badge.flagged {
  background: rgba(255, 69, 58, 0.15);
  color: #ff453a;
  border: 1px solid rgba(255, 69, 58, 0.35);
}

.vault-item-hhi-pill {
  font-size: 9.5px;
  font-family: var(--font-mono);
  color: #a1a1aa;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.5px 5px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* --- 6. TABLET RESPONSIVE (769px - 1024px) --- */
@media (min-width: 769px) and (max-width: 1024px) {
  .vault-explorer-widget,
  .audit-panel-widget,
  .pinned-rich-pills-container {
    width: 440px;
    max-width: calc(50vw - 20px);
  }
}

/* --- 7. MOBILE RESPONSIVE (<= 768px: iPhone, Android, Compact Screens) --- */
@media (max-width: 768px) {
  /* Completely hide 3D particle sphere on mobile to eliminate GPU lag */
  #sphere-wrapper,
  .sphere-wrapper,
  #sphere-canvas,
  #overlay-canvas {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  /* Compact Mobile Header hidden on mobile (brand and controls are in explorer header) */
  .app-header {
    display: none !important;
  }

  /* Pinned Vaults (Left Dock) -> Hidden on mobile (accessible via star filter in explorer) */
  #pinned-rich-pills,
  .pinned-rich-pills-container {
    display: none !important;
  }

  /* Master Vault Explorer -> Full Screen Native View */
  .vault-explorer-widget {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100% !important;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    border: none;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 14px calc(14px + env(safe-area-inset-bottom, 0px)) 14px;
    background: #000000;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    z-index: 10;
  }

  /* No drawer handle for full-screen view */
  .vault-explorer-widget::before {
    display: none !important;
  }

  .vault-explorer-widget.hidden {
    opacity: 0;
    transform: none;
    pointer-events: none;
  }

  .explorer-header {
    margin-bottom: 10px;
    padding-bottom: 8px;
    flex-shrink: 0;
  }

  .explorer-heading {
    font-size: 18px;
  }

  .explorer-search-box {
    height: 42px;
    margin-bottom: 10px;
    padding: 0 12px;
    flex-shrink: 0;
  }

  .search-shortcut {
    display: none !important;
  }

  .explorer-filters-grid {
    gap: 8px;
    margin-bottom: 10px;
    flex-shrink: 0;
  }

  .dropdown-trigger {
    padding: 6px 9px;
  }

  .trigger-label {
    font-size: 8.5px;
  }

  .trigger-value {
    font-size: 11px;
  }

  .active-filter-chips {
    flex-shrink: 0;
    margin-bottom: 8px;
  }

  .explorer-vaults-list {
    gap: 8px;
    padding-right: 0;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    overflow-y: auto;
  }

  .explorer-vault-item {
    padding: 10px 12px;
    border-radius: 10px;
  }

  .vault-item-name {
    font-size: 13px;
  }

  .vault-item-sub {
    font-size: 10.5px;
  }

  .vault-item-fin-val {
    font-size: 13px;
  }

  .vault-item-fin-sub {
    font-size: 10px;
  }

  /* Floating Audit Terminal -> Full Mobile Bottom Sheet */
  .audit-panel-widget {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100% !important;
    height: 92vh;
    height: 92dvh;
    border-radius: 24px 24px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    padding: 10px 16px calc(16px + env(safe-area-inset-bottom, 0px)) 16px;
    z-index: 60;
    background: rgba(14, 14, 14, 0.98);
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.98);
    transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1), opacity 280ms ease;
  }

  /* Audit Mobile Sheet Drag Handle */
  .audit-panel-widget::before {
    content: "";
    display: block;
    width: 38px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.28);
    margin: 0 auto 10px auto;
    flex-shrink: 0;
  }

  .audit-panel-widget.hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
  }

  .audit-panel-header {
    padding-bottom: 10px;
  }

  .audit-hero-info {
    margin-bottom: 8px;
  }

  .audit-vault-name {
    font-size: 16px;
  }

  .audit-panel-body {
    padding: 10px 0 6px 0;
    -webkit-overflow-scrolling: touch;
  }

  .compact-financials-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 10px 8px;
  }

  .compact-financials-grid .fin-value {
    font-size: 13.5px;
  }

  .compact-financials-grid .fin-label {
    font-size: 8.5px;
  }

  .compact-financials-grid .fin-sub {
    font-size: 9px;
  }

  .table-wrapper {
    max-height: 42vh;
    -webkit-overflow-scrolling: touch;
  }

  .data-table th, .data-table td {
    padding: 5px 6px;
  }
}

