@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ---------------------------------------------------------------- tokens */
:root {
  --bg-deep: #03050a;
  --bg: #060913;
  --bg-elevated: #0d121d;
  --panel: #101622;
  --panel-soft: rgba(255,255,255,0.035);
  --panel-hover: rgba(255,255,255,0.065);
  --border: rgba(148,163,196,0.17);
  --border-soft: rgba(148,163,196,0.105);
  --border-strong: rgba(174,187,216,0.32);

  --blue-50: #eef4ff;
  --blue-100: #dce8ff;
  --blue-200: #b8d1ff;
  --blue-300: #8fb6ff;
  --blue-400: #6499ff;
  --blue-500: #4b82f7;
  --blue-600: #3768db;
  --blue-700: #2a52b0;
  --blue-glow: rgba(100,153,255,0.45);

  /* purple family */
  --purple-400: #9b7bff;
  --purple-500: #7f5bff;
  --purple-600: #6340e0;
  --purple-glow: rgba(127, 91, 255, 0.45);

  /* gold family */
  --gold-400: #f0c040;
  --gold-500: #d4a820;
  --gold-dim:  rgba(240, 192, 64, 0.14);

  --text: #f2f5fb;
  --text-dim: #a5aec2;
  --text-faint: #778197;

  --green: #3ddc97;
  --green-dim: rgba(61,220,151,0.14);
  --red: #f26d6d;
  --red-dim: rgba(242,109,109,0.14);
  --amber: #f2b84b;
  --amber-dim: rgba(242,184,75,0.14);

  --radius-sm: 7px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.28), 0 0 0 1px rgba(255,255,255,0.015);
  --shadow-md: 0 10px 30px -18px rgba(0,0,0,0.75);
  --shadow-lg: 0 22px 70px -30px rgba(0,0,0,0.78);
  --shadow-glow: 0 0 0 1px rgba(100,153,255,0.20), 0 10px 28px -14px rgba(75,130,247,0.55);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 0.15s;
  --dur: 0.28s;
  --dur-slow: 0.5s;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, "SF Mono", Menlo, monospace;

  --sidebar-w: 248px;
  --topbar-h: 72px;
}

* { box-sizing: border-box; }
html {
  color-scheme: dark;
  scrollbar-color: rgba(127, 91, 255, 0.35) transparent;
  scrollbar-width: thin;
}
body {
  background: var(--bg);
  color: var(--text);
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: var(--font); margin: 0; }
a { color: inherit; }
button { font-family: var(--font); }
.hidden { display: none !important; }
.mono { font-family: var(--font-mono); }

::-webkit-scrollbar              { width: 5px; height: 5px; }
::-webkit-scrollbar-track        { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(127, 91, 255, 0.35);
  border-radius: 99px;
  box-shadow: 0 0 6px rgba(127, 91, 255, 0.4);
  transition: background 0.2s;
}
::-webkit-scrollbar-thumb:hover  { background: rgba(127, 91, 255, 0.6); }

/* ------------------------------------------------------------- bg effect */
#bg-fx {
  position: fixed; inset: -22px; z-index: 0; overflow: hidden; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(12,18,32,0.96) 0%, var(--bg-deep) 48%, #02040a 100%),
    radial-gradient(ellipse 90% 52% at 50% -10%, rgba(75,130,247,0.20), transparent 58%);
  transition: transform 0.3s var(--ease-out);
  will-change: transform;
}
#bg-fx::after {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.025;
  mix-blend-mode: overlay;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.12;
  will-change: transform;
}
.blob-1 { width: 520px; height: 520px; top: -160px; left: -120px; background: radial-gradient(circle, var(--blue-500), transparent 70%); animation: float-a 22s ease-in-out infinite; }
.blob-2 { width: 620px; height: 620px; top: 10%; right: -220px; background: radial-gradient(circle, var(--blue-300), transparent 70%); opacity: 0.08; animation: float-b 26s ease-in-out infinite; }
.blob-3 { width: 420px; height: 420px; bottom: -180px; left: 30%; background: radial-gradient(circle, #7f5bff, transparent 70%); opacity: 0.07; animation: float-c 30s ease-in-out infinite; }

@keyframes float-a { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(60px,40px) scale(1.08); } }
@keyframes float-b { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-50px,60px) scale(0.94); } }
@keyframes float-c { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(40px,-50px) scale(1.05); } }

/* ------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 9px 16px; font-size: 13px; font-weight: 700; cursor: pointer;
  font-family: var(--font); white-space: nowrap;
  overflow: hidden; position: relative;
  letter-spacing: 0;
  transition: transform var(--dur-fast) var(--ease), filter var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease);
}
.btn:active { transform: translateY(1px) scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: default; pointer-events: none; }

.btn-primary {
  background: linear-gradient(180deg, #6ca1ff, var(--blue-600));
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover { filter: brightness(1.04); box-shadow: 0 0 0 1px rgba(100,153,255,0.30), 0 12px 34px -16px rgba(75,130,247,0.72); }

.btn-secondary {
  background: rgba(255,255,255,0.045);
  border-color: var(--border);
  color: var(--text);
}
.btn-secondary:hover { background: rgba(255,255,255,0.075); border-color: var(--border-strong); }

.btn-ghost { background: transparent; color: var(--text-dim); border-color: transparent; }
.btn-ghost:hover { color: var(--text); background: var(--panel-soft); }

.btn-danger-ghost { background: transparent; color: var(--red); border-color: rgba(242,109,109,0.3); }
.btn-danger-ghost:hover { background: var(--red-dim); }

.btn-lg { padding: 13px 26px; font-size: 15px; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }

/* shimmer sweep overlay — positioned off-screen right at rest */
.btn-primary::before {
  content: '';
  position: absolute;
  top: -50%; left: 120%;
  width: 40%; height: 200%;
  background: linear-gradient(
    105deg,
    transparent,
    rgba(255,255,255,0.18),
    transparent
  );
  transform: skewX(-18deg);
  pointer-events: none;
  transition: none;
}
/* single-pass shimmer on hover: sweeps left→right over 0.6 s */
.btn-primary:hover::before {
  left: -60%;
  transition: left 0.6s var(--ease-out);
}

/* ripple wave span injected by JS on click */
.ripple-wave {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(255, 255, 255, 0.40);
  pointer-events: none;
  animation: ripple-expand 0.55s var(--ease-out) forwards;
}
@keyframes ripple-expand {
  to { transform: scale(4); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .btn-primary::before       { display: none; }
  .btn-primary:hover::before { display: none; }
}

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04); border: 1px solid var(--border); color: var(--text-dim);
  cursor: pointer; transition: all var(--dur-fast) var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: rgba(255,255,255,0.075); transform: translateY(-1px); }
.icon-btn svg { width: 17px; height: 17px; }

