/* ============================================================
   Mantis.Money Treasury — UI v3
   Design language from imports/defi_strategy_calculator:
   deep-green ground (#00241B), near-black terminal cards,
   emerald primary, blue mono numerics, JetBrains Mono data.
   ============================================================ */

:root {
  color-scheme: dark;

  --bg: #00241b;
  --bg-deep: #001a13;
  --bg-terminal: #060b09;
  --bg-panel: rgba(2, 22, 16, 0.72);
  --bg-inset: rgba(9, 26, 43, 0.55);

  --ink: #f7faf9;
  --ink-soft: rgba(247, 250, 249, 0.78);
  --muted: #8a9a94;
  --muted-deep: #5f716b;

  --emerald: #10b981;
  --emerald-bright: #34d399;
  --emerald-glow: rgba(16, 185, 129, 0.16);
  --blue: #60a5fa;
  --blue-soft: #93c5fd;
  --amber: #fbbf24;
  --pink: #ec4899;
  --red: #f87171;

  --border: rgba(255, 255, 255, 0.08);
  --border-soft: rgba(255, 255, 255, 0.05);
  --border-emerald: rgba(16, 185, 129, 0.28);
  --border-blue: rgba(96, 165, 250, 0.25);

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

  --font-body: "DM Sans", "Helvetica Neue", sans-serif;
  --font-display: "Plus Jakarta Sans", "DM Sans", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", monospace;

  --shadow-card: 0 18px 50px -12px rgba(0, 0, 0, 0.55);
  --glow-emerald: 0 0 40px rgba(16, 185, 129, 0.14), 0 0 90px rgba(16, 185, 129, 0.05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 55% 40% at 70% -8%, rgba(16, 185, 129, 0.13), transparent),
    radial-gradient(ellipse 40% 35% at 8% 4%, rgba(45, 212, 191, 0.07), transparent),
    radial-gradient(ellipse 70% 60% at 50% 115%, rgba(16, 185, 129, 0.08), transparent);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(16, 185, 129, 0.25); color: #d1fae5; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.18); }

h1, h2, h3 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  margin: 0;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.mono { font-family: var(--font-mono); font-size: 0.92em; }
.muted { color: var(--muted); }

/* ---------------------------------------------------------- */
/* Shell                                                       */
/* ---------------------------------------------------------- */

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 22px 18px;
  background: linear-gradient(180deg, rgba(0, 26, 19, 0.92), rgba(0, 18, 13, 0.96));
  border-right: 1px solid var(--border-soft);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 6px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.35));
}

.brand strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.brand strong span { color: var(--emerald-bright); }

.brand small {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
}

.build-stamp {
  align-self: flex-start;
  margin: -8px 0 0 6px;
  padding: 3px 9px;
  border: 1px solid var(--border-emerald);
  border-radius: var(--radius-full);
  background: var(--emerald-glow);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--emerald-bright);
  white-space: nowrap;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
}

.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  transition: color 150ms ease, background 150ms ease;
}

.nav a::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.35;
  transition: opacity 150ms ease, box-shadow 150ms ease;
}

.nav a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.04); }

.nav a.active {
  color: var(--emerald-bright);
  background: rgba(16, 185, 129, 0.1);
}

/* "Start here" treatment for the How-it-works link: bordered button so new
   visitors are drawn to it before depositing. */
.nav a.nav-cta {
  margin: 4px 0;
  border: 1px solid rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.07);
  color: var(--emerald-bright);
}

.nav a.nav-cta::before {
  opacity: 0.9;
}

.nav a.nav-cta:hover {
  color: var(--emerald-bright);
  background: rgba(16, 185, 129, 0.14);
}

.nav a.nav-cta.active {
  background: rgba(16, 185, 129, 0.18);
  border-color: var(--emerald-bright);
}

.nav a.active::before {
  opacity: 1;
  box-shadow: 0 0 8px var(--emerald-bright);
}

.mode-switch {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.25);
}

.mode-switch button {
  border: 0;
  background: transparent;
  border-radius: var(--radius-full);
  padding: 5px 11px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  color: var(--muted);
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease;
}

.mode-switch button:hover { color: var(--ink); }

.mode-switch button.active {
  color: var(--emerald-bright);
  background: rgba(16, 185, 129, 0.14);
}

