/* =========================================
   GOVERNANCE VAULT (vibe-vault.html)
   Builds on style.css tokens: --accent, --success, --warning, --card-*
   ========================================= */
:root {
  --vv-gold: var(--warning);
  --vv-gold-soft: rgba(249, 224, 97, 0.12);
  --vv-violet: rgba(124, 58, 237, 0.35);
  --vv-line: rgba(255, 255, 255, 0.07);
  --vv-radius: 20px;
}

.vv-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; }
.vv-sub { margin: 4px 0 0; color: var(--text-muted); font-size: .88rem; }

/* ---------- HERO ---------- */
.vv-hero {
  position: relative; overflow: hidden;
  border-radius: 24px; padding: 28px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(249,224,97,.10) 0%, transparent 45%),
    radial-gradient(120% 140% at 100% 0%, var(--vv-violet) 0%, transparent 50%),
    linear-gradient(180deg, rgba(30,34,48,.85), rgba(16,18,30,.85));
  border: 1px solid rgba(249,224,97,.18);
  box-shadow: var(--glass-shadow);
}
.vv-hero-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.vv-hero-id { display: flex; align-items: center; gap: 14px; }
.vv-token-logo {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0,0,0,.35);
  box-shadow: 0 0 0 1px rgba(249,224,97,.35), 0 0 28px rgba(249,224,97,.25);
}
.vv-token-logo img { border-radius: 50%; }
.vv-eyebrow { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
.vv-hero-title { margin: 4px 0 0; font-size: 1.45rem; font-weight: 700; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vv-chip {
  font-size: .75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  color: var(--vv-gold); background: var(--vv-gold-soft); border: 1px solid rgba(249,224,97,.25);
}
.vv-token-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.vv-pill {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 8px 14px; border-radius: 999px; font: inherit; font-size: .84rem; font-weight: 600;
  color: #fff; background: rgba(255,255,255,.05); border: 1px solid var(--vv-line);
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}
.vv-pill:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.18); transform: translateY(-1px); }
.vv-pill-accent { color: #000; background: var(--vv-gold); border-color: transparent; }
.vv-pill-accent:hover { background: #ffe97f; }

.vv-kpis { margin-top: 24px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.vv-kpi {
  display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: 16px;
  background: rgba(0,0,0,.22); border: 1px solid var(--vv-line);
}
.vv-kpi-label { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.vv-kpi-value { font-size: 1.45rem; font-weight: 700; letter-spacing: -.02em; min-height: 1.9rem; font-variant-numeric: tabular-nums; }
.vv-kpi-sub { font-size: .78rem; color: var(--text-muted); }

/* ---------- CARDS ---------- */
.vv-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px; }
.vv-card {
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--vv-radius);
  padding: 24px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--glass-shadow); min-width: 0;
}
.vv-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.vv-card-head h3 { margin: 0; font-size: 1.08rem; font-weight: 700; }
.vv-link { color: var(--success); font-size: .86rem; font-weight: 600; }
.vv-link:hover { text-decoration: underline; }
.vv-badge {
  font-size: .74rem; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  color: var(--text-muted); background: rgba(255,255,255,.05); border: 1px solid var(--vv-line);
}
.vv-badge.on { color: var(--success); background: rgba(0,224,255,.08); border-color: rgba(0,224,255,.25); }

/* Rewards card */
.vv-rewards {
  background: linear-gradient(180deg, rgba(30,34,48,.85) 0%, rgba(249,224,97,.06) 100%);
  border-color: rgba(249,224,97,.2);
}
.vv-claim-label { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.vv-claim-value {
  margin: 6px 0 18px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; color: var(--vv-gold);
  text-shadow: 0 0 24px rgba(249,224,97,.25); font-variant-numeric: tabular-nums; word-break: break-all;
}
.vv-unit { font-size: 1rem; font-weight: 600; color: rgba(255,255,255,.7); text-shadow: none; }
.vv-rows { display: flex; flex-direction: column; border-top: 1px solid var(--vv-line); }
.vv-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--vv-line); font-size: .9rem; color: var(--text-muted); }
.vv-row strong { color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.vv-btn-claim { margin-top: 18px; transition: transform var(--transition-fast), box-shadow var(--transition-fast); }
.vv-btn-claim:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(249,224,97,.45); }
.vv-status { margin-top: 10px; font-size: .85rem; min-height: 1.2em; color: var(--success); }
.vv-status.err { color: var(--danger); }

/* Positions */
.vv-positions { display: flex; flex-direction: column; gap: 10px; }
.vv-pos {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: center;
  padding: 14px 16px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--vv-line);
}
.vv-pos-k { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.vv-pos-v { display: block; font-weight: 600; font-variant-numeric: tabular-nums; }
.vv-pos-v.gold { color: var(--vv-gold); }
.vv-empty { padding: 28px 16px; text-align: center; color: var(--text-muted); font-size: .9rem; border: 1px dashed var(--vv-line); border-radius: 14px; }

/* ---------- TABLE ---------- */
.vv-meta { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--text-muted); }
.vv-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #555; }
.vv-live-dot.on { background: var(--success); box-shadow: 0 0 0 0 rgba(0,224,255,.6); animation: vv-pulse 2s infinite; }
@keyframes vv-pulse { 70% { box-shadow: 0 0 0 8px rgba(0,224,255,0); } 100% { box-shadow: 0 0 0 0 rgba(0,224,255,0); } }