.spinner {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff;
  animation: spin 0.7s linear infinite; flex: none;
}
.spinner-dark { border-color: rgba(100,120,160,0.3); border-top-color: var(--blue-400); }
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------- inputs */
label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; font-weight: 500; }
textarea, select, input[type=number], input[type=text] {
  width: 100%; background: rgba(3,6,13,0.66); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm); padding: 10px 12px;
  font-size: 13.5px; font-family: var(--font); outline: none;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
textarea:hover, select:hover, input[type=number]:hover, input[type=text]:hover {
  border-color: rgba(174,187,216,0.25);
  background: rgba(6,10,19,0.78);
}
textarea { font-family: var(--font-mono); min-height: 76px; resize: vertical; line-height: 1.5; }
textarea:focus, select:focus, input:focus {
  border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(75,130,247,0.18);
}
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2397a1b8' stroke-width='2'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; cursor: pointer; }

.field { margin-bottom: 0; }
.toggle-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-dim); margin: 14px 0 0; cursor: pointer; }
.toggle-row input { width: auto; accent-color: var(--blue-500); }

.segmented { display: inline-flex; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; gap: 2px; position: relative; }
.segmented-thumb {
  position: absolute; top: 3px; bottom: 3px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-600));
  box-shadow: var(--shadow-sm), 0 0 12px rgba(75,130,247,0.35);
  transition: left 0.25s var(--ease-out), width 0.25s var(--ease-out);
  pointer-events: none;
}
.segmented button {
  border: none; background: transparent; color: var(--text-dim); font-family: var(--font);
  font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 6px; cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}
.segmented button { position: relative; z-index: 1; }
.segmented button.active { color: #fff; }
.segmented:not(:has(.segmented-thumb)) button.active { background: var(--blue-500); box-shadow: var(--shadow-sm); }
.segmented button:not(.active):hover { color: var(--text); background: var(--panel-hover); }

/* -------------------------------------------------------------- landing */
.landing { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
.landing-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 40px; max-width: 1240px; margin: 0 auto; width: 100%;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; letter-spacing: -0.2px; }
.brand-name, .sidebar-brand .brand-name { white-space: nowrap; line-height: 1; }
.beta-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--amber);
  background: rgba(242, 184, 75, 0.12);
  border: 1px solid rgba(242, 184, 75, 0.3);
  border-radius: var(--radius-full);
  line-height: 1;
  margin-left: 2px;
  vertical-align: middle;
  font-family: var(--font);
}
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px;
  display: block; object-fit: cover;
  box-shadow: 0 0 0 1px rgba(100,153,255,0.26), 0 10px 28px -16px rgba(75,130,247,0.70);
  flex: none;
}
.brand .accent { color: var(--blue-300); }

.landing-hero {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 40px 24px 20px; max-width: 880px; margin: 0 auto;
  animation: rise 0.7s var(--ease-out) both;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  color: var(--blue-200);
  background: rgba(75, 130, 247, 0.10);
  border: 1px solid rgba(100, 153, 255, 0.24);
  padding: 6px 14px; border-radius: var(--radius-full); margin-bottom: 22px;
}
.hero-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse-dot 2.4s ease-in-out infinite; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

.landing-hero h1 {
  font-size: clamp(32px, 5.2vw, 52px); font-weight: 800; line-height: 1.12; letter-spacing: -0.8px;
  margin-bottom: 18px;
}
.shimmer-text {
  background: linear-gradient(
    100deg,
    #8fb6ff 15%, #c4a8ff 30%,
    #ffffff 44%, #ffffff 56%,
    #c4a8ff 70%, #8fb6ff 85%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer-sweep 8s linear infinite;
  font-weight: 900;
  letter-spacing: -0.8px;
}
@keyframes shimmer-sweep {
  0% { background-position: 160% 0; }
  50% { background-position: 0% 0; }
  100% { background-position: -160% 0; }
}

/* Stagger entrance targets start invisible */
.hero-badge, .landing-hero h1,
.landing-hero p, .hero-console,
.hero-actions {
  opacity: 0; transform: translateY(20px);
}

/* Applied by JS after IO fires */
.hero-entrance-done .hero-badge   { animation: hero-rise 0.65s var(--ease-out) 0.0s both; }
.hero-entrance-done h1            { animation: hero-rise 0.65s var(--ease-out) 0.1s both; }
.hero-entrance-done p             { animation: hero-rise 0.65s var(--ease-out) 0.2s both; }
.hero-entrance-done .hero-console { animation: hero-rise 0.65s var(--ease-out) 0.3s both; }
.hero-entrance-done .hero-actions { animation: hero-rise 0.65s var(--ease-out) 0.4s both; }

@keyframes hero-rise {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0);    }
}

.landing-hero p { font-size: clamp(13.5px, 1.6vw, 16.5px); color: var(--text-dim); max-width: 560px; line-height: 1.6; margin-bottom: 26px; }

.hero-console {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--blue-200);
  background: rgba(8,12,22,0.78); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 16px; margin-bottom: 30px; min-height: 40px; min-width: min(480px, 84vw);
  max-width: 100%; box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), var(--shadow-sm);
}
.hero-console-prompt { color: var(--blue-400); font-weight: 700; flex: none; }
.hero-console-text { white-space: nowrap; overflow: hidden; text-overflow: clip; }
.hero-console-cursor {
  width: 7px; height: 15px; background: var(--blue-300); flex: none;
  animation: blink-cursor 0.9s step-end infinite;
}
@keyframes blink-cursor { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.hero-actions { display: flex; gap: 14px; margin-bottom: 56px; flex-wrap: wrap; justify-content: center; }

.hero-stats {
  display: flex; align-items: stretch; justify-content: center;
  flex-wrap: wrap; gap: 0;
}
.stat {
  text-align: center;
  padding: 4px 32px;
  position: relative;
}
.stat + .stat::before {
  content: '';
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 1px; height: 30px;
  background: linear-gradient(180deg, transparent, var(--border-strong), transparent);
}
.stat-value {
  font-size: 20px; font-weight: 700; font-family: var(--font-mono);
  background: linear-gradient(135deg, var(--blue-200), var(--blue-400));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  white-space: nowrap;
}
.stat-label { font-size: 11.5px; color: var(--text-faint); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }

.landing-features {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  max-width: 1080px; width: 100%; margin: 0 auto; padding: 0 24px 60px;
}
.feature-card {
  background: rgba(12, 17, 27, 0.76);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: transform 0.35s var(--ease-out),
              box-shadow 0.35s var(--ease-out),
              border-color 0.35s var(--ease-out),
              opacity 0.6s var(--ease-out), translate 0.6s var(--ease-out);
}
.feature-card::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--purple-500), var(--blue-400), var(--gold-400));
  -webkit-mask: linear-gradient(#fff 0 0) content-box,
                linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.35s var(--ease-out);
  pointer-events: none;
}
.feature-card:hover::before { opacity: 1; }
.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 44px -28px rgba(75, 130, 247, 0.68);
  border-color: var(--border-strong);
}
.feature-icon {
  width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(100,153,255,0.18), rgba(100,153,255,0.05));
  border: 1px solid rgba(100,153,255,0.2); color: var(--blue-300); margin-bottom: 14px;
  transition: transform 0.3s var(--ease-out);
}
.feature-card:hover .feature-icon {
  transform: rotate(15deg) scale(1.1);
}
.feature-icon svg { width: 20px; height: 20px; }
.feature-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.feature-card p { font-size: 13px; color: var(--text-dim); line-height: 1.55; margin: 0; }