#uiModeSwitch { margin-top: 10px; }

.sidebar-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.25);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 999px;
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
  animation: pulse 2.2s ease-in-out infinite;
}

.status-dot.ok { background: var(--emerald-bright); box-shadow: 0 0 8px var(--emerald-bright); }
.status-dot.bad { background: var(--red); box-shadow: 0 0 8px var(--red); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ---------------------------------------------------------- */
/* Main + topbar                                               */
/* ---------------------------------------------------------- */

.main {
  min-width: 0;
  padding: 26px 34px 60px;
  max-width: 1240px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding-bottom: 22px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--border-soft);
}

.eyebrow {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--emerald-bright);
}

.eyebrow::before { content: "● "; font-size: 8px; vertical-align: 2px; }

.topbar h1 {
  font-size: 26px;
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.chain-select {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.28);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.chain-select select {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 9px 22px 9px 4px;
  cursor: pointer;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='6'%3E%3Cpath d='M1 1l3 3 3-3' stroke='%238a9a94' fill='none' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.chain-select select option { background: var(--bg-deep); color: var(--ink); }

.chain-mark {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 4px 12px rgba(0, 0, 0, 0.32);
}

/* ---------------------------------------------------------- */
/* Buttons                                                     */
/* ---------------------------------------------------------- */

.primary-button, .secondary-button, .icon-button {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, border-color 150ms ease;
}

.primary-button {
  padding: 10px 20px;
  border: 1px solid rgba(16, 185, 129, 0.5);
  background: linear-gradient(180deg, #12c68a, #0ea371);
  color: #00170f;
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.28);
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 34px rgba(16, 185, 129, 0.42);
}

.primary-button:active { transform: translateY(0) scale(0.98); }

.primary-button:disabled, .secondary-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.secondary-button {
  padding: 10px 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-soft);
}

.secondary-button:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 16px;
}

.icon-button:hover { color: var(--emerald-bright); border-color: var(--border-emerald); }

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 6px 5px 13px;
  border: 1px solid var(--border-emerald);
  border-radius: var(--radius-full);
  background: var(--emerald-glow);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--emerald-bright);
}

.user-chip[hidden] { display: none; }

.user-chip #clerkUserButton {
  display: flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
}

/* ---------------------------------------------------------- */
/* Badges                                                      */
/* ---------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.badge.ok {
  border-color: var(--border-emerald);
  background: var(--emerald-glow);
  color: var(--emerald-bright);
}

.badge.warn {
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.1);
  color: var(--amber);
}

.badge.bad {
  border-color: rgba(248, 113, 113, 0.3);
  background: rgba(248, 113, 113, 0.1);
  color: var(--red);
}

.badge.blue {
  border-color: var(--border-blue);
  background: rgba(96, 165, 250, 0.1);
  color: var(--blue-soft);
}

/* ---------------------------------------------------------- */
/* Cards & panels                                              */
/* ---------------------------------------------------------- */

.card {
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  box-shadow: var(--shadow-card);
}

.card > h2 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 10px;
}

.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.metric {
  padding: 14px 16px;
  border: 1px solid var(--border-blue);
  border-radius: var(--radius);
  background: var(--bg-inset);
}

.metric label {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.metric strong {
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 600;
  color: var(--blue-soft);
  letter-spacing: -0.01em;
}

.kv-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-soft);
}

.kv-row:last-child { border-bottom: 0; }

/* ---------------------------------------------------------- */
/* Command hero                                                */
/* ---------------------------------------------------------- */

.command {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 40px;
  align-items: center;
  padding: 10px 0 34px;
}

.command-copy .badge { margin-bottom: 18px; }

.command-copy h2 {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}

.command-copy > p {
  color: var(--muted);
  font-size: 15px;
  max-width: 46ch;
  margin: 0 0 24px;
}

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

.signal {
  padding: 11px 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.22);
}

.signal label {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-deep);
  margin-bottom: 3px;
}

.signal strong {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--emerald-bright);
}

/* ---------------------------------------------------------- */
/* Terminal window                                             */
/* ---------------------------------------------------------- */

.terminal-window {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-terminal);
  box-shadow: var(--shadow-card), var(--glow-emerald);
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 16px;
  background: rgba(255, 255, 255, 0.025);
  border-bottom: 1px solid var(--border-soft);
}