.vv-table-wrap { position: relative; overflow-x: auto; margin: 0 -8px; }
.vv-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.vv-table th {
  text-align: left; padding: 10px 12px; font-size: .72rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid var(--vv-line); white-space: nowrap;
}
.vv-table td { padding: 16px 12px; border-bottom: 1px solid var(--vv-line); font-variant-numeric: tabular-nums; vertical-align: middle; }
.vv-table tbody tr { transition: background var(--transition-fast); }
.vv-table tbody tr:hover { background: rgba(255,255,255,.03); }
.vv-table tbody tr:last-child td { border-bottom: none; }
.vv-table .r { text-align: right; }
.vv-asset { display: flex; align-items: center; gap: 12px; }
.vv-asset img { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.06); }
.vv-asset b { display: block; font-weight: 600; }
.vv-asset small { color: var(--text-muted); font-size: .78rem; }
.vv-amt { display: block; font-weight: 600; }
.vv-usd { display: block; color: var(--text-muted); font-size: .78rem; }
.vv-apr {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-weight: 700; font-size: .86rem;
  color: var(--vv-gold); background: var(--vv-gold-soft);
}
.vv-apr img { width: 14px; height: 14px; }
.vv-apr.off { color: var(--text-muted); background: rgba(255,255,255,.04); font-weight: 500; }
.vv-btn-sm {
  padding: 7px 12px; border-radius: 10px; font-size: .8rem; font-weight: 600; white-space: nowrap;
  color: #fff; background: rgba(255,255,255,.06); border: 1px solid var(--vv-line); transition: all var(--transition-fast);
}
.vv-btn-sm:hover { background: var(--accent); border-color: var(--accent); }
.vv-off-row td { opacity: .55; }

/* ---------- STEPS / CONTRACTS ---------- */
.vv-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.vv-step { padding: 18px; border-radius: 16px; background: rgba(255,255,255,.03); border: 1px solid var(--vv-line); }
.vv-step h4 { margin: 10px 0 6px; font-size: .98rem; }
.vv-step p { margin: 0; color: var(--text-muted); font-size: .88rem; line-height: 1.55; }
.vv-step a { color: var(--success); }
.vv-step-n {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  font-size: .82rem; font-weight: 700; color: #000; background: var(--vv-gold);
}
.vv-contracts { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px 28px; font-size: .84rem; color: var(--text-muted); }
.vv-contracts > div { display: flex; gap: 8px; align-items: center; }
.vv-contracts a { color: #fff; }
.vv-contracts a:hover { color: var(--success); }

/* ---------- TOOLTIP ---------- */
.vv-info {
  position: relative; display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: 4px; padding: 0;
  border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: transparent; color: var(--text-muted);
  font: 700 .66rem/1 var(--font-main); cursor: help; vertical-align: middle; text-transform: none; letter-spacing: 0;
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}
/* Bigger invisible hit area for touch screens */
.vv-info::before { content: ""; position: absolute; inset: -8px; }
.vv-info:hover, .vv-info[aria-expanded="true"] { color: #000; background: var(--vv-gold); border-color: var(--vv-gold); }

/* Floating tooltip, mounted on <body> by main-vault.js so no card, sidebar or
   scroll container can clip or cover it. Above the mobile drawer (1000), below modals (9999). */
.vv-tooltip {
  position: fixed; z-index: 1500; top: 0; left: 0; max-width: min(280px, calc(100vw - 24px));
  padding: 10px 12px; border-radius: 10px; background: #141726; border: 1px solid rgba(249,224,97,.25);
  color: #dfe6ef; font: 400 .8rem/1.5 var(--font-main); text-align: left; text-transform: none; letter-spacing: 0;
  box-shadow: 0 12px 32px rgba(0,0,0,.55); pointer-events: none;
  opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.vv-tooltip.show { opacity: 1; visibility: visible; transform: none; }
.vv-tooltip::after {
  content: ""; position: absolute; left: var(--vv-arrow-x, 50%); width: 10px; height: 10px; margin-left: -5px;
  background: #141726; transform: rotate(45deg);
}
.vv-tooltip[data-side="top"]::after { bottom: -6px; border-right: 1px solid rgba(249,224,97,.25); border-bottom: 1px solid rgba(249,224,97,.25); }
.vv-tooltip[data-side="bottom"]::after { top: -6px; border-left: 1px solid rgba(249,224,97,.25); border-top: 1px solid rgba(249,224,97,.25); }

/* ---------- SKELETON ---------- */
.vv-sk {
  display: inline-block; width: 90px; height: 1.1em; border-radius: 6px; vertical-align: middle;
  background: linear-gradient(90deg, rgba(255,255,255,.05) 25%, rgba(255,255,255,.12) 50%, rgba(255,255,255,.05) 75%);
  background-size: 200% 100%; animation: vv-shimmer 1.4s infinite;
}
.vv-sk-wide { width: 100%; height: 28px; }
@keyframes vv-shimmer { to { background-position: -200% 0; } }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1100px) {
  .vv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vv-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .vv-hero, .vv-card { padding: 18px; }
  .vv-kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .vv-kpi-value { font-size: 1.15rem; }
  .vv-claim-value { font-size: 2.1rem; }
  .vv-steps { grid-template-columns: 1fr; }
  .vv-pos { grid-template-columns: 1fr 1fr; }
  .vv-pos > :first-child { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .vv-sk, .vv-live-dot.on { animation: none; }
  .vv-tooltip { transition: none; }
}