/* -------------------------------------------------------------------- faq */
.landing-faq { max-width: 760px; width: 100%; margin: 0 auto; padding: 20px 24px 80px; }
.section-title {
  font-size: clamp(20px, 3vw, 26px); font-weight: 800; text-align: center; letter-spacing: -0.4px;
  margin-bottom: 28px; color: var(--text);
}
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  background: var(--panel-soft); border: 1px solid var(--border-soft); border-radius: var(--radius);
  overflow: hidden; transition: border-color var(--dur) var(--ease);
}
.faq-item.open { border-color: var(--border-strong); }
.faq-question {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: none; border: none; text-align: left; cursor: pointer;
  padding: 16px 20px; font-family: var(--font); font-size: 14px; font-weight: 600; color: var(--text);
}
.faq-toggle { flex: none; width: 16px; height: 16px; color: var(--text-faint); transition: transform var(--dur) var(--ease); }
.faq-item.open .faq-toggle { transform: rotate(180deg); color: var(--blue-300); }
.faq-answer {
  display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.32s var(--ease-out);
}
.faq-answer p {
  overflow: hidden; min-height: 0; margin: 0; padding: 0 20px; font-size: 13.5px; color: var(--text-dim); line-height: 1.6;
}
.faq-item.open .faq-answer { grid-template-rows: 1fr; }
.faq-item.open .faq-answer p { padding: 0 20px 18px; }

/* --------------------------------------------------------- scroll reveal */
.feature-card, .faq-item, .section-title {
  opacity: 0; translate: 0 16px;
}
.feature-card.revealed, .faq-item.revealed, .section-title.revealed {
  opacity: 1; translate: 0 0;
  transition: opacity 0.6s var(--ease-out), translate 0.6s var(--ease-out);
}
.faq-item:nth-child(2).revealed { transition-delay: 0.05s; }
.faq-item:nth-child(3).revealed { transition-delay: 0.1s; }
.faq-item:nth-child(4).revealed { transition-delay: 0.15s; }
.faq-item:nth-child(5).revealed { transition-delay: 0.2s; }
.faq-item:nth-child(6).revealed { transition-delay: 0.25s; }

.landing-footer { text-align: center; padding: 20px 24px 32px; font-size: 11.5px; color: var(--text-faint); }

@media (prefers-reduced-motion: reduce) {
  .shimmer-text { animation: none; background-position: 0 0; }
  .hero-badge .dot, .hero-console-cursor { animation: none; }
  .blob { animation: none; }
  .feature-card:hover, .feature-card:hover .feature-icon {
    transform: none;
  }
  .feature-card::before { transition: none; }
}

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

/* ---------------------------------------------------------------- modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: rgba(5,7,13,0.7);
  backdrop-filter: blur(12px) saturate(1.8);
  -webkit-backdrop-filter: blur(12px) saturate(1.8);
  animation: fade-in var(--dur) var(--ease-out);
}
.modal {
  width: 460px; max-width: calc(100vw - 32px); background: var(--bg-elevated);
  border: 1px solid rgba(127, 91, 255, 0.26); border-radius: var(--radius);
  box-shadow:
    0 0 0 1px rgba(127, 91, 255, 0.15),
    0 24px 80px -16px rgba(0, 0, 0, 0.7),
    0 4px 24px rgba(127, 91, 255, 0.18);
  animation: modal-premium-in 0.4s var(--ease-out) both;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border-soft); }
.modal-header h3 { font-size: 15.5px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-dim); font-size: 20px; cursor: pointer; line-height: 1; padding: 4px; border-radius: 6px; transition: all var(--dur-fast) var(--ease); }
.modal-close:hover { color: var(--text); background: var(--panel-soft); }
.modal-body { padding: 22px; }
.modal-body .field + .field, .modal-body .field + .toggle-row { margin-top: 16px; }
.modal-body .btn { margin-top: 20px; }
.modal-hint { font-size: 11.5px; color: var(--text-faint); margin-top: 8px; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-premium-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.94);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .modal {
    animation: modal-reduced-in 0.4s var(--ease-out) both;
  }
  @keyframes modal-reduced-in {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
}

/* ------------------------------------------------------------- app shell */
.app-shell { position: relative; z-index: 1; display: flex; min-height: 100vh; animation: fade-in var(--dur-slow) var(--ease-out); }

.sidebar {
  width: var(--sidebar-w); flex: none; display: flex; flex-direction: column;
  border-right: 1px solid rgba(148,163,196,0.13);
  background: rgba(7, 11, 20, 0.86);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  padding: 20px 14px; position: sticky; top: 0; height: 100vh;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px 22px; font-weight: 800; font-size: 16.5px; letter-spacing: -0.2px;
  opacity: 0; animation: nav-item-rise 0.5s var(--ease-out) both;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; position: relative; }
.sidebar-nav .nav-item, .sidebar-bottom .nav-item {
  opacity: 0; animation: nav-item-rise 0.5s var(--ease-out) both;
}
.sidebar-nav .nav-item:nth-child(1) { animation-delay: 0.06s; }
.sidebar-nav .nav-item:nth-child(2) { animation-delay: 0.10s; }
.sidebar-nav .nav-item:nth-child(3) { animation-delay: 0.14s; }
.sidebar-nav .nav-item:nth-child(4) { animation-delay: 0.18s; }
.sidebar-nav .nav-item:nth-child(5) { animation-delay: 0.22s; }
.sidebar-nav .nav-item:nth-child(6) { animation-delay: 0.26s; }
.sidebar-bottom .nav-item { animation-delay: 0.32s; }
@keyframes nav-item-rise {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}
.topbar { opacity: 0; animation: fade-in 0.5s var(--ease-out) 0.15s both; }
.app-content { opacity: 0; animation: hero-rise 0.5s var(--ease-out) 0.2s both; }
@media (prefers-reduced-motion: reduce) {
  .sidebar-brand, .sidebar-nav .nav-item, .sidebar-bottom .nav-item, .topbar, .app-content {
    animation: none; opacity: 1;
  }
}
.nav-pill {
  position: absolute;
  left: 0; right: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg,
    rgba(75, 130, 247, 0.18),
    rgba(127, 91, 255, 0.10));
  border: 1px solid rgba(100, 153, 255, 0.20);
  pointer-events: none;
  z-index: 0;
  transition: top 0.3s var(--ease-out), height 0.3s var(--ease-out);
}
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: none; border: none; color: var(--text-dim); font-size: 13px; font-weight: 600;
  cursor: pointer; text-align: left; width: 100%; position: relative; z-index: 1;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.nav-item svg { width: 18px; height: 18px; flex: none; }