.terminal-dot { width: 10px; height: 10px; flex: none; border-radius: 999px; }
.terminal-dot.red { background: #ff5f57; }
.terminal-dot.amber { background: #febc2e; }
.terminal-dot.green { background: #28c840; }

.terminal-title {
  margin-left: 8px;
  padding: 3px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
}

.terminal-body { padding: 20px 22px 22px; }

.terminal-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--emerald-bright);
  margin-bottom: 10px;
}

.terminal-headline {
  font-family: var(--font-mono);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.terminal-headline .hl { color: var(--emerald-bright); }

.terminal-subtitle {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0 0 18px;
}

.terminal-controls {
  padding: 15px 16px;
  border: 1px solid var(--border-blue);
  border-radius: var(--radius);
  background: var(--bg-inset);
  margin-bottom: 14px;
}

.slider-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.slider-row span:last-child { color: var(--blue-soft); }

.fake-slider {
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  margin-bottom: 14px;
}

.fake-slider::before {
  content: "";
  position: absolute;
  inset: 0 62% 0 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #0ea371, var(--emerald-bright));
}

.fake-slider::after {
  content: "";
  position: absolute;
  left: 38%;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  background: var(--emerald-bright);
  box-shadow: 0 0 10px var(--emerald-bright);
}

.terminal-pill-row { display: flex; gap: 8px; flex-wrap: wrap; }

.terminal-pill {
  padding: 4px 11px;
  border: 1px solid var(--border-emerald);
  border-radius: var(--radius-full);
  background: var(--emerald-glow);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--emerald-bright);
}

.terminal-pill.blue {
  border-color: var(--border-blue);
  background: rgba(96, 165, 250, 0.1);
  color: var(--blue-soft);
}

.terminal-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 14px;
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
  margin-top: 8px;
  transition: border-color 150ms ease, background 150ms ease;
}

.terminal-row:hover { border-color: var(--border-emerald); background: rgba(16, 185, 129, 0.04); }

.terminal-row strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
}

.terminal-row small {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted-deep);
  margin-top: 2px;
}

.terminal-row-value {
  align-self: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--blue-soft);
}

.mini-progress {
  grid-column: 1 / -1;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.mini-progress span {
  display: block;
  height: 100%;
  width: var(--progress, 40%);
  border-radius: 999px;
  background: linear-gradient(90deg, #0ea371, var(--emerald-bright));
}

/* ---------------------------------------------------------- */
/* Snuggle range card                                          */
/* ---------------------------------------------------------- */

.range-card {
  padding: 24px 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  box-shadow: var(--shadow-card);
}

.range-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.range-card-header h2 { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.range-card-header p { margin: 0; max-width: 62ch; font-size: 13.5px; }

.range-track {
  position: relative;
  height: 42px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 40px),
    rgba(0, 0, 0, 0.25);
  margin-bottom: 22px;
  overflow: hidden;
}

.range-window {
  position: absolute;
  inset: 6px 30% 6px 22%;
  border: 1px solid var(--border-emerald);
  border-radius: 7px;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.05));
}

.snuggle-pin, .price-pin {
  position: absolute;
  top: 3px;
  bottom: 3px;
  width: 2px;
  border-radius: 2px;
}

.snuggle-pin { left: 27%; background: var(--emerald-bright); box-shadow: 0 0 8px var(--emerald-bright); }
.price-pin { left: 31%; background: var(--blue-soft); box-shadow: 0 0 8px var(--blue-soft); }

.workflow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.workflow-step {
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.22);
}

.workflow-step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid var(--border-emerald);
  background: var(--emerald-glow);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--emerald-bright);
  margin-bottom: 8px;
}

.workflow-step strong { display: block; font-size: 13px; font-weight: 600; }
.workflow-step small { display: block; font-size: 11px; color: var(--muted-deep); margin-top: 2px; }

/* ---------------------------------------------------------- */
/* Module cards                                                */
/* ---------------------------------------------------------- */

.module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.module-card {
  position: relative;
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
  overflow: hidden;
}

.module-card::after {
  content: "→";
  position: absolute;
  top: 14px;
  right: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted-deep);
  transition: color 150ms ease, transform 150ms ease;
}

.module-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-emerald);
  box-shadow: var(--glow-emerald);
}

.module-card:hover::after { color: var(--emerald-bright); transform: translateX(2px); }

.module-card > span {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.module-card strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--emerald-bright);
  margin-bottom: 6px;
}

.module-card.warn strong { color: var(--amber); }
.module-card p { margin: 0; font-size: 12.5px; color: var(--muted); }

/* ---------------------------------------------------------- */
/* Tables                                                      */
/* ---------------------------------------------------------- */

.table-shell {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  box-shadow: var(--shadow-card);
  overflow-x: auto;
}

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

thead th {
  padding: 13px 18px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background 120ms ease; }
tbody tr:hover { background: rgba(16, 185, 129, 0.035); }

td .muted { font-size: 11.5px; margin-top: 2px; }

.pool-identity {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.protocol-mark {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 5px 14px rgba(0, 0, 0, 0.2);
}

.protocol-mark img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

/* ---------------------------------------------------------- */
/* Range meter (tables/preview)                                */
/* ---------------------------------------------------------- */

.range {
  position: relative;
  height: 6px;
  width: 120px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: visible;
}

.range-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--width, 50%);
  border-radius: 999px;
  background: linear-gradient(90deg, #0ea371, var(--emerald-bright));
}

.range-pin {
  position: absolute;
  left: var(--pin, 20%);
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  background: var(--blue-soft);
  box-shadow: 0 0 8px rgba(147, 197, 253, 0.7);
}

/* ---------------------------------------------------------- */
/* Page intro / empty states                                   */
/* ---------------------------------------------------------- */

.page-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.page-intro h2 { font-size: 19px; font-weight: 700; margin-bottom: 5px; }
.page-intro p { margin: 0; max-width: 60ch; }

.empty-state {
  padding: 44px 40px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  background: rgba(0, 0, 0, 0.18);
}

.empty-state .badge { margin-bottom: 16px; }
.empty-state h2 { font-size: 21px; font-weight: 700; margin-bottom: 10px; }
.empty-state p { color: var(--muted); max-width: 62ch; margin: 0; }

.empty-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }

/* ---------------------------------------------------------- */
/* Forms                                                       */
/* ---------------------------------------------------------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.field { display: flex; flex-direction: column; gap: 7px; }

.field > span {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input, .field select {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--ink);
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field input:focus, .field select:focus {
  border-color: var(--border-emerald);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.field select option { background: var(--bg-deep); }

.field input[type="range"] {
  appearance: none;
  padding: 0;
  height: 4px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #0ea371, var(--emerald-bright));
  margin: 14px 0 10px;
}

.field input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--emerald-bright);
  border: 2px solid #043328;
  box-shadow: 0 0 10px var(--emerald-bright);
  cursor: grab;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

/* ---------------------------------------------------------- */
/* Strategy calculators                                        */
/* ---------------------------------------------------------- */

.calc-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.calc-tab {
  --tab-color: var(--emerald-bright);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.calc-tab::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--tab-color);
  opacity: 0.4;
  transition: opacity 150ms ease, box-shadow 150ms ease;
}

.calc-tab:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.18); }

.calc-tab.active {
  color: var(--tab-color);
  border-color: color-mix(in srgb, var(--tab-color) 45%, transparent);
  background: color-mix(in srgb, var(--tab-color) 12%, transparent);
}

.calc-tab.active::before { opacity: 1; box-shadow: 0 0 8px var(--tab-color); }

.calc-header { margin-bottom: 6px; }

.calc-header .calc-kicker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.calc-header p { margin: 0; font-size: 13px; color: var(--muted); max-width: 52ch; }

.param-row { margin-top: 16px; }

.param-row .param-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.param-row .param-value { font-size: 12.5px; color: var(--blue-soft); letter-spacing: 0.02em; }

.param-row input[type="range"] {
  width: 100%;
  appearance: none;
  height: 4px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #0ea371 var(--fill, 50%), rgba(255, 255, 255, 0.1) var(--fill, 50%));
  margin: 2px 0 0;
}

.param-row input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 999px;
  background: var(--emerald-bright);
  border: 2px solid #043328;
  box-shadow: 0 0 10px var(--emerald-bright);
  cursor: grab;
}

.calc-toggles { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }

.calc-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.calc-toggle.on {
  color: var(--emerald-bright);
  border-color: var(--border-emerald);
  background: var(--emerald-glow);
}