.nav-item:hover { background: var(--panel-soft); color: var(--text); }
.nav-item.active { background: linear-gradient(135deg, rgba(75,130,247,0.16), rgba(75,130,247,0.05)); color: var(--blue-200); font-weight: 600; }
.nav-item.active::before { display: none; }
.nav-badge {
  margin-left: auto; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 99px;
  background: var(--amber-dim); color: var(--amber);
}
.sidebar-bottom { border-top: 1px solid var(--border-soft); padding-top: 10px; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

.topbar {
  height: var(--topbar-h); flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; border-bottom: none; gap: 20px;
  background: rgba(7, 11, 20, 0.84);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  box-shadow: 0 1px 0 0 transparent;
  position: relative;
  z-index: 30;
}
.topbar::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, rgba(148,163,196,0.06), rgba(100,153,255,0.36), rgba(127,91,255,0.22), rgba(148,163,196,0.06));
}
@supports not (backdrop-filter: blur(1px)) {
  .topbar { background: rgba(5, 8, 16, 0.97); }
}
.topbar-left { display: flex; align-items: center; gap: 6px; }
.topbar-left h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.2px; }
.menu-toggle { display: none; margin-right: 6px; }
.view-subtitle { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.topbar-controls { display: flex; align-items: center; gap: 10px; flex: 1; justify-content: flex-end; }
.topbar-controls select, .topbar-controls input { width: auto; padding: 8px 10px; font-size: 12.5px; }
.topbar-controls .year-input { width: 92px; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex: none; }

.profile-menu { position: relative; }
.profile-btn {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border-radius: var(--radius-full);
  background: rgba(255,255,255,0.045); border: 1px solid var(--border); cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}
.profile-btn:hover { border-color: var(--border-strong); background: var(--panel-hover); }
.avatar { width: 26px; height: 26px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2); }
.avatar-lg { width: 42px; height: 42px; }
.profile-btn .addr { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); }
.profile-btn svg { width: 14px; height: 14px; color: var(--text-faint); transition: transform var(--dur-fast) var(--ease); }
.profile-btn.open svg { transform: rotate(180deg); }

.profile-dropdown {
  position: absolute; right: 0; top: calc(100% + 10px); width: 300px;
  background: rgba(12,17,27,0.98); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); z-index: 50; overflow: hidden;
  animation: dropdown-in 0.18s var(--ease-out);
}
@keyframes dropdown-in { from { opacity: 0; transform: translateY(-6px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.dropdown-section { padding: 12px 14px; }
.dropdown-section + .dropdown-section { border-top: 1px solid var(--border-soft); }
.dropdown-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-faint); font-weight: 700; margin-bottom: 8px; }
.dropdown-wallet { display: flex; align-items: center; gap: 9px; padding: 7px 4px; border-radius: 8px; cursor: pointer; transition: background var(--dur-fast) var(--ease); }
.dropdown-wallet:hover { background: var(--panel-soft); }
.dropdown-wallet .addr { font-family: var(--font-mono); font-size: 12px; flex: 1; }
.dropdown-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; cursor: pointer;
  font-size: 13px; color: var(--text-dim); transition: all var(--dur-fast) var(--ease); width: 100%; background: none; border: none; text-align: left; font-family: var(--font);
}
.dropdown-item:hover { background: var(--panel-soft); color: var(--text); }
.dropdown-item.danger { color: var(--red); }
.dropdown-item.danger:hover { background: var(--red-dim); }
.dropdown-item svg { width: 15px; height: 15px; }

/* -------------------------------------------------------------- content */
.app-content { flex: 1; overflow-y: auto; padding: 28px 30px 64px; }
.view-panel { animation: view-in var(--dur) var(--ease-out); }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.032), rgba(255,255,255,0.012)),
    var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 0 auto 18px;
  box-shadow: var(--shadow-sm);
  max-width: 1440px;
}
.panel:hover { border-color: rgba(174,187,216,0.16); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.panel-head h2 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text-faint); font-weight: 700; margin: 0;
  display: flex; align-items: center; gap: 8px;
}
.panel-head h2::before {
  content: '';
  width: 3px; height: 13px; border-radius: 2px; flex: none;
  background: linear-gradient(180deg, var(--blue-400), var(--purple-500));
}
.panel-head .hint { font-size: 12px; color: var(--text-faint); }

/* --------------------------------------------------------------- cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(154px, 1fr)); gap: 12px; perspective: 900px; }
.card {
  background: rgba(255,255,255,0.035); border: 1px solid var(--border-soft); border-radius: 8px;
  padding: 15px 16px;
  min-height: 86px;
  transform-style: preserve-3d;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease),
              background var(--dur) var(--ease), box-shadow 0.28s var(--ease);
  position: relative; overflow: hidden;
  box-shadow:
    var(--shadow-sm),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.card:hover {
  transform: translateY(-2px); border-color: rgba(174,187,216,0.30); background: rgba(255,255,255,0.055);
  box-shadow:
    0 8px 24px -4px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(100, 153, 255, 0.10);
}
.card .label { font-size: 10.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 800; display: flex; align-items: center; gap: 5px; }
.card .value { font-size: 21px; font-weight: 750; margin-top: 7px; font-variant-numeric: tabular-nums; font-family: var(--font-mono); letter-spacing: 0; }
.card .value.pos {
  background: linear-gradient(135deg, var(--green), #7fffc4);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.card .value.neg {
  background: linear-gradient(135deg, var(--red), #ffaaaa);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.card.hero-card {
  grid-column: span 2;
  background:
    linear-gradient(135deg, rgba(75, 130, 247, 0.16), rgba(127, 91, 255, 0.075)),
    rgba(255,255,255,0.035);
  border-color: transparent;
}
.card.hero-card .value { font-size: 27px; }
.card.hero-card::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(115deg, var(--blue-400), var(--purple-500), var(--blue-300), var(--purple-500), var(--blue-400));
  background-size: 300% 100%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: hero-border-flow 6s linear infinite;
  pointer-events: none;
}
@keyframes hero-border-flow {
  to { background-position: -300% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .card.hero-card::after { animation: none; }
}

.pos { color: var(--green); }
.neg { color: var(--red); }
.neutral { color: var(--text); }

.skeleton { position: relative; overflow: hidden; background: var(--panel-soft); border-radius: 6px; color: transparent !important; }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ------------------------------------------------------- equity chart */
.equity-chart-wrap { position: relative; width: 100%; }
#equity-chart { display: block; width: 100%; height: clamp(180px, 26vw, 260px); }