.calc-toggle input { display: none; }

.calc-reset {
  margin-top: 20px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
}

.calc-reset:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.2); }

.calc-results-col { display: flex; flex-direction: column; gap: 14px; }

.calc-hero {
  border-color: color-mix(in srgb, var(--strategy-color, #34d399) 30%, transparent);
}

.calc-hero > label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.hero-value {
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}

.hero-value.pos { color: var(--emerald-bright); text-shadow: 0 0 30px rgba(52, 211, 153, 0.35); }
.hero-value.neg { color: var(--red); text-shadow: 0 0 30px rgba(248, 113, 113, 0.3); }

.hero-sub { margin: 10px 0 0; font-size: 13.5px; color: var(--muted); }
.hero-sub strong { font-family: var(--font-mono); font-weight: 600; }
.hero-sub strong.pos { color: var(--emerald-bright); }
.hero-sub strong.neg { color: var(--red); }

.breakdown-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  font-size: 12.5px;
}

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

.breakdown-row .breakdown-dots {
  flex: 1;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.14);
  transform: translateY(-3px);
}

.breakdown-row .breakdown-value { font-family: var(--font-mono); font-size: 12px; }
.breakdown-value.pos { color: var(--emerald-bright); }
.breakdown-value.neg { color: var(--red); }

.breakdown-row.total {
  margin-top: 6px;
  padding-top: 9px;
  border-top: 1px solid var(--border-soft);
}

.breakdown-row.total .breakdown-label { color: var(--ink); font-weight: 600; }
.breakdown-row.total .breakdown-value { font-size: 13.5px; font-weight: 600; }

.calc-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.calc-metric {
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.25);
}

.calc-metric label {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-deep);
  margin-bottom: 5px;
}

.calc-metric strong {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.calc-metric.ok strong { color: var(--emerald-bright); }
.calc-metric.blue strong { color: var(--blue-soft); }
.calc-metric.warn strong { color: var(--amber); }
.calc-metric.bad strong { color: var(--red); }

.risk-meter {
  position: relative;
  height: 6px;
  margin: 14px 2px 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #10b981 0%, #fbbf24 50%, #f87171 100%);
  opacity: 0.85;
}

.risk-pin {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  background: #f7faf9;
  border: 3px solid #001a13;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.calc-section-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 20px 0 10px;
}

.growth-chart { width: 100%; height: auto; display: block; }

.div-row {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) 76px;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  font-family: var(--font-mono);
  font-size: 11px;
}

.div-label { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.div-value { text-align: right; }
.div-value.pos { color: var(--emerald-bright); }
.div-value.neg { color: var(--red); }

.div-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.div-track::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -2px;
  bottom: -2px;
  width: 1px;
  background: rgba(255, 255, 255, 0.2);
}

.div-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
}

.div-fill.pos { background: linear-gradient(90deg, rgba(16, 185, 129, 0.5), var(--emerald-bright)); }
.div-fill.neg { background: linear-gradient(270deg, rgba(248, 113, 113, 0.5), var(--red)); }

.calc-note {
  margin: 18px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted-deep);
}

@media (max-width: 1080px) {
  .calc-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Liquidity path simulator */
.lp-path-intro { position: relative; overflow: hidden; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 18px; padding: 24px; border: 1px solid rgba(251,191,36,.18); border-radius: var(--radius-lg); background: radial-gradient(circle at 90% 0%, rgba(251,191,36,.11), transparent 36%), #04271e; }
.lp-path-intro span { font: 600 10px var(--font-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--amber); }
.lp-path-intro h2 { margin: 7px 0 5px; font-size: 27px; }
.lp-path-intro p, .lp-chart-card > p { margin: 0; color: var(--muted); font-size: 12.5px; }
.lp-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.lp-actions button, .lp-actions label { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: rgba(255,255,255,.035); color: var(--muted); font: 600 10px var(--font-mono); cursor: pointer; }
.lp-actions input { display: none; }
.lp-workspace { display: grid; grid-template-columns: 330px minmax(0,1fr); gap: 18px; align-items: start; }
.lp-controls { position: sticky; top: 18px; }
.lp-controls h3, .lp-chart-card h3, .lp-events h3 { margin: 0 0 13px; font-size: 13px; }
.lp-controls h3:not(:first-child) { margin-top: 23px; padding-top: 19px; border-top: 1px solid var(--border-soft); }
.lp-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lp-field { display: block; }
.lp-field > span { display: block; margin-bottom: 5px; color: var(--muted); font: 9px var(--font-mono); letter-spacing: .13em; text-transform: uppercase; }
.lp-field > div { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; background: rgba(0,0,0,.22); }
.lp-field input, .lp-field textarea { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font: 12px var(--font-mono); }
.lp-field input { padding: 9px; }
.lp-field em { padding-right: 9px; color: var(--muted-deep); font: normal 9px var(--font-mono); }
.lp-path-input { margin-top: 12px; }
.lp-path-input textarea { box-sizing: border-box; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: rgba(0,0,0,.22); line-height: 1.6; resize: vertical; }
.lp-field small { display: block; margin-top: 5px; color: var(--muted-deep); font-size: 9px; }
.lp-mode-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin-bottom: 11px; }
.lp-mode-row button { padding: 8px 3px; border: 1px solid var(--border); border-radius: 8px; background: transparent; color: var(--muted); font: 10px var(--font-mono); text-transform: capitalize; cursor: pointer; }
.lp-mode-row button.active { border-color: rgba(251,191,36,.5); background: rgba(251,191,36,.09); color: var(--amber); }
.lp-results { display: flex; min-width: 0; flex-direction: column; gap: 14px; }
.lp-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.lp-summary > div { padding: 14px; border: 1px solid var(--border-soft); border-radius: var(--radius); background: rgba(255,255,255,.025); }
.lp-summary label, .lp-summary small { display: block; color: var(--muted-deep); font: 9px var(--font-mono); text-transform: uppercase; letter-spacing: .1em; }
.lp-summary strong { display: block; margin: 7px 0 4px; font: 600 17px var(--font-mono); }
.lp-summary strong.pos { color: var(--emerald-bright); } .lp-summary strong.neg { color: var(--red); }
.lp-chart-card { min-width: 0; }
.lp-path-chart { display: block; width: 100%; height: 230px; margin-top: 8px; }
.lp-path-chart text { fill: var(--muted-deep); font: 9px var(--font-mono); }
.lp-chart-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 13px; color: var(--muted); font: 9px var(--font-mono); }
.lp-chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.lp-chart-legend i { width: 8px; height: 3px; border-radius: 3px; }
.lp-events { min-width: 0; }
.lp-events table { width: 100%; border-collapse: collapse; font: 10px var(--font-mono); }
.lp-events th, .lp-events td { padding: 9px 10px; text-align: left; white-space: nowrap; border-top: 1px solid var(--border-soft); }
.lp-events th { color: var(--muted-deep); font-weight: 500; } .lp-events td { color: var(--muted); } .lp-events td.amber { color: var(--amber); }
.lp-warning { padding: 13px 15px; border: 1px solid rgba(251,191,36,.18); border-radius: var(--radius); background: rgba(251,191,36,.045); color: var(--muted); font-size: 11px; line-height: 1.6; }
.lp-warning strong { color: var(--amber); }
.admin-pool-page { max-width: 780px; }
.admin-pool-hero { padding: 24px; margin-bottom: 16px; border: 1px solid rgba(52,211,153,.22); border-radius: var(--radius-lg); background: radial-gradient(circle at right top, rgba(52,211,153,.1), transparent 42%), #04271e; }
.admin-pool-hero span { color: var(--emerald-bright); font: 10px var(--font-mono); text-transform: uppercase; letter-spacing: .18em; }
.admin-pool-hero h2 { margin: 8px 0; }.admin-pool-hero p { margin: 0; color: var(--muted); }
.admin-pool-form { display: grid; grid-template-columns: 180px 1fr auto; align-items: end; gap: 12px; }.admin-pool-form label { display: grid; gap: 6px; color: var(--muted); font: 10px var(--font-mono); text-transform: uppercase; letter-spacing: .12em; }.admin-pool-form input,.admin-pool-form select { min-height: 38px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: rgba(0,0,0,.25); color: var(--ink); font: 12px var(--font-mono); }.admin-pool-verified { margin-top: 14px; }.admin-pool-verified h3 { margin: 12px 0 5px; }.admin-pool-verified p { color: var(--muted); }
@media (max-width: 700px) { .admin-pool-form { grid-template-columns: 1fr; } }
@media (max-width: 1050px) { .lp-workspace { grid-template-columns: 1fr; } .lp-controls { position: static; } .lp-summary { grid-template-columns: 1fr 1fr; } }
@media (max-width: 650px) { .lp-path-intro { align-items: flex-start; flex-direction: column; } .lp-summary { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------- */
/* Create position + activity feed                             */
/* ---------------------------------------------------------- */

.amount-wrap { position: relative; }

.amount-wrap input { width: 100%; padding-right: 62px; }

.amount-wrap em {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--muted-deep);
}

.field-hint {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted-deep);
}

.field-error {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--red);
}