.chart-grid { stroke: rgba(148, 163, 196, 0.10); stroke-width: 1; }
.chart-zero { stroke: rgba(148, 163, 196, 0.28); stroke-width: 1; stroke-dasharray: 4 4; }
.chart-axis-label {
  fill: var(--text-faint); font-size: 11px; font-family: var(--font-mono);
}
.chart-area.up   { fill: url(#eq-area-up); }
.chart-area.down { fill: url(#eq-area-down); }
.chart-line {
  fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: chart-draw 1.1s var(--ease-out) 0.15s forwards;
}
.chart-line.up   { stroke: var(--green); }
.chart-line.down { stroke: var(--red); }
@keyframes chart-draw { to { stroke-dashoffset: 0; } }
.chart-endpoint { stroke-width: 2; stroke: var(--bg); }
.chart-endpoint.up   { fill: var(--green); }
.chart-endpoint.down { fill: var(--red); }
.chart-crosshair { stroke: rgba(148, 163, 196, 0.35); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-hover-dot { fill: var(--blue-200); stroke: var(--bg); stroke-width: 2; }

.chart-tooltip {
  position: absolute; z-index: 5; pointer-events: none;
  background: var(--bg-elevated); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 7px 11px;
  box-shadow: var(--shadow-md); white-space: nowrap;
}
.chart-tooltip .tip-date { font-size: 10.5px; color: var(--text-faint); font-family: var(--font-mono); }
.chart-tooltip .tip-value { font-size: 13.5px; font-weight: 700; font-family: var(--font-mono); margin-top: 2px; }

.monthly-bars {
  display: flex; align-items: flex-end; justify-content: center; gap: 14px;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-soft);
}
.mbar { text-align: center; }
.mbar-col { height: 48px; display: flex; align-items: flex-end; justify-content: center; }
.mbar-fill {
  width: 18px; border-radius: 4px 4px 2px 2px;
  transform-origin: bottom; animation: mbar-grow 0.6s var(--ease-out) both;
}
@keyframes mbar-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.pos-bg { background: linear-gradient(180deg, var(--green), #1f8f63); }
.neg-bg { background: linear-gradient(180deg, var(--red), #b23f3f); }
.mbar-label { font-size: 10px; color: var(--text-faint); font-family: var(--font-mono); margin-top: 5px; }

.card-sub {
  font-size: 11px; color: var(--text-faint); margin-top: 5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

@media (max-width: 640px) {
  .monthly-bars { gap: 8px; }
  .mbar-fill { width: 12px; }
  .mbar-label { font-size: 8.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .chart-line { animation: none; stroke-dasharray: none; stroke-dashoffset: 0; }
  .mbar-fill { animation: none; }
}

/* --------------------------------------------------------------- table */
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
th, td { text-align: right; padding: 11px 12px; border-bottom: 1px solid var(--border-soft); font-variant-numeric: tabular-nums; }
th:first-child, td:first-child { text-align: left; }
th {
  color: var(--text-faint); font-weight: 800; font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.5px; cursor: pointer; user-select: none;
  background: rgba(16,22,34,0.96);
  position: sticky; top: 0; z-index: 2;
}
th:hover { color: var(--text-dim); }
th.sort-active { color: var(--blue-300); }
tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.014);
}
tbody tr {
  position: relative;
  transition: background 0.15s var(--ease);
}
tbody tr::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--blue-400);
  border-radius: 0 3px 3px 0;
  opacity: 0;
  transition: opacity 0.15s var(--ease);
}
tbody tr:hover {
  background: rgba(75, 130, 247, 0.055);
}
tbody tr:hover::before {
  opacity: 1;
}
tbody tr:last-child td { border-bottom: none; }
.market-name { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--text); }
.row-sub { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); margin-top: 2px; }

.bar-cell { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.bar-track { width: 60px; height: 5px; border-radius: 3px; background: var(--border-soft); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; transition: width 0.6s var(--ease-out); }

.table-toolbar { display: flex; gap: 10px; margin-bottom: 14px; align-items: center; flex-wrap: wrap; }
.search-input { position: relative; flex: 1; max-width: 280px; }
.search-input svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--text-faint); }
.search-input input { padding-left: 32px; }
.chip-group { display: flex; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
  min-width: 56px; box-sizing: border-box;
  padding: 6px 14px; border-radius: var(--radius-full); font-size: 12px; font-weight: 700; cursor: pointer;
  background: rgba(255,255,255,0.035); border: 1px solid var(--border); color: var(--text-dim);
  transition: all var(--dur-fast) var(--ease);
}
.chip.active { background: rgba(75,130,247,0.20); border-color: rgba(100,153,255,0.45); color: var(--blue-100); }
.chip:not(.active):hover { border-color: var(--border-strong); color: var(--text); }

/* ----------------------------------------------------------------- tags */
.tag-pill { display: inline-flex; align-items: center; font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 999px; letter-spacing: 0.3px; }
.tag-SALE { background: rgba(100,153,255,0.14); color: var(--blue-200); border: 1px solid rgba(100,153,255,0.16); }
.tag-REDEMPTION { background: var(--green-dim); color: var(--green); }
.tag-EXPIRY { background: var(--red-dim); color: var(--red); }

/* ---------------------------------------------------------------- notes */
.notes-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.notes-list li { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border-soft); color: var(--text-dim); line-height: 1.55; }
.notes-list li:last-child { border-bottom: none; }
.notes-list li svg { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--text-faint); }
.notes-list li.warn { color: var(--amber); }
.notes-list li.warn svg { color: var(--amber); }
.notes-list li.info svg { color: var(--blue-300); }

/* ------------------------------------------------------ tax data quality */
.conf-chip {
  display: inline-flex; align-items: center; font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px; letter-spacing: 0.2px;
}
.conf-high { background: var(--green-dim); color: var(--green); }
.conf-med  { background: var(--amber-dim); color: var(--amber); }
.conf-low  { background: rgba(148,163,196,0.14); color: var(--text-dim); }
.iso-chip {
  display: inline-flex; align-items: center; font-family: var(--font-mono);
  font-size: 11px; font-weight: 600; color: var(--text-faint);
  padding: 3px 8px; border-radius: 6px; border: 1px solid var(--border);
  margin-left: 8px;
}
.tax-headline-banner {
  display: flex; align-items: flex-start; gap: 11px;
  background: linear-gradient(135deg, rgba(75,130,247,0.115), rgba(127,91,255,0.055));
  border: 1px solid rgba(100,153,255,0.20); border-radius: var(--radius);
  padding: 13px 15px; margin-bottom: 16px;
}
.tax-headline-banner svg { width: 18px; height: 18px; flex: none; color: var(--blue-300); margin-top: 1px; }
.headline-text { font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.4; }
.headline-rate {
  display: inline-block; margin-top: 5px; font-family: var(--font-mono);
  font-size: 12px; font-weight: 700; color: var(--blue-200);
  background: rgba(75,130,247,0.12); padding: 2px 9px; border-radius: 6px;
}
.tax-sources-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border-soft);
}
.sources-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-faint); font-weight: 700; }
.source-link {
  font-size: 11.5px; color: var(--blue-300); text-decoration: none;
  padding: 2px 8px; border-radius: 6px; border: 1px solid var(--border);
  transition: all var(--dur-fast) var(--ease);
}
.source-link:hover { border-color: var(--blue-500); background: rgba(75,130,247,0.10); }