.field input.has-error { border-color: rgba(248, 113, 113, 0.5); }

.unit-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
  cursor: pointer;
}

.unit-toggle:hover { color: var(--emerald-bright); border-color: var(--border-emerald); }

.amount-wrap input { padding-right: 82px; }

.max-button {
  border: 0;
  background: transparent;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--emerald-bright);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.field-hint .conv { color: var(--blue-soft); margin-right: 8px; }

.position-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  white-space: nowrap;
  width: min-content;
}

.position-actions .action-pill {
  justify-content: flex-start;
}

.action-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.action-pill:hover {
  border-color: var(--border-emerald);
  background: var(--emerald-glow);
  color: var(--emerald-bright);
}

.action-pill.danger:hover {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.12);
  color: var(--red);
}

.action-pill:disabled {
  opacity: 0.45;
  cursor: wait;
}

.automation-toggles {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 5px;
  white-space: nowrap;
}

button.badge.toggle {
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

button.badge.toggle:hover {
  border-color: var(--emerald-bright);
}

button.badge.toggle:disabled {
  opacity: 0.45;
  cursor: wait;
}

.positions-summary {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 10px;
}

@media (max-width: 1100px) {
  .positions-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

#assumedApr {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--emerald-bright);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 4px;
}

.range-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--muted-deep);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-deep);
  line-height: 1.7;
}

.range-labels strong { color: var(--ink); font-size: 12px; letter-spacing: 0; text-transform: none; }
.range-labels .center { text-align: center; }
.range-labels .center strong { color: var(--blue-soft); }
.range-labels .right { text-align: right; }

.checklist-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
}

.check-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 10px;
  color: var(--muted-deep);
  flex: none;
}

.check-icon.ok {
  border-color: var(--border-emerald);
  background: var(--emerald-glow);
  color: var(--emerald-bright);
}

.deposit-log {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--bg-terminal);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.7;
  max-height: 220px;
  overflow-y: auto;
}

.deposit-log .log-line { color: var(--muted); }
.deposit-log .log-line::before { content: "› "; color: var(--muted-deep); }
.deposit-log .log-line.ok { color: var(--emerald-bright); }
.deposit-log .log-line.bad { color: var(--red); }

.feed-card { padding: 6px 0; }

.feed-item {
  display: flex;
  gap: 14px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-soft);
}

.feed-item:last-child { border-bottom: 0; }
.feed-item.unread { background: rgba(16, 185, 129, 0.04); }

.feed-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  margin-top: 7px;
  flex: none;
  background: var(--blue-soft);
}

.feed-dot.info { background: var(--blue-soft); }
.feed-dot.success { background: var(--emerald-bright); }
.feed-dot.warning { background: var(--amber); }
.feed-dot.error, .feed-dot.critical { background: var(--red); }

.feed-body { min-width: 0; flex: 1; }

.feed-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
  font-size: 14px;
}

.feed-read {
  border: 1px solid var(--border);
  background: transparent;
  border-radius: var(--radius-full);
  padding: 2px 10px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
}

.feed-read:hover { color: var(--emerald-bright); border-color: var(--border-emerald); }

.feed-body p { margin: 4px 0 8px; font-size: 13px; color: var(--muted); }

.feed-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted-deep);
}

.feed-meta a { color: var(--blue-soft); }

/* ---------------------------------------------------------- */
/* Code block, dialog, skeleton                                */
/* ---------------------------------------------------------- */

.code-block {
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--bg-terminal);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.8;
  color: var(--emerald-bright);
}

.dialog {
  border: 0;
  border-radius: var(--radius-lg);
  padding: 0;
  background: transparent;
  max-width: 460px;
  width: calc(100vw - 40px);
}