.disclaimer { display: flex; gap: 8px; font-size: 12px; color: var(--amber); border-top: 1px dashed var(--border); margin-top: 14px; padding-top: 12px; line-height: 1.5; }
.disclaimer svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }

.empty { color: var(--text-faint); font-size: 13px; padding: 40px 0; text-align: center; position: relative; }
.empty::before {
  content: '';
  display: block;
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: rgba(148, 163, 196, 0.04);
  margin: 0 auto 8px;
  animation: empty-pulse 2s ease-in-out infinite;
}
@keyframes empty-pulse {
  0%, 100% { background: rgba(148, 163, 196, 0.02); }
  50%       { background: rgba(148, 163, 196, 0.09); }
}
.empty svg { width: 32px; height: 32px; margin-bottom: 10px; opacity: 0.5; animation: empty-float 3s ease-in-out infinite; }
@keyframes empty-float {
  0%, 100% { transform: translateY(0);    }
  50%       { transform: translateY(-5px); }
}
.empty div {
  color: var(--text-faint);
  font-size: 13px;
}
@media (prefers-reduced-motion: reduce) {
  .empty::before { animation: none; }
  .empty svg     { animation: none; }
}

/* --------------------------------------------------------------- alerts */
.alert-banner {
  display: flex; align-items: flex-start; gap: 12px;
  background: rgba(242,109,109,0.105); border: 1px solid rgba(242,109,109,0.28); color: #ffc0bd;
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; font-size: 13px;
  animation: rise 0.3s var(--ease-out);
}
.alert-banner svg { width: 18px; height: 18px; flex: none; color: var(--red); margin-top: 1px; }
.alert-banner.alert-banner-info {
  background: rgba(100,153,255,0.08);
  border-color: rgba(100,153,255,0.22);
  color: var(--text-dim);
}
.alert-banner.alert-banner-info svg { color: var(--blue-400); }
.alert-banner.alert-banner-info strong { color: var(--text); font-weight: 600; }
.alert-link {
  display: inline-flex; align-items: center; gap: 3px;
  color: var(--blue-200); font-weight: 600; text-decoration: underline;
  text-underline-offset: 2px; cursor: pointer;
}
.alert-link svg { width: 13px !important; height: 13px !important; color: inherit !important; margin: 0 !important; }
.alert-link:hover { color: var(--blue-100); }

/* -------------------------------------------------------- command palette */
.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 5px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  color: var(--text-dim); background: rgba(255,255,255,0.045);
  border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 5px;
}

.cmdk-hint {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 10px 0 12px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-faint);
  font-family: var(--font); font-size: 12.5px; cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}
.cmdk-hint:hover { color: var(--text-dim); border-color: var(--border-strong); background: var(--panel-hover); }
.cmdk-hint svg { width: 14px; height: 14px; }
.cmdk-hint .kbd { pointer-events: none; }

.palette-overlay {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: clamp(60px, 16vh, 160px);
  background: rgba(2, 4, 9, 0.66);
  backdrop-filter: blur(10px) saturate(1.6);
  -webkit-backdrop-filter: blur(10px) saturate(1.6);
  animation: fade-in 0.16s var(--ease-out);
}
.palette {
  width: 560px; max-width: calc(100vw - 32px);
  background: rgba(12,17,27,0.99);
  border: 1px solid rgba(127, 91, 255, 0.32);
  border-radius: var(--radius);
  box-shadow:
    0 0 0 1px rgba(127, 91, 255, 0.12),
    0 32px 90px -18px rgba(0, 0, 0, 0.8),
    0 6px 28px rgba(127, 91, 255, 0.16);
  overflow: hidden;
  animation: palette-in 0.22s var(--ease-out) both;
}
@keyframes palette-in {
  from { opacity: 0; transform: translateY(-10px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.palette-input-row {
  display: flex; align-items: center; gap: 11px;
  padding: 15px 16px; border-bottom: 1px solid var(--border-soft);
}
.palette-input-row svg { width: 17px; height: 17px; color: var(--text-faint); flex: none; }
.palette-input-row input {
  flex: 1; background: none; border: none; outline: none; box-shadow: none;
  padding: 0; font-size: 15px; color: var(--text); font-family: var(--font);
}
.palette-input-row input::placeholder { color: var(--text-faint); }

.palette-results { max-height: 320px; overflow-y: auto; padding: 6px; }
.palette-section {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--text-faint);
  padding: 10px 12px 5px;
}
.palette-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
  color: var(--text-dim); font-size: 13.5px;
}
.palette-item svg { width: 16px; height: 16px; flex: none; color: var(--text-faint); }
.palette-item .palette-item-hint { margin-left: auto; font-size: 11px; color: var(--text-faint); }
.palette-item.selected {
  background: linear-gradient(135deg, rgba(75,130,247,0.18), rgba(127,91,255,0.10));
  color: var(--text);
}
.palette-item.selected svg { color: var(--blue-300); }
.palette-empty { padding: 26px 12px; text-align: center; color: var(--text-faint); font-size: 13px; }
.palette-footer {
  display: flex; gap: 18px; align-items: center;
  padding: 10px 16px; border-top: 1px solid var(--border-soft);
  font-size: 11.5px; color: var(--text-faint);
}
.palette-footer > span { display: inline-flex; align-items: center; gap: 5px; }

@media (max-width: 640px) {
  .cmdk-hint .cmdk-hint-text, .cmdk-hint .kbd { display: none; }
  .cmdk-hint { padding: 0; width: 44px; justify-content: center; }
}
@media (max-width: 420px) {
  .cmdk-hint { display: none; }
}

/* --------------------------------------------------------- focus rings */
:focus-visible {
  outline: 2px solid var(--blue-400);
  outline-offset: 2px;
  border-radius: 4px;
}
textarea:focus-visible, select:focus-visible, input:focus-visible {
  outline: none; /* these already get border + box-shadow focus treatment */
}

/* ----------------------------------------------------------- job progress */
.job-progress {
  background: linear-gradient(135deg, rgba(75,130,247,0.11), rgba(127,91,255,0.055));
  border: 1px solid rgba(100,153,255,0.22); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 18px;
  animation: rise 0.3s var(--ease-out);
}
.job-progress-head { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.job-stage { font-weight: 600; color: var(--text); }
.job-detail { margin-left: auto; font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); }
.job-bar {
  height: 6px; border-radius: 3px; margin-top: 11px;
  background: rgba(148,163,196,0.12); overflow: hidden; position: relative;
}
.job-bar-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--blue-500), var(--purple-500));
  transition: width 0.5s var(--ease-out);
}
.job-bar-fill.indeterminate {
  width: 32%; position: absolute;
  animation: job-indeterminate 1.4s ease-in-out infinite;
}
@keyframes job-indeterminate {
  0% { left: -32%; } 100% { left: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .job-bar-fill.indeterminate { animation: none; left: 0; width: 100%; opacity: 0.5; }
}

/* ---------------------------------------------------------------- toast */
.toast-container { position: fixed; bottom: 22px; right: 22px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px; background: rgba(12,17,27,0.98); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 12px 16px; font-size: 13px; box-shadow: var(--shadow-lg);
  animation: toast-slide-in 0.35s var(--ease-out); max-width: 340px;
  overflow: hidden; position: relative;
}
.toast svg { width: 16px; height: 16px; flex: none; }
.toast.success svg { color: var(--green); }
.toast.error svg { color: var(--red); }
.toast.leaving { animation: toast-out 0.25s var(--ease) forwards; }
@keyframes toast-slide-in {
  from { opacity: 0; transform: translateX(30px) translateY(8px); }
  to   { opacity: 1; transform: translateX(0) translateY(0); }
}
@keyframes toast-out { to { opacity: 0; transform: translateX(30px); } }
.toast-progress {
  position: absolute; bottom: 0; left: 0;
  height: 2px;
  background: var(--blue-400);
  border-radius: 0 0 var(--radius) var(--radius);
  animation: toast-progress-drain linear forwards;
}
@keyframes toast-progress-drain {
  from { width: 100%; }
  to   { width: 0%; }
}
@media (prefers-reduced-motion: reduce) {
  .toast { animation: none; }
}

/* ------------------------------------------------------------- wallet UI */
.wallet-card {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius);
  background: rgba(255,255,255,0.033); border: 1px solid var(--border-soft); margin-bottom: 10px;
  transition: all var(--dur) var(--ease);
}
.wallet-card:hover { border-color: var(--border-strong); background: rgba(255,255,255,0.052); }
.wallet-card .info { flex: 1; min-width: 0; }
.wallet-card .addr { font-family: var(--font-mono); font-size: 13px; }
.wallet-card .proxy { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.wallet-card .metrics { display: flex; gap: 22px; text-align: right; }
.wallet-card .metric-label { font-size: 10px; color: var(--text-faint); text-transform: uppercase; }
.wallet-card .metric-value { font-family: var(--font-mono); font-weight: 700; font-size: 14px; }
.wallet-card .remove-btn { color: var(--text-faint); background: none; border: none; cursor: pointer; padding: 6px; border-radius: 6px; transition: all var(--dur-fast) var(--ease); }
.wallet-card .remove-btn:hover { color: var(--red); background: var(--red-dim); }

.add-wallet-row { display: flex; gap: 10px; margin-top: 4px; }
.add-wallet-row input { flex: 1; }

/* ---------------------------------------------------------- settings */
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid var(--border-soft); gap: 24px; }
.settings-row:last-child { border-bottom: none; }
.settings-row .settings-label { font-size: 13.5px; font-weight: 600; }
.settings-row .settings-desc { font-size: 12px; color: var(--text-faint); margin-top: 3px; max-width: 420px; }
.settings-row .settings-control { flex: none; min-width: 180px; }

/* --------------------------------------------------------------- misc */
.count-up { display: inline-block; }
.progress-ring { transform: rotate(-90deg); }

.sidebar-backdrop {
  position: fixed; inset: 0; z-index: 35; background: rgba(2,4,9,0.6); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity var(--dur) var(--ease);
}
.sidebar-backdrop.show { opacity: 1; pointer-events: auto; }

.panel:has(table) { overflow-x: auto; }
.panel:has(table)::-webkit-scrollbar { height: 7px; }