.dialog::backdrop { background: rgba(0, 10, 7, 0.7); backdrop-filter: blur(4px); }

.dialog-panel {
  margin: 0;
  padding: 24px 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #032a1f, #011811);
  box-shadow: var(--shadow-card), var(--glow-emerald);
  color: var(--ink);
}

.dialog-panel header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.dialog-panel h2 { font-size: 16px; font-weight: 700; }
.dialog-panel > p { color: var(--muted); font-size: 13.5px; margin: 0 0 16px; }

.auth-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }

.auth-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.dialog-panel > .primary-button { margin-top: 20px; width: 100%; }

.wallet-status {
  margin: 14px 0 0;
  padding: 11px 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.3);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--emerald-bright);
}

.wallet-status.error { color: var(--red); border-color: rgba(248, 113, 113, 0.3); }
.wallet-status[hidden] { display: none; }

.skeleton-stack { display: flex; flex-direction: column; gap: 12px; }

.skeleton-stack span {
  display: block;
  height: 64px;
  border-radius: var(--radius);
  background: linear-gradient(100deg, rgba(255,255,255,0.04) 40%, rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.04) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

/* ---------------------------------------------------------- */
/* Entry animation                                             */
/* ---------------------------------------------------------- */

.content > * {
  animation: rise 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.content > *:nth-child(2) { animation-delay: 60ms; }
.content > *:nth-child(3) { animation-delay: 120ms; }
.content > *:nth-child(4) { animation-delay: 180ms; }
.content > *:nth-child(5) { animation-delay: 240ms; }

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------- */
/* Responsive                                                  */
/* ---------------------------------------------------------- */

@media (max-width: 1080px) {
  .command { grid-template-columns: 1fr; gap: 26px; }
  .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--border-soft);
  }

  .nav { flex-direction: row; flex-wrap: wrap; margin: 0; }
  .sidebar-footer { margin: 0; }
  .main { padding: 20px 18px 48px; }
  .grid.two { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .signal-board { grid-template-columns: 1fr 1fr; }
}

/* Position performance panel (fees/IL history + impermanent-loss report) */
.performance-row td { padding: 0; border-top: none; }

.performance-panel {
  margin: 4px 0 12px;
}

.performance-panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.performance-panel-header h3 { margin: 0; font-size: 14px; }

.performance-chart {
  width: 100%;
  height: 140px;
  display: block;
  margin-top: 12px;
}

.welcome-video {
  width: 100%;
  max-height: 420px;
  display: block;
  margin-top: 12px;
  border-radius: 12px;
  background: #000;
}

.performance-sparkline {
  width: 100%;
  height: 56px;
  display: block;
  margin-top: 12px;
}

.basic-performance-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.basic-performance-header h2 { margin: 0; }

.perf-window-switch { flex-shrink: 0; }

.performance-chart-legend {
  display: flex;
  gap: 16px;
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}

.legend-swatch {
  display: inline-block;
  width: 14px;
  height: 2px;
  background: var(--blue-soft);
  margin-right: 5px;
  vertical-align: middle;
}

.legend-swatch.dashed {
  background: repeating-linear-gradient(90deg, var(--muted) 0 3px, transparent 3px 5px);
}

.performance-events-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 12px;
}

.performance-events-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-deep);
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-soft);
}

.performance-events-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-soft);
}

.performance-events-table td.ok { color: var(--emerald-bright); }
.performance-events-table td.bad { color: var(--red); }

.mantis-recommends {
  margin-bottom: 16px;
  padding: 0;
  overflow: hidden;
}

.mantis-recommends-banner {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  object-position: center 32%;
}

.mantis-recommends-body {
  padding: 18px 20px 16px;
}

.mantis-recommends-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 13px;
}

.mantis-recommends-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-deep);
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-soft);
}

.mantis-recommends-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--border-soft);
}

.mantis-recommends-table td.ok { color: var(--emerald-bright); }
.mantis-recommends-table td.bad { color: var(--red); }

/* Video banner: the blink clip's eye-line sits at ~26% of the frame
   (higher than the still art's), so it needs its own crop anchor to keep
   the eyes centered in the 260px strip. Images keep the 32% anchor above. */
video.mantis-recommends-banner {
  object-position: center 15%;
}