@media (max-width: 980px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform var(--dur) var(--ease); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .app-main { width: 100%; }
  .menu-toggle { display: inline-flex; }
  .topbar-controls { display: none; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .card.hero-card { grid-column: span 2; }
  .landing-features { grid-template-columns: 1fr; max-width: 460px; }
  .landing-nav { padding: 18px 20px; }
  table { min-width: 560px; }
}

@media (max-width: 640px) {
  .landing-hero { padding: 28px 18px 12px; }
  .hero-console { font-size: 11.5px; padding: 9px 14px; min-width: min(340px, 90vw); }
  .hero-actions { flex-direction: column; width: 100%; max-width: 320px; }
  .hero-actions .btn { width: 100%; }
  .hero-stats { flex-direction: column; gap: 14px; }
  .stat { padding: 0; }
  .stat + .stat::before { display: none; }
  .cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card.hero-card { grid-column: span 2; }
  .card .value { font-size: 18px; }
  .app-content { padding: 18px 14px 48px; }
  .panel { padding: 16px; }
  .panel-head { align-items: flex-start; flex-direction: column; gap: 6px; }
  .panel-head .hint { line-height: 1.35; }
  .topbar { padding: 0 8px 0 16px; }
  .topbar-right { gap: 8px; }
  .profile-btn { width: 44px; height: 44px; padding: 0; justify-content: center; }
  .profile-btn .addr, .profile-btn [data-icon] { display: none; }
  .profile-dropdown { right: -2px; width: min(300px, calc(100vw - 28px)); }
  .topbar-left h2 { font-size: 16px; }
  .view-subtitle { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .landing-faq { padding: 12px 18px 56px; }
  .faq-question { padding: 14px 16px; font-size: 13.5px; }
  .table-toolbar { align-items: stretch; }
  .search-input { max-width: none; min-width: 100%; }
  .chip-group { width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .wallet-card { align-items: flex-start; flex-wrap: wrap; }
  .wallet-card .metrics { width: 100%; justify-content: space-between; text-align: left; gap: 12px; }
  .add-wallet-row { flex-direction: column; }
  .settings-row { align-items: flex-start; flex-direction: column; gap: 12px; }
  .settings-row .settings-control { width: 100%; min-width: 0; }
  .toast-container { left: 14px; right: 14px; bottom: 14px; }
  .toast { max-width: none; }
}

/* ---------------------------------------------------------- bottom sheet */
.sheet-toggle { display: none; }

.bottom-sheet {
  display: none;
  position: fixed; inset: 0; z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease-out);
}
.bottom-sheet.open {
  opacity: 1;
  pointer-events: auto;
}
.bottom-sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(2, 4, 9, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.bottom-sheet-panel {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(8, 11, 19, 0.92);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border-top: 1px solid rgba(127, 91, 255, 0.3);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 12px 20px 40px;
  transform: translateY(100%);
  transition: transform 0.35s var(--ease-out);
}
.bottom-sheet.open .bottom-sheet-panel {
  transform: translateY(0);
}
.sheet-handle {
  width: 40px; height: 4px; border-radius: 99px;
  background: rgba(148, 163, 196, 0.25);
  margin: 0 auto 16px;
}
.sheet-title {
  font-size: 14px; font-weight: 700;
  color: var(--text); margin-bottom: 16px;
}
.sheet-controls { display: flex; flex-direction: column; gap: 6px; }
.sheet-label {
  font-size: 11.5px; color: var(--text-dim); font-weight: 500;
  margin-top: 10px; display: block;
}
.sheet-segmented { width: 100%; }
.sheet-segmented button { flex: 1; min-height: 44px; }

@media (max-width: 640px) {
  .sheet-toggle { display: inline-flex; }
  .bottom-sheet { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .bottom-sheet-panel { transition: none; }
}

/* -------------------------------------------------------- touch targets */
/* .chip is deliberately excluded here — it gets its own touch-sized bump
   only on mobile (below), since forcing 44px at desktop widths overrides
   the chip's natural pill height without the flex-centering to match,
   leaving text top-anchored in an oversized, oddly-rounded pill. */
button, .nav-item, .icon-btn, .dropdown-item, .faq-question {
  min-height: 44px;
}
.icon-btn {
  min-width: 44px; min-height: 44px;
  width: 44px; height: 44px;
}
@media (max-width: 640px) {
  .chip {
    min-height: 44px;
    min-width: 64px;
    padding: 0 14px;
  }
  .icon-btn {
    min-width: 44px; min-height: 44px;
    width: 44px; height: 44px;
  }
}

/* ------------------------------------------------- reduced motion catch-all */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
  }
}


/* ================================================================= TUTORIAL */

/* ── Target highlight ring — sits directly on the element, no overlay ── */
.tour-highlight {
  outline: 2px solid var(--blue-400) !important;
  outline-offset: 3px !important;
  border-radius: inherit;
}

/* ── Floating step card ── */
.tour-card {
  position: fixed;
  z-index: 9000;
  width: 320px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 0;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    0 8px 32px -4px rgba(0,0,0,0.7),
    0 2px 8px rgba(0,0,0,0.4);
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.22s var(--ease-out),
    transform 0.22s var(--ease-out),
    top 0.35s var(--ease-out),
    left 0.35s var(--ease-out);
  pointer-events: auto;
}
.tour-card.tour-visible {
  opacity: 1;
  transform: translateY(0);
}
.tour-card::before {
  content: '';
  display: block;
  height: 2px;
  background: linear-gradient(90deg, var(--blue-500) 0%, var(--purple-500) 100%);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.tour-card-body { padding: 18px 20px 14px; }

.tour-step-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.tour-step-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--blue-400);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.tour-x-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: none;
  border: 1px solid var(--border-soft);
  color: var(--text-faint);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tour-x-btn:hover {
  background: rgba(255,255,255,0.07);
  border-color: var(--border);
  color: var(--text-dim);
}

.tour-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
  line-height: 1.35;
}
.tour-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-dim);
  margin: 0;
}
.tour-desc strong { color: var(--text); font-weight: 600; }

.tour-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 20px 13px;
  border-top: 1px solid var(--border-soft);
  gap: 12px;
}
.tour-dots { display: flex; gap: 5px; align-items: center; }
.tour-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border-strong);
  transition: background 0.2s, width 0.2s, border-radius 0.2s;
  flex: none;
}
.tour-dot.done  { background: rgba(100,153,255,0.45); }
.tour-dot.cur   { width: 16px; border-radius: 3px; background: var(--blue-400); }

.tour-btns { display: flex; gap: 8px; }
.tour-btn {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  border: none;
  outline: none;
  transition: background 0.15s, opacity 0.15s, transform 0.15s;
  white-space: nowrap;
}
.tour-btn:disabled { opacity: 0.35; cursor: default; pointer-events: none; }
.tour-btn-ghost {
  background: rgba(255,255,255,0.06);
  color: var(--text-dim);
  border: 1px solid var(--border-soft);
}
.tour-btn-ghost:not(:disabled):hover {
  background: rgba(255,255,255,0.1);
  color: var(--text);
}
.tour-btn-next {
  background: var(--blue-500);
  color: #fff;
}
.tour-btn-next:not(:disabled):hover {
  background: var(--blue-600);
  transform: translateY(-1px);
}
.tour-btn-done {
  background: var(--green);
  color: #07150e;
}
.tour-btn-done:not(:disabled):hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

/* ── Welcome dialog — centred modal, not full-page ── */
.tour-welcome {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(3, 6, 14, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.tour-welcome.active { display: flex; }

.tour-welcome-dialog {
  width: 100%;
  max-width: 440px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    0 24px 64px -12px rgba(0,0,0,0.85);
  animation: tour-dialog-in 0.3s var(--ease-out) both;
}
@keyframes tour-dialog-in {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}
.tour-welcome-strip {
  height: 3px;
  background: linear-gradient(90deg, var(--blue-500) 0%, var(--purple-500) 60%, var(--gold-400) 100%);
}
.tour-welcome-body { padding: 24px 24px 20px; }
.tour-welcome-body h2 {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
}
.tour-welcome-body > p {
  margin: 0 0 18px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-dim);
}
.tour-welcome-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}
.tour-welcome-list li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
}
.tour-welcome-list li::before {
  content: '';
  flex: none;
  margin-top: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue-400);
}
.tour-welcome-list strong { color: var(--text); font-weight: 600; }
.tour-welcome-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.tour-welcome-skip {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  background: none;
  border: 1px solid var(--border-soft);
  color: var(--text-faint);
  transition: color 0.15s, border-color 0.15s;
}
.tour-welcome-skip:hover { color: var(--text-dim); border-color: var(--border); }
.tour-welcome-start {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  background: var(--blue-500);
  border: none;
  color: #fff;
  transition: background 0.15s, transform 0.15s;
}
.tour-welcome-start:hover { background: var(--blue-600); transform: translateY(-1px); }

/* ── Replay dot on ? button ── */
.tour-hint-dot { position: relative; }
.tour-hint-dot::after {
  content: '';
  position: absolute;
  top: 5px; right: 5px;
  width: 6px; height: 6px;
  background: var(--blue-400);
  border: 2px solid var(--bg);
  border-radius: 50%;
}

@media (prefers-reduced-motion: reduce) {
  .tour-card { transition: none; }
  .tour-card.tour-visible { opacity: 1; transform: none; }
  .tour-welcome-dialog { animation: none; }
}
@media (max-width: 640px) {
  .tour-card { width: calc(100vw - 24px); left: 12px !important; }
}
