html {
  scroll-behavior: smooth;
}

:root {
  color-scheme: light;
  --ink: #17201c;
  --muted: #5d6a64;
  --line: #d9e0dc;
  --page: #f6f4ee;
  --panel: #ffffff;
  --green: #1f7a5b;
  --teal: #0a7c86;
  --blue: #2865ad;
  --red: #b9483f;
  --gold: #bc8424;
  --violet: #6f5aa7;
  --shadow: 0 18px 50px rgba(23, 32, 28, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(31, 122, 91, 0.12), transparent 32rem),
    linear-gradient(315deg, rgba(188, 132, 36, 0.14), transparent 28rem),
    var(--page);
  color: var(--ink);
  font-family: 'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1360px, calc(100% - 24px));
  margin: 0 auto;
  padding: 16px 0 32px;
}



/* ========== API Connection Bar ========== */
.api-bar {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
}

.api-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.api-bar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 700;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}

.status-dot.live {
  background: var(--green);
  box-shadow: 0 0 6px rgba(31, 122, 91, 0.5);
  animation: pulse-dot 2s ease-in-out infinite;
}

.status-dot.loading {
  background: var(--gold);
  animation: pulse-dot 1s ease-in-out infinite;
}

.status-dot.error {
  background: var(--red);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.api-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.api-bar-actions input {
  min-height: 36px;
  min-width: 200px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  font-size: 0.86rem;
  color: var(--ink);
  background: #fbfbf8;
  outline: none;
}

.api-bar-actions input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 122, 91, 0.12);
}

.api-bar-actions button {
  min-height: 36px;
  border: 1px solid var(--green);
  border-radius: 6px;
  padding: 0 14px;
  color: #fff;
  background: var(--green);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}

.api-bar-actions button:hover {
  opacity: 0.88;
}

#api-disconnect-btn {
  border-color: var(--line);
  color: var(--ink);
  background: #fff;
}

.api-key-type-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 8px;
  background: rgba(23, 32, 28, 0.05);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-right: 6px;
}

.api-help-link {
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
}

.api-help-link:hover {
  text-decoration: underline;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: stretch;
  min-height: 140px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 140px;
  padding: clamp(14px, 2.5vw, 22px);
  border: 1px solid rgba(23, 32, 28, 0.08);
  border-radius: 8px;
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.96) 0 16%, transparent 17%),
    linear-gradient(120deg, rgba(255, 255, 255, 0.88), rgba(246, 244, 238, 0.38)),
    repeating-linear-gradient(90deg, rgba(23, 32, 28, 0.06) 0 1px, transparent 1px 56px),
    repeating-linear-gradient(0deg, rgba(23, 32, 28, 0.05) 0 1px, transparent 1px 56px);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.hero-copy::after {
  content: "";
  position: absolute;
  inset: auto 24px 10px auto;
  width: min(28vw, 240px);
  height: 38px;
  background:
    linear-gradient(90deg, var(--green), var(--teal), var(--blue), var(--gold), var(--red));
  clip-path: polygon(0 58%, 16% 44%, 30% 50%, 45% 26%, 60% 34%, 76% 16%, 100% 24%, 100% 100%, 0 100%);
  opacity: 0.32;
  z-index: 0;
}

.hero-copy > * {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 6px;
  font-size: clamp(1.8rem, 3.8vw, 2.6rem);
  line-height: 1.0;
  letter-spacing: -0.01em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.1rem, 1.5vw, 1.35rem);
  letter-spacing: -0.01em;
}

.lede {
  max-width: 710px;
  margin-bottom: 0;
  color: #33423a;
  font-size: clamp(0.88rem, 1.1vw, 0.98rem);
  line-height: 1.4;
}

.market-pulse {
  display: grid;
  gap: 8px;
  align-content: end;
}

.market-pulse > div {
  min-height: 64px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 6px 20px rgba(23, 32, 28, 0.05);
}

.pulse-label,
.metric-row span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.72rem;
}

.market-pulse strong,
.metric-row strong {
  display: block;
  font-size: 1.05rem;
}

.control-bar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(220px, 380px) 1fr;
  gap: 14px;
  align-items: center;
  margin: 22px 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
}

.search-box {
  display: grid;
  gap: 6px;
  position: relative;
}

.search-box span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.search-box input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px 0 38px;
  color: var(--ink);
  background: #fbfbf8 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%235d6a64' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' class='feather feather-search' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 14px center;
  background-size: 16px;
  outline: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-box input:focus {
  border-color: var(--green);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(31, 122, 91, 0.12), 0 4px 18px rgba(31, 122, 91, 0.08);
}

.segmented,
.value-chain {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.segmented button,
.chain-filter-btn {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  transition: all 0.2s ease;
}

.segmented button:hover,
.chain-filter-btn:hover {
  border-color: var(--ink);
}

.segmented button.active,
.chain-filter-btn.active {
  border-color: var(--ink);
  color: #fff;
  background: var(--ink);
}

.value-chain {
  margin-bottom: 20px;
  padding: 14px;
  border: 1px solid rgba(23, 32, 28, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(31, 122, 91, 0.1), rgba(40, 101, 173, 0.08), rgba(188, 132, 36, 0.11)),
    rgba(255, 255, 255, 0.64);
}

.momentum-board {
  margin-bottom: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(23, 32, 28, 0.96), rgba(29, 49, 43, 0.94)),
    #17201c;
  color: #fff;
  box-shadow: var(--shadow);
}

.momentum-board .eyebrow,
.momentum-board .result-count {
  color: #a9c5b8;
}

.momentum-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.momentum-spotlight {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 310px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 16px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(188, 132, 36, 0.16), transparent 52%),
    linear-gradient(315deg, rgba(40, 101, 173, 0.14), transparent 54%),
    #101814;
}

.momentum-spotlight::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  transform: scale(1.1);
}

.momentum-spotlight > * {
  position: relative;
  z-index: 1;
}

.pump-badge {
  width: max-content;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 4px 8px;
  color: #17201c;
  background: #f2c86f;
  font-size: 0.65rem;
  font-weight: 900;
  text-transform: uppercase;
}

.spotlight-main {
  margin: 10px 0;
}

.spotlight-ticker {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 0.9;
  letter-spacing: -0.02em;
}

.spotlight-name {
  margin: 4px 0 0;
  color: #d8e6df;
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  font-weight: 700;
}

.pump-number {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
}

.pump-number strong {
  color: #f2c86f;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  line-height: 0.9;
}

.pump-number span {
  max-width: 160px;
  padding-bottom: 4px;
  color: #b9c9c1;
  font-size: 0.78rem;
}

.spotlight-chart {
  width: 100%;
  height: 118px;
  display: block;
}

.spotlight-note {
  margin: 0;
  max-width: 520px;
  color: #c7d7d0;
  line-height: 1.5;
}

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

.momentum-stock {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 6px;
  min-height: 118px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(6px);
  transition: border-color 0.25s, background 0.25s, transform 0.25s;
}

.momentum-stock:hover,
.momentum-stock:focus-visible {
  border-color: rgba(242, 200, 111, 0.78);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
  outline: none;
}

/* Header container: vertical flex alignment */
.momentum-stock > div:first-of-type {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.momentum-stock strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.momentum-stock span {
  color: #b9c9c1;
  font-size: 0.68rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.momentum-stock .logo-wrapper {
  margin-right: 4px;
}

.mini-line {
  width: 100%;
  height: 32px;
  display: block;
  align-self: center;
  margin: 2px 0;
}

.momentum-change {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.momentum-change strong {
  color: #f2c86f;
  font-size: 0.92rem;
  font-weight: 900;
}

.momentum-change .change-label {
  font-size: 0.6rem;
  color: #b9c9c1;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 4px;
  border-radius: 4px;
  text-overflow: clip;
  overflow: visible;
  white-space: nowrap;
}

/* ========== Stylized Glowing Sparklines ========== */
svg {
  overflow: visible; /* Prevent glow from clipping */
}

/* Global Sparkline Area opacity fix */
svg path.area {
  opacity: 0.12 !important;
  transition: opacity 0.3s;
}

/* Spotlight Glowing Neon Emerald Sparkline */
.spotlight-chart {
  color: #1f7a5b !important;
  padding: 4px 6px;
  box-sizing: border-box;
}

.spotlight-chart path.area {
  fill: #1f7a5b !important;
  opacity: 0.08 !important;
}

.spotlight-chart path:not(.area) {
  stroke: #1f7a5b !important;
  stroke-width: 4px !important;
  filter: drop-shadow(0 0 6px rgba(31, 122, 91, 0.5));
}

/* Mini Lines Glowing Gold/Amber Sparklines */
.momentum-board .mini-line {
  color: #f2c86f !important;
}

.momentum-board .mini-line path.area {
  fill: #f2c86f !important;
  opacity: 0.05 !important;
}

.momentum-board .mini-line path:not(.area) {
  stroke: #f2c86f !important;
  stroke-width: 2.5px !important;
  filter: drop-shadow(0 0 4px rgba(242, 200, 111, 0.3));
}

.mentioned-board {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(70, 109, 163, 0.06), rgba(31, 122, 91, 0.04)),
    rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 32px rgba(23, 32, 28, 0.08);
}

.mentioned-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.mentioned-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.mentioned-card:hover,
.mentioned-card:focus-visible {
  border-color: var(--green);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(31, 122, 91, 0.1);
  outline: none;
}

.mentioned-symbol {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mentioned-symbol > div {
  flex: 1;
  min-width: 0;
}

.mentioned-symbol strong {
  font-size: 1rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 4px;
}

.mentioned-symbol span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mentioned-rank {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
}

.mentioned-rank.rank-up {
  background: rgba(31, 122, 91, 0.1);
  color: var(--green);
}

.mentioned-rank.rank-down {
  background: rgba(185, 72, 63, 0.1);
  color: var(--red);
}

.mentioned-rank.rank-flat {
  background: rgba(23, 32, 28, 0.06);
  color: var(--muted);
}

.mentioned-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.mentioned-stat {
  text-align: center;
}

.mentioned-stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.mentioned-stat strong {
  font-size: 0.88rem;
  font-weight: 800;
}

.mentioned-chart {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--green);
}

.mentioned-chart .mini-line {
  flex: 1;
  height: 38px;
  min-width: 0;
}

.mentioned-change {
  font-weight: 900;
  font-size: 0.88rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.mentioned-change.up { color: var(--green); }
.mentioned-change.down { color: var(--red); }

.mentioned-source-note {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(70, 109, 163, 0.06);
  border: 1px solid rgba(70, 109, 163, 0.12);
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.mentioned-source-note a {
  color: #466da3;
  font-weight: 700;
  text-decoration: none;
}

.mentioned-source-note a:hover { text-decoration: underline; }

.onchain-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  margin-left: 6px;
  border: 1px solid rgba(31, 122, 91, 0.24);
  border-radius: 999px;
  padding: 2px 6px;
  color: var(--green);
  background: rgba(31, 122, 91, 0.09);
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
  vertical-align: middle;
}

.momentum-stock .onchain-badge,
.spotlight-name .onchain-badge {
  border-color: rgba(242, 200, 111, 0.32);
  color: #f2c86f;
  background: rgba(242, 200, 111, 0.12);
}

.bubble .onchain-badge {
  display: flex;
  justify-content: center;
  margin: 4px auto 2px;
  border-color: rgba(255, 255, 255, 0.36);
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.56rem;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 22px;
  align-items: start;
}

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

.result-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

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

.category-card {
  display: grid;
  gap: 16px;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 28px rgba(23, 32, 28, 0.06);
  text-align: left;
  transition: border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
              transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
              box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 16px 36px color-mix(in srgb, var(--accent) 14%, rgba(23, 32, 28, 0.08));
}

.category-card.active {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 12px 30px color-mix(in srgb, var(--accent) 22%, rgba(23, 32, 28, 0.12));
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.card-top {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: start;
}

.category-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 900;
  background: var(--accent, var(--green));
}

.category-card h3 {
  margin: 0 0 8px;
  font-size: 1.22rem;
  letter-spacing: 0;
}

.category-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.tag-row,
.stock-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  border-radius: 999px;
  padding: 5px 9px;
  color: #324139;
  background: #eef2ef;
  font-size: 0.78rem;
  font-weight: 700;
}

.stock-pill {
  display: grid;
  gap: 3px;
  min-width: 88px;
  min-height: 54px;
  border: 1px solid #dfe5e1;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fbfbf8;
}

.stock-pill[data-ticker] {
  cursor: pointer;
}

.stock-pill:focus-visible,
.supply-stock-pill:focus-visible {
  outline: 2px solid var(--green) !important;
  outline-offset: 2px !important;
}

.stock-pill strong {
  font-size: 0.95rem;
}

.stock-pill span {
  color: var(--muted);
  font-size: 0.76rem;
}

.detail-panel {
  position: sticky;
  top: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: #17201c;
  color: #fff;
  box-shadow: var(--shadow);
}

.detail-panel .eyebrow,
.detail-panel #detail-description,
.detail-panel .metric-row span {
  color: #b9c9c1;
}

#detail-description {
  line-height: 1.55;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.metric-row > div {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 14px;
}

.company-list {
  display: grid;
  gap: 10px;
}

.company-item {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.06);
}

.ticker {
  color: #fff;
  font-weight: 900;
}

.company-item span {
  display: block;
  color: #b9c9c1;
  font-size: 0.78rem;
}

.company-item strong:last-child {
  white-space: nowrap;
  color: #f2c86f;
  font-size: 0.85rem;
}

.bubble-map {
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.82);
}

.bubble-stage {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px;
  min-height: 280px;
  padding: 14px 0;
}

.bubble {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: var(--size);
  height: var(--size);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  padding: 8px;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 16px 34px rgba(23, 32, 28, 0.18);
  text-align: center;
  flex-shrink: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.bubble > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.bubble[data-ticker] {
  cursor: pointer;
}

.bubble strong,
.bubble span {
  display: block;
}

.bubble strong {
  font-size: clamp(0.8rem, calc(var(--size) / 5), 1.45rem);
}

.bubble span {
  opacity: 0.86;
  font-size: clamp(0.62rem, calc(var(--size) / 9), 0.82rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.empty-state {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 32px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
}

.chart-tooltip {
  position: fixed;
  z-index: 20;
  width: min(340px, calc(100vw - 24px));
  border: 1px solid rgba(23, 32, 28, 0.18);
  border-radius: 8px;
  padding: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 48px rgba(23, 32, 28, 0.24);
  pointer-events: none;
}

.chart-tooltip.hidden {
  display: none;
}

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

.tooltip-head strong {
  display: block;
  font-size: 1.05rem;
}

.tooltip-head span {
  color: var(--muted);
  font-size: 0.78rem;
}

.tooltip-change {
  color: var(--green);
  font-weight: 900;
  white-space: nowrap;
}

.tooltip-chart {
  width: 100%;
  height: 92px;
}

.tooltip-foot {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.stock-pill .onchain-badge,
.company-item .onchain-badge,
.bubble .onchain-badge,
.momentum-stock .onchain-badge,
.spotlight-name .onchain-badge {
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1.2;
}

.stock-pill .onchain-badge,
.company-item .onchain-badge {
  color: var(--green);
}



.chain-infographic {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(23, 32, 28, 0.08);
  border-radius: 8px;
  padding: 10px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.56)),
    repeating-linear-gradient(90deg, rgba(23, 32, 28, 0.04) 0 1px, transparent 1px 72px);
  box-shadow: var(--shadow);
}

.chain-stage {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.stage-label {
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.86);
}

.stage-label span {
  color: var(--green);
  font-size: 0.65rem;
  font-weight: 900;
}

.stage-label strong {
  font-size: 0.85rem;
  line-height: 1.1;
}

.chain-track {
  display: grid;
  gap: 10px;
  align-items: stretch;
}

.two-step {
  grid-template-columns: minmax(0, 1fr) 30px minmax(0, 1fr);
}

.three-step {
  grid-template-columns: minmax(0, 1fr) 30px minmax(0, 1fr) 30px minmax(0, 1fr);
}

.one-step {
  grid-template-columns: minmax(0, 1fr);
}

.compute-track {
  grid-template-columns:
    minmax(0, 1fr) 28px minmax(0, 1fr) 28px minmax(0, 1.12fr) 28px
    minmax(0, 1fr) 28px minmax(0, 1fr);
}

.chain-infographic .chain-node {
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 6px;
  min-height: 295px;
  border: 1px solid color-mix(in srgb, var(--accent), #ffffff 72%);
  border-radius: 6px;
  padding: 10px;
  color: var(--ink);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent), #ffffff 92%), rgba(255, 255, 255, 0.96)),
    #fff;
  box-shadow: 0 6px 20px rgba(23, 32, 28, 0.04);
}

.chain-infographic .primary-node,
.chain-infographic .final-node {
  box-shadow: 0 16px 36px color-mix(in srgb, var(--accent), transparent 78%);
}

.chain-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  padding: 6px;
  color: #fff;
  background: var(--accent);
}

.chain-icon path,
.chain-icon circle,
.chain-icon rect {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.chain-infographic h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
}

.chain-infographic p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.chain-infographic details {
  align-self: end;
  border-top: 1px solid color-mix(in srgb, var(--accent), #ffffff 68%);
  padding-top: 8px;
}

.chain-infographic summary {
  width: max-content;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
}

.chain-infographic details p {
  margin-top: 10px;
  font-size: 0.88rem;
}

.chain-arrow,
.chain-branch {
  position: relative;
  display: block;
  min-height: 100%;
}

.chain-arrow::before,
.chain-branch::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 2px;
  right: 2px;
  height: 3px;
  border-radius: 999px;
  background: rgba(23, 32, 28, 0.42);
  transform: translateY(-50%);
}

.chain-arrow::after,
.chain-branch::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  width: 10px;
  height: 10px;
  border-top: 3px solid rgba(23, 32, 28, 0.42);
  border-right: 3px solid rgba(23, 32, 28, 0.42);
  transform: translateY(-50%) rotate(45deg);
}

.chain-drop {
  justify-self: center;
  width: 3px;
  height: 26px;
  border-radius: 999px;
  background: rgba(23, 32, 28, 0.38);
  position: relative;
}

.chain-drop::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 10px;
  height: 10px;
  border-right: 3px solid rgba(23, 32, 28, 0.38);
  border-bottom: 3px solid rgba(23, 32, 28, 0.38);
  transform: translateX(-50%) rotate(45deg);
}



.company-strip {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.company-strip span {
  border: 1px solid rgba(23, 32, 28, 0.1);
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 0.76rem;
  font-weight: 900;
}

.company-strip .stock-pill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  border-radius: 8px;
  padding: 6px 10px;
}

.company-strip .stock-pill strong {
  color: var(--ink);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.company-strip .stock-pill span {
  border: 0;
  border-radius: 0;
  padding: 0;
  color: var(--muted);
  background: transparent;
  font-size: 0.76rem;
  font-weight: 700;
}

.company-strip .stock-pill[data-ticker] {
  cursor: pointer;
}

.supply-stock-pill {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.supply-stock-pill:hover,
.supply-stock-pill:focus-visible {
  border-color: var(--ink) !important;
  background: var(--ink) !important;
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 6px 14px rgba(23, 32, 28, 0.16);
}

.supply-stock-pill:hover strong,
.supply-stock-pill:hover span,
.supply-stock-pill:focus-visible strong,
.supply-stock-pill:focus-visible span {
  color: #fff !important;
}



/* ========== Language Switcher ========== */
.lang-switcher {
  position: relative;
  display: flex;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(31, 122, 91, 0.08);
  border: 1px solid rgba(31, 122, 91, 0.15);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.lang-btn:hover {
  background: rgba(31, 122, 91, 0.14);
  border-color: var(--green);
}

.lang-btn.active {
  background: rgba(31, 122, 91, 0.14);
  border-color: var(--green);
}

.lang-flag {
  font-size: 1rem;
  line-height: 1;
}

.lang-code {
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lang-chevron {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.lang-btn.active .lang-chevron {
  transform: rotate(180deg);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px;
  min-width: 170px;
  box-shadow: 0 8px 24px rgba(23, 32, 28, 0.12);
  z-index: 200;
  animation: langDropIn 0.15s ease;
}

.lang-dropdown.hidden {
  display: none;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--ink);
  font-family: inherit;
  transition: background 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.lang-option:hover {
  background: rgba(31, 122, 91, 0.08);
}

.lang-option.active {
  color: var(--green);
  font-weight: 600;
}

.lang-option-flag {
  font-size: 1.1rem;
}

.lang-option-label {
  flex: 1;
  text-align: left;
}

.lang-check {
  color: var(--green);
  flex-shrink: 0;
}

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

/* ========== Language Switcher — Responsive ========== */
@media (max-width: 760px) {
  .lang-switcher {
    width: 100%;
    justify-content: center;
  }

  .lang-btn {
    width: 100%;
    justify-content: center;
  }

  .lang-dropdown {
    left: 0;
    right: 0;
  }
}

@media (max-width: 480px) {
  .lang-btn {
    padding: 5px 10px;
    font-size: 0.74rem;
    gap: 4px;
  }

  .lang-flag {
    font-size: 0.9rem;
  }

  .lang-dropdown {
    min-width: 150px;
  }

  .lang-option {
    padding: 7px 10px;
    font-size: 0.78rem;
    gap: 6px;
  }
}


@media (max-width: 1080px) {
  .hero,
  .dashboard,
  .momentum-layout,
  .chain-stage {
    grid-template-columns: 1fr;
  }

  .chain-infographic .chain-node {
    min-height: 138px !important;
  }

  .market-pulse {
    grid-template-columns: repeat(3, 1fr);
  }

  .detail-panel {
    position: static;
  }

  .momentum-ring {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mentioned-grid {
    grid-template-columns: 1fr;
  }



  .two-step,
  .three-step,
  .compute-track {
    grid-template-columns: 1fr;
  }

  .chain-arrow,
  .chain-branch {
    min-height: 24px;
  }

  .chain-arrow::before,
  .chain-branch::before {
    top: 0;
    bottom: 0;
    left: 50%;
    right: auto;
    width: 3px;
    height: auto;
    transform: translateX(-50%);
  }

  .chain-arrow::after,
  .chain-branch::after {
    top: auto;
    right: auto;
    bottom: 1px;
    left: 50%;
    transform: translateX(-50%) rotate(135deg);
  }

}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 1440px);
    padding-top: 10px;
  }

  .hero-copy {
    min-height: 220px;
    padding: 26px;
  }

  .hero-copy::after {
    display: none;
  }

  .control-bar,
  .category-grid,
  .mentioned-card {
    grid-template-columns: 1fr;
  }

  .market-pulse {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
    width: 100% !important;
    margin-top: 10px !important;
  }

  .market-pulse > div {
    min-height: 52px !important;
    padding: 6px 10px !important;
  }

  .pulse-label {
    margin-bottom: 2px !important;
    font-size: 0.65rem !important;
  }

  .market-pulse strong {
    font-size: 0.88rem !important;
  }

  .control-bar {
    position: static;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }

  .momentum-spotlight {
    min-height: 430px;
  }

  .company-item {
    grid-template-columns: 54px 1fr;
  }

  .company-item strong:last-child {
    grid-column: 2;
  }

  .momentum-ring {
    display: flex !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    gap: 12px !important;
    padding: 4px 4px 12px !important;
    margin: 0 -4px !important;
    width: calc(100% + 8px) !important;
    -webkit-overflow-scrolling: touch;
  }

  .momentum-ring::-webkit-scrollbar {
    height: 5px;
  }
  .momentum-ring::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 99px;
  }
  .momentum-ring::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.22);
    border-radius: 99px;
  }

  .momentum-stock {
    min-width: 176px;
    max-width: 220px;
    flex-shrink: 0 !important;
    scroll-snap-align: start;
    min-height: 154px;
  }
}

/* ========== Footer ========== */
.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  padding: 28px 0 8px;
}

.footer-inner {
  display: grid;
  gap: 16px;
}

.footer-disclaimer {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
  max-width: 860px;
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.footer-meta a {
  color: var(--green);
  text-decoration: none;
  font-weight: 700;
}

.footer-meta a:hover {
  text-decoration: underline;
}

/* ========== Animations ========== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.category-card,
.momentum-stock,
.mentioned-card,
.bubble,
.company-item {
  animation: fadeInUp 0.22s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.category-card:nth-child(2) { animation-delay: 0.05s; }
.category-card:nth-child(3) { animation-delay: 0.1s; }
.category-card:nth-child(4) { animation-delay: 0.15s; }
.category-card:nth-child(5) { animation-delay: 0.2s; }
.category-card:nth-child(6) { animation-delay: 0.25s; }

.momentum-stock:nth-child(2) { animation-delay: 0.05s; }
.momentum-stock:nth-child(3) { animation-delay: 0.1s; }
.momentum-stock:nth-child(4) { animation-delay: 0.15s; }
.momentum-stock:nth-child(5) { animation-delay: 0.2s; }
.momentum-stock:nth-child(6) { animation-delay: 0.25s; }
.momentum-stock:nth-child(7) { animation-delay: 0.3s; }
.momentum-stock:nth-child(8) { animation-delay: 0.35s; }

.bubble:nth-child(2) { animation-delay: 0.04s; }
.bubble:nth-child(3) { animation-delay: 0.08s; }
.bubble:nth-child(4) { animation-delay: 0.12s; }
.bubble:nth-child(5) { animation-delay: 0.16s; }
.bubble:nth-child(6) { animation-delay: 0.2s; }
.bubble:nth-child(7) { animation-delay: 0.24s; }
.bubble:nth-child(8) { animation-delay: 0.28s; }

/* ========== Live data indicator ========== */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(31, 122, 91, 0.1);
  color: var(--green);
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.live-badge::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}

/* ========== Improved transitions ========== */

.momentum-stock {
  transition: border-color 0.2s, background 0.2s;
}

.momentum-stock:hover {
  background: rgba(255, 255, 255, 0.1);
}

.bubble {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 20px 44px rgba(23, 32, 28, 0.24);
}

.mentioned-card {
  transition: border-color 0.2s, transform 0.2s;
}

.mentioned-card:hover {
  transform: translateY(-2px);
}

/* ========== Better focus states ========== */
.category-card:focus-visible,
.momentum-stock:focus-visible,
.mentioned-card:focus-visible,
.bubble:focus-visible,
.chain-node:focus-visible,
.chain-filter-btn:focus-visible,
.supply-stock-pill:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* ========== API bar mobile ========== */
@media (max-width: 760px) {
  .api-bar-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .api-bar-actions {
    flex-direction: column;
  }

  .api-bar-actions input {
    min-width: 100%;
  }
}



/* ========== Supply chain intro text ========== */
.chain-intro {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
  max-width: 720px;
}

/* ========== Stock Modal ========== */
.stock-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(23, 32, 28, 0.55);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease;
}

.stock-modal-overlay.hidden {
  display: none;
}

.stock-modal {
  position: relative;
  width: min(540px, 92vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 32px 80px rgba(23, 32, 28, 0.28);
  animation: fadeInUp 0.3s ease;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  color: var(--ink);
  font-size: 1.25rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.05);
}

.modal-header {
  padding: 28px 28px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(31, 122, 91, 0.08), rgba(188, 132, 36, 0.06));
  flex-shrink: 0;
}

.modal-ticker-big {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--accent, var(--green));
  letter-spacing: -0.02em;
}

.modal-company {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 4px;
}

.modal-category {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.modal-body {
  padding: 20px 28px 28px;
  overflow-y: auto;
}

.modal-price-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.modal-price-row > div {
  display: grid;
  gap: 4px;
}

.modal-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.modal-price {
  font-size: 1.4rem;
  font-weight: 900;
}

.modal-change {
  font-size: 1.1rem;
  font-weight: 900;
}

.modal-change.up {
  color: var(--green);
}

.modal-change.down {
  color: var(--red);
}

.modal-chart {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 16px;
  color: var(--green);
  opacity: 0.6;
}

.modal-chart .area {
  opacity: 0.08;
}

/* ========== Stock Modal Details List ========== */
.modal-details-list {
  display: grid;
  gap: 12px;
  margin: 16px 0;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  max-height: 280px;
  overflow-y: auto;
}

.modal-detail-item {
  display: grid;
  grid-template-columns: 154px 1fr;
  gap: 8px;
  font-size: 0.86rem;
  line-height: 1.4;
  align-items: start;
}

.modal-detail-item strong {
  color: var(--ink);
  font-weight: 800;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.modal-detail-item span {
  color: var(--muted);
  font-weight: 600;
}

.modal-detail-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.38;
}

/* Mobile responsive popup details list */
@media (max-width: 500px) {
  .modal-detail-item {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.modal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 10px;
  padding: 0 16px;
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}

.modal-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.modal-btn-research {
  background: var(--ink);
  color: #fff;
  border: none;
}

.modal-btn-onchain {
  background: var(--red);
  color: #fff;
  border: none;
}

.modal-btn-disabled {
  background: var(--page);
  color: var(--muted);
  border: 1px solid var(--line);
  cursor: default;
  font-weight: 600;
  font-size: 0.8rem;
}

.modal-btn-disabled:hover {
  opacity: 1;
  transform: none;
}

@media (max-width: 500px) {
  .modal-actions {
    grid-template-columns: 1fr;
  }

  .modal-price-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* ========== Live Market Alerts Bar ========== */
.live-alert-bar {
  background: #101814;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 800;
  z-index: 999;
  width: 100%;
}

.live-alert-inner {
  display: flex;
  align-items: center;
  max-width: 1440px;
  margin: 0 auto;
  gap: 16px;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #f2c86f;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  background: rgba(242, 200, 111, 0.12);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(242, 200, 111, 0.22);
  flex-shrink: 0;
}

.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f2c86f;
  animation: pulse-dot 1.2s ease-in-out infinite;
}

.alert-carousel {
  display: flex;
  overflow: hidden;
  position: relative;
  height: 18px;
  flex: 1;
}

.alert-item {
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.2s ease;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #d8e6df;
  font-family: inherit;
}

.alert-item.active {
  opacity: 1;
  transform: translateY(0);
}

/* ========== 3-Step Investor Roadmap ========== */
.roadmap-section {
  margin: 12px 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px clamp(12px, 3vw, 24px);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
  box-shadow: 0 6px 20px rgba(23, 32, 28, 0.03);
}

.roadmap-title {
  margin-bottom: 12px;
}

.roadmap-title h2 {
  margin: 2px 0 0;
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  font-weight: 900;
  letter-spacing: -0.01em;
}

.roadmap-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.roadmap-card {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(23, 32, 28, 0.06);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
}

.roadmap-card:hover {
  transform: translateY(-1px);
  border-color: rgba(31, 122, 91, 0.38);
  box-shadow: 0 4px 12px rgba(31, 122, 91, 0.04);
}

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--green);
  background: rgba(31, 122, 91, 0.09);
  font-size: 0.72rem;
  font-weight: 900;
  border: 1px solid rgba(31, 122, 91, 0.16);
}

.roadmap-card h3 {
  margin: 2px 0 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ink);
}

.roadmap-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

@media (max-width: 760px) {
  .roadmap-steps {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* ========== Scarcity Bottleneck Badges & Halo Glow ========== */
.bottleneck-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  z-index: 5;
}

.bottleneck-tag.constraint {
  color: #bc8424;
  background: rgba(188, 132, 36, 0.12);
  border: 1px solid rgba(188, 132, 36, 0.28);
}

.bottleneck-tag.shortage {
  color: var(--red);
  background: rgba(185, 72, 63, 0.12);
  border: 1px solid rgba(185, 72, 63, 0.28);
}

.bottleneck-tag.moat {
  color: var(--blue);
  background: rgba(40, 101, 173, 0.12);
  border: 1px solid rgba(40, 101, 173, 0.28);
}

.bottleneck-tag.deficit {
  color: var(--teal);
  background: rgba(10, 124, 134, 0.12);
  border: 1px solid rgba(10, 124, 134, 0.28);
}

.bottleneck-tag.prime {
  color: var(--green);
  background: rgba(31, 122, 91, 0.12);
  border: 1px solid rgba(31, 122, 91, 0.28);
}

/* Relative positioning for infographic nodes to align tags */
.chain-infographic .chain-node {
  position: relative !important;
  padding-top: 36px !important; /* give room for bottleneck tag */
}

.accent-highlight {
  box-shadow: 0 0 0 3px rgba(31, 122, 91, 0.08);
}

/* ========== DeGate Modal CTA ========== */
.modal-btn-onchain {
  background: var(--red) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.modal-btn-onchain:hover {
  box-shadow: 0 8px 24px rgba(220, 38, 38, 0.45) !important;
  transform: translateY(-2px) !important;
}

/* ========== Minimalist Dashboard Tabs Navigation ========== */
.dashboard-tabs {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 32px auto 24px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  width: max-content;
  max-width: 100%;
  box-shadow: 0 10px 30px rgba(23, 32, 28, 0.05);
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: none;
  border-radius: 999px;
  padding: 0 20px;
  color: var(--muted);
  background: transparent;
  font-size: 0.88rem;
  font-weight: 800;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.tab-btn:hover {
  color: var(--ink);
  background: rgba(23, 32, 28, 0.04);
}

.tab-btn:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.tab-btn.active {
  color: #fff;
  background: var(--ink);
  box-shadow: 0 6px 16px rgba(23, 32, 28, 0.16);
}

/* ========== Tab Content Panels & Transitions ========== */
.tab-content {
  display: none;
  animation: tabFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.tab-content.active {
  display: block;
}

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

/* Responsive Tabs for Mobile */
@media (max-width: 760px) {
  .dashboard-tabs {
    width: 100%;
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    margin: 24px 0 18px;
  }
  
  .tab-btn {
    flex: 1;
    justify-content: center;
    padding: 0 6px;
    font-size: 0.76rem;
    gap: 4px;
    min-height: 38px;
    border-radius: 8px;
  }
  
  .tab-icon {
    font-size: 0.95rem;
  }
}

/* ========== Company Logos Styling ========== */
.logo-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--size, 20px);
  height: var(--size, 20px);
  border-radius: 50%;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(23, 32, 28, 0.08);
  flex-shrink: 0;
  vertical-align: middle;
  margin-right: 6px; /* spacing between logo and ticker text */
  transition: all 0.2s ease;
}

.modal-header .logo-wrapper {
  margin-right: 0; /* no margin inside modal header flex */
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 12px rgba(23, 32, 28, 0.1);
}

.bubble .logo-wrapper {
  margin-right: 0;
  margin-bottom: 4px;
}

.company-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.company-logo-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #fff;
  background: var(--accent, var(--muted, #5d6a64));
  font-size: calc(var(--size, 20px) * 0.55);
  font-weight: 800;
  text-transform: uppercase;
}

/* ========== Modal Terminal Telemetry Loader ========== */
.modal-loader-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  min-height: 380px;
}

.terminal-loader {
  width: 100%;
  max-width: 480px;
  background: #121815;
  border: 1px solid rgba(31, 122, 91, 0.2);
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  font-family: 'Courier New', Courier, monospace;
  overflow: hidden;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #17201c;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.terminal-header .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-header .dot.red { background: #ff5f56; }
.terminal-header .dot.yellow { background: #ffbd2e; }
.terminal-header .dot.green { background: #27c93f; }

.terminal-title {
  margin-left: 8px;
  color: #5d6a64;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.terminal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.terminal-line {
  color: #a4bfae;
  font-size: 0.88rem;
  line-height: 1.4;
  white-space: pre-wrap;
}

.terminal-line .prompt {
  color: #1f7a5b;
  font-weight: bold;
}

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

.pulse-text {
  color: #1f7a5b;
  font-weight: bold;
  animation: pulse-opacity 1s infinite ease-in-out;
}

/* ========== Watchlist Section ========== */
.watchlist-section { margin-bottom: 18px; border: 1px solid var(--line); border-radius: 10px; padding: 18px; background: linear-gradient(135deg, rgba(242,200,111,0.08), rgba(31,122,91,0.06)), rgba(255,255,255,0.92); box-shadow: 0 10px 28px rgba(23,32,28,0.06); }
.watchlist-section.hidden { display: none; }
.watchlist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.watchlist-card { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: #fff; cursor: pointer; transition: all 0.25s cubic-bezier(0.4,0,0.2,1); }
.watchlist-card:hover { border-color: var(--green); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(31,122,91,0.1); }
.watchlist-card-top { display: flex; align-items: center; gap: 8px; }
.watchlist-card-top > div { flex: 1; min-width: 0; }
.watchlist-card-top strong { font-size: 1.05rem; font-weight: 900; }
.watchlist-card-top span { display: block; color: var(--muted); font-size: 0.76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.watchlist-card-price { display: flex; justify-content: space-between; align-items: center; }
.watchlist-card-price strong { font-size: 1rem; font-weight: 800; }
.watchlist-card-price .up { color: var(--green); font-weight: 900; }
.watchlist-card-price .down { color: var(--red); font-weight: 900; }
.watchlist-swap { display: block; text-align: center; padding: 6px; border-radius: 6px; background: linear-gradient(135deg, #1f7a5b, #0a7c86); color: #fff; font-size: 0.76rem; font-weight: 800; text-decoration: none; transition: opacity 0.15s; }
.watchlist-swap:hover { opacity: 0.85; }
.star-btn { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted); font-size: 0.95rem; cursor: pointer; transition: all 0.2s; flex-shrink: 0; }
.star-btn:hover { border-color: #f2c86f; color: #f2c86f; }
.star-btn.active { border-color: #f2c86f; background: rgba(242,200,111,0.15); color: #f2c86f; }

/* ========== Calculator Section ========== */
.calculator-section { margin-bottom: 20px; border: 1px solid var(--line); border-radius: 10px; padding: 20px; background: rgba(255,255,255,0.88); backdrop-filter: blur(12px); box-shadow: 0 10px 28px rgba(23,32,28,0.06); }
.calc-input-row { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.calc-label { display: flex; align-items: center; gap: 0; border: 2px solid var(--green); border-radius: 10px; overflow: hidden; background: #fff; }
.calc-label span { display: flex; align-items: center; justify-content: center; width: 42px; height: 44px; background: var(--green); color: #fff; font-size: 1.1rem; font-weight: 900; }
.calc-label input { width: 140px; height: 44px; border: none; padding: 0 14px; font-size: 1.1rem; font-weight: 800; color: var(--ink); outline: none; background: transparent; }
.calc-period { color: var(--muted); font-size: 0.92rem; font-weight: 700; }
.calc-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.calc-card { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fff; cursor: pointer; transition: all 0.2s; }
.calc-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(23,32,28,0.08); }
.calc-card-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.calc-card-head strong { font-size: 0.92rem; font-weight: 900; }
.calc-change { margin-left: auto; font-size: 0.76rem; font-weight: 800; color: var(--muted); }
.calc-card-result { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 0.86rem; }
.calc-invested { color: var(--muted); }
.calc-arrow { color: var(--muted); font-size: 0.7rem; }
.calc-now { font-size: 1.05rem; }
.calc-gain { font-size: 0.88rem; font-weight: 900; }
.calc-gain.up { color: var(--green); }
.calc-gain.down { color: var(--red); }
.calc-card.positive { border-left: 3px solid var(--green); }
.calc-card.negative { border-left: 3px solid var(--red); }

/* ========== Trending AI Picks ========== */
.trending-picks-section {
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(111, 90, 167, 0.07), rgba(40, 101, 173, 0.05)),
    rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(23, 32, 28, 0.06);
}
.trending-picks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.trending-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-left: 3px solid #6f5aa7;
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.trending-card:hover {
  border-color: #6f5aa7;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(111, 90, 167, 0.12);
}
.trending-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.trending-card-head > div {
  flex: 1;
  min-width: 0;
}
.trending-card-head strong {
  font-size: 1rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 4px;
}
.trending-card-head span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trending-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.trending-confidence {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.trending-confidence.high {
  background: rgba(31, 122, 91, 0.1);
  color: var(--green);
}
.trending-confidence.medium {
  background: rgba(188, 132, 36, 0.1);
  color: var(--gold);
}
.trending-confidence.low {
  background: rgba(185, 72, 63, 0.1);
  color: var(--red);
}
.trending-interest {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(111, 90, 167, 0.1);
  color: #6f5aa7;
}
.trending-card-desc {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.trending-card-price {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  min-width: 0;
}
.trending-card-price strong {
  font-size: 0.88rem;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}
.trending-card-price .mini-line {
  flex: 1;
  min-width: 0;
  height: 28px;
}
.trending-card-price .up,
.trending-card-price .down {
  font-weight: 900;
  font-size: 0.82rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.trending-card-price .up { color: var(--green); }
.trending-card-price .down { color: var(--red); }
.trending-source-note {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(111, 90, 167, 0.06);
  border: 1px solid rgba(111, 90, 167, 0.12);
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}
.trending-source-note a {
  color: #6f5aa7;
  font-weight: 700;
  text-decoration: none;
}
.trending-source-note a:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .trending-picks-grid { grid-template-columns: 1fr; }
}

/* ========== Dip Board ========== */
.dip-board { margin-bottom: 20px; border: 1px solid var(--line); border-radius: 10px; padding: 20px; background: linear-gradient(135deg, rgba(185,72,63,0.06), rgba(188,132,36,0.04)), rgba(255,255,255,0.92); box-shadow: 0 10px 28px rgba(23,32,28,0.06); }
.dip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.dip-card { display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: #fff; cursor: pointer; transition: all 0.2s; }
.dip-card:hover { border-color: var(--red); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(185,72,63,0.1); }
.dip-card-head { display: flex; align-items: center; gap: 10px; }
.dip-card-head > div { min-width: 0; }
.dip-card-head strong { font-size: 0.95rem; font-weight: 900; display: flex; align-items: center; gap: 4px; }
.dip-card-head span { display: block; color: var(--muted); font-size: 0.76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dip-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dip-stats > div { text-align: center; }
.dip-label { display: block; color: var(--muted); font-size: 0.68rem; font-weight: 700; text-transform: uppercase; margin-bottom: 2px; }
.dip-daily { color: var(--red) !important; font-size: 1rem; }
.dip-yearly { font-size: 0.88rem; }
.dip-swap-btn { display: block; text-align: center; padding: 8px; border-radius: 6px; background: var(--red); color: #fff; font-size: 0.78rem; font-weight: 800; text-decoration: none; transition: opacity 0.15s; }
.dip-swap-btn:hover { opacity: 0.85; }

/* ========== Heatmap ========== */
.heatmap-section { border: 1px solid var(--line); border-radius: 8px; padding: 20px; background: rgba(255,255,255,0.82); }
.heatmap-grid { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; min-height: 280px; padding: 10px 0; }
.heat-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; width: var(--w, 80px); height: var(--h, 50px); border-radius: 6px; background: var(--bg, hsl(152, 30%, 36%)); color: #fff; text-align: center; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; overflow: hidden; flex-shrink: 0; }
.heat-cell:hover { transform: scale(1.08); box-shadow: 0 8px 24px rgba(0,0,0,0.25); z-index: 2; }
.heat-cell strong { font-size: clamp(0.65rem, calc(var(--w) / 7), 1rem); font-weight: 900; line-height: 1.1; }
.heat-cell span { font-size: clamp(0.55rem, calc(var(--w) / 10), 0.78rem); opacity: 0.85; }

/* ========== Portfolio Builder ========== */
.portfolio-builder { margin-bottom: 20px; border: 1px solid var(--line); border-radius: 10px; padding: 20px; background: linear-gradient(135deg, rgba(40,101,173,0.06), rgba(31,122,91,0.06)), rgba(255,255,255,0.92); box-shadow: 0 10px 28px rgba(23,32,28,0.06); }
.portfolio-layers { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.portfolio-layer-card { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fff; transition: all 0.2s; }
.portfolio-layer-card.selected { border-color: var(--green); box-shadow: 0 4px 16px rgba(31,122,91,0.1); }
.portfolio-layer-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.portfolio-layer-icon { font-size: 1.2rem; }
.portfolio-layer-head strong { font-size: 0.88rem; font-weight: 800; }
.portfolio-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.portfolio-pick { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; background: #fbfbf8; font-size: 0.78rem; cursor: pointer; transition: all 0.2s; }
.portfolio-pick:hover { border-color: var(--green); }
.portfolio-pick.active { border-color: var(--green); background: var(--green); color: #fff; }
.portfolio-pick.active span { color: rgba(255,255,255,0.8); }
.portfolio-pick strong { font-weight: 800; }
.portfolio-pick span { color: var(--muted); font-size: 0.72rem; }
.portfolio-summary { margin-top: 14px; }
.portfolio-summary.hidden { display: none; }
.portfolio-result { border: 1px solid var(--green); border-radius: 10px; padding: 16px; background: linear-gradient(135deg, rgba(31,122,91,0.08), rgba(40,101,173,0.06)), #fff; }
.portfolio-result-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.portfolio-result-head span { color: var(--muted); font-size: 0.84rem; }
.portfolio-result-head strong { font-size: 1rem; font-weight: 900; }
.portfolio-result-head .up { color: var(--green); }
.portfolio-result-head .down { color: var(--red); }
.portfolio-stocks { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.portfolio-stock-tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fbfbf8; font-size: 0.78rem; font-weight: 700; cursor: pointer; }
.portfolio-stock-tag em { font-style: normal; color: var(--muted); font-size: 0.72rem; }
.portfolio-cta-row { display: flex; flex-wrap: wrap; gap: 8px; }
.portfolio-buy-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 0 14px; border-radius: 8px; background: linear-gradient(135deg, #1f7a5b, #0a7c86); color: #fff; font-size: 0.78rem; font-weight: 800; text-decoration: none; transition: opacity 0.15s; }
.portfolio-buy-btn:hover { opacity: 0.85; }

/* ========== Floating Swap Button ========== */
.fab-swap { position: fixed; bottom: 24px; right: 24px; z-index: 900; display: flex; align-items: center; justify-content: center; width: auto; min-width: 56px; height: 56px; padding: 0 20px; border: none; border-radius: 999px; background: linear-gradient(135deg, #1f7a5b, #0a7c86); color: #fff; font-size: 0.92rem; font-weight: 700; cursor: pointer; box-shadow: 0 8px 32px rgba(31,122,91,0.35); transition: all 0.25s; }
.fab-swap:hover { transform: scale(1.08); box-shadow: 0 12px 40px rgba(31,122,91,0.5); }
.fab-menu { position: fixed; bottom: 90px; right: 24px; z-index: 901; width: 280px; max-height: 380px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,0.96); backdrop-filter: blur(16px); box-shadow: 0 20px 60px rgba(23,32,28,0.2); animation: fadeInUp 0.2s ease; }
.fab-menu.hidden { display: none; }
.fab-menu-header { padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 0.82rem; font-weight: 900; color: var(--ink); }
.fab-menu-list { padding: 6px; }
.fab-menu-item { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); transition: background 0.15s; }
.fab-menu-item:hover { background: rgba(31,122,91,0.06); }
.fab-menu-item strong { font-size: 0.88rem; font-weight: 800; }
.fab-menu-item span { color: var(--muted); font-size: 0.78rem; }
.fab-item-change { margin-left: auto !important; color: var(--green) !important; font-weight: 800 !important; }

/* ========== Improved Modal CTA ========== */
.modal-frac-note { margin: 10px 0 0; padding: 10px 14px; border-radius: 8px; background: rgba(31,122,91,0.06); border: 1px solid rgba(31,122,91,0.15); color: var(--ink); font-size: 0.82rem; line-height: 1.4; }
.modal-frac-note strong { color: var(--green); }
.modal-watchlist-btn { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 40px; margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 0 16px; background: transparent; color: var(--muted); font-size: 0.84rem; font-weight: 700; cursor: pointer; transition: all 0.2s; }
.modal-watchlist-btn:hover { border-color: #f2c86f; color: #f2c86f; }
.modal-watchlist-btn.active { border-color: #f2c86f; background: rgba(242,200,111,0.1); color: #f2c86f; }

/* ========== Mobile Responsive – New Features ========== */
@media (max-width: 760px) {
  .calc-results { grid-template-columns: 1fr 1fr; }
  .dip-grid { grid-template-columns: 1fr; }
  .portfolio-layers { grid-template-columns: 1fr 1fr; }
  .watchlist-grid { grid-template-columns: 1fr 1fr; }
  .fab-swap { bottom: 16px; right: 16px; width: 48px; height: 48px; min-width: 48px; padding: 0; font-size: 0; overflow: hidden; }
  .fab-swap svg { width: 20px; height: 20px; flex-shrink: 0; }
  .fab-menu { right: 16px; bottom: 74px; width: calc(100vw - 32px); }
}
@media (max-width: 480px) {
  .calc-results, .portfolio-layers, .watchlist-grid { grid-template-columns: 1fr; }
}

/* ========== Site Navigation Bar ========== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 16px rgba(23, 32, 28, 0.06);
}

.site-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1360px, calc(100% - 24px));
  margin: 0 auto;
  padding: 10px 0;
  gap: 16px;
}

.site-nav-brand {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.site-nav-brand:hover {
  opacity: 0.72;
}

.site-nav-links {
  display: flex;
  gap: 4px;
}

.site-nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
}

.site-nav-link:hover {
  color: var(--ink);
  background: rgba(23, 32, 28, 0.05);
}

.site-nav-link.active {
  color: var(--green);
  background: rgba(31, 122, 91, 0.08);
}

.site-nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -11px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  border-radius: 2px;
  background: var(--green);
}

@media (max-width: 560px) {
  .site-nav-link span { display: none; }
  .site-nav-link { padding: 7px 10px; font-size: 0.78rem; }
}

/* ========== Hover-triggered Modal Variant ========== */
.stock-modal-overlay.hover-triggered {
  background: rgba(23, 32, 28, 0.32);
  backdrop-filter: blur(4px);
}

/* ========== Page Teaser Cards ========== */
.page-teasers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}

.page-teaser-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 180px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(31, 122, 91, 0.06), transparent 60%),
    rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 28px rgba(23, 32, 28, 0.06);
  text-decoration: none;
  color: var(--ink);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-teaser-card:nth-child(2) {
  background:
    linear-gradient(135deg, rgba(188, 132, 36, 0.08), transparent 60%),
    rgba(255, 255, 255, 0.92);
}

.page-teaser-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 42px rgba(23, 32, 28, 0.12);
  border-color: var(--green);
}

.page-teaser-card:nth-child(2):hover {
  border-color: var(--gold);
}

.page-teaser-card .teaser-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.page-teaser-card h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-weight: 800;
}

.page-teaser-card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.page-teaser-card .teaser-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.page-teaser-card:nth-child(2) .teaser-cta {
  color: var(--gold);
}

.page-teaser-card .teaser-cta::after {
  content: "→";
  transition: transform 0.2s;
}

.page-teaser-card:hover .teaser-cta::after {
  transform: translateX(4px);
}

@media (max-width: 640px) {
  .page-teasers { grid-template-columns: 1fr; }
}

/* ========== Hover Loading Ring — Cursor-following ========== */
#hover-cursor-ring {
  position: fixed;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(31, 122, 91, 0.15);
  border-top-color: var(--green);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  animation: hover-spin 0.7s linear infinite;
  display: none;
  transform: translate(-50%, 6px);
}

#hover-cursor-ring.visible {
  display: block;
}

@keyframes hover-spin {
  to { transform: translate(-50%, 6px) rotate(360deg); }
}

/* ---------------------------------------------------------- */
/* Momentum Columns Layout (added for Top Performing)         */
/* ---------------------------------------------------------- */
.momentum-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 260px;
  scroll-snap-align: start;
}

.momentum-col-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #c7d7d0;
  margin: 0 0 6px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 6px;
}

.momentum-col-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* ---------------------------------------------------------- */
/* Featured Page Teaser (AI System)                           */
/* ---------------------------------------------------------- */
.teaser-featured {
  position: relative;
  overflow: hidden;
  background: var(--ink) !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25) !important;
  transform: scale(1.02);
  z-index: 2;
}

.teaser-featured:hover {
  transform: scale(1.04) translateY(-4px) !important;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.35), 0 0 0 2px var(--green) !important;
}

.teaser-featured p {
  color: #aebfb6 !important;
}

.teaser-featured .teaser-icon {
  color: var(--green);
}

.teaser-featured .teaser-cta {
  background: var(--green);
  color: #fff !important;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.9rem;
  letter-spacing: 0;
  text-transform: none;
  justify-content: center;
  margin-top: 10px;
  box-shadow: 0 4px 12px rgba(31, 122, 91, 0.3);
}

.teaser-featured:hover .teaser-cta {
  background: #17654b;
}

.teaser-featured .teaser-cta::after {
  content: "→";
  margin-left: 4px;
}

.teaser-featured-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--gold);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 99px;
  box-shadow: 0 2px 8px rgba(188, 132, 36, 0.4);
}

/* ========================================================== */
/* AUTH MODAL                                                  */
/* ========================================================== */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(23, 32, 28, 0.55);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease;
}

.auth-modal-overlay.hidden { display: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.auth-modal {
  position: relative;
  width: min(420px, calc(100% - 32px));
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px 28px 28px;
  background: var(--panel);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.24);
  animation: modalSlide 0.25s ease;
}

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

.auth-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 1.4rem;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s;
}

.auth-modal-close:hover { background: rgba(0,0,0,0.06); }

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--line);
}

.auth-tab {
  flex: 1;
  padding: 10px 0;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}

.auth-tab.active {
  color: var(--green);
  border-bottom-color: var(--green);
}

.auth-tab:hover { color: var(--ink); }

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form.hidden { display: none; }

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

.auth-field label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.auth-field input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  font-size: 0.94rem;
  color: var(--ink);
  background: #fbfbf8;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-field input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 122, 91, 0.12);
}

.auth-error {
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(185, 72, 63, 0.1);
  color: var(--red);
  font-size: 0.84rem;
  font-weight: 600;
}

.auth-error.hidden { display: none; }

.auth-success {
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(31, 122, 91, 0.1);
  color: var(--green);
  font-size: 0.84rem;
  font-weight: 600;
}

.auth-success.hidden { display: none; }

.auth-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  border: none;
  border-radius: 10px;
  padding: 0 20px;
  color: #fff;
  background: var(--green);
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.auth-submit-btn:hover { background: #17654b; transform: translateY(-1px); }
.auth-submit-btn:active { transform: translateY(0); }

/* ========================================================== */
/* NAV AUTH BUTTON                                             */
/* ========================================================== */
.nav-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid var(--green);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--green);
  background: rgba(31, 122, 91, 0.08);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-login-btn:hover {
  background: var(--green);
  color: #fff;
}

.nav-user-menu { position: relative; }

.nav-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.8);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-user-btn:hover { border-color: var(--green); }

.nav-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

.nav-username {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-user-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px;
  background: var(--panel);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16);
  z-index: 50;
  animation: modalSlide 0.15s ease;
}

.nav-user-dropdown.hidden { display: none; }

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}

.nav-dropdown-item:hover { background: rgba(31, 122, 91, 0.08); }

.nav-logout-btn { color: var(--red); }
.nav-logout-btn:hover { background: rgba(185, 72, 63, 0.08); }

/* ========================================================== */
/* ACCOUNT PAGE                                                */
/* ========================================================== */

/* Guest state */
.account-guest {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
}

.account-guest.hidden { display: none; }
.account-dashboard.hidden { display: none; }

.account-guest-card {
  text-align: center;
  max-width: 420px;
  padding: 48px 32px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.account-guest-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(31, 122, 91, 0.1);
  color: var(--green);
  margin-bottom: 20px;
}

.account-guest-card h1 {
  font-size: 1.4rem;
  margin-bottom: 10px;
}

.account-guest-card p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  margin-bottom: 24px;
}

.account-guest-btns {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.auth-register-link {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 0.86rem;
  cursor: pointer;
}

.auth-register-link strong { color: var(--green); }

/* Dashboard header */
.account-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.account-header-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.account-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--teal));
  color: #fff;
  font-size: 1.6rem;
  font-weight: 800;
}

.account-name {
  font-size: 1.4rem;
  margin-bottom: 2px;
}

.account-since {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0;
}

.account-quick-stats {
  display: flex;
  gap: 10px;
}

.stat-card {
  text-align: center;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(246, 244, 238, 0.6);
}

.stat-card strong {
  display: block;
  font-size: 1.3rem;
  color: var(--green);
}

.stat-card span {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 600;
}

/* Tabs */
.account-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
  overflow-x: auto;
}

.account-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 16px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.account-tab:hover { color: var(--ink); background: rgba(0,0,0,0.04); }

.account-tab.active {
  color: #fff;
  background: var(--ink);
}

/* Section containers */
.account-section.hidden { display: none; }

.account-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.account-section-header h2 {
  font-size: 1.15rem;
  margin: 0;
}

.account-count {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.account-empty {
  text-align: center;
  padding: 48px 24px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
}

.account-empty svg { margin-bottom: 12px; }
.account-empty h3 { margin-bottom: 6px; color: var(--ink); }
.account-empty p { font-size: 0.88rem; max-width: 360px; margin: 0 auto; }
.account-empty a { color: var(--green); }

/* Favorites grid */
.favorites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.fav-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  background: var(--panel);
  transition: border-color 0.2s, transform 0.2s;
}

.fav-card:hover { border-color: var(--green); transform: translateY(-2px); }

.fav-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.fav-card-info { flex: 1; min-width: 0; }
.fav-card-info strong { display: block; font-size: 0.95rem; }
.fav-card-info span { display: block; font-size: 0.76rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.fav-remove-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}

.fav-remove-btn:hover { border-color: var(--red); color: var(--red); background: rgba(185, 72, 63, 0.08); }

.fav-card-price {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.fav-card-price strong { font-size: 1.1rem; }
.fav-card-price .up { color: var(--green); font-weight: 700; }
.fav-card-price .down { color: var(--red); font-weight: 700; }

.fav-swap-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.fav-swap-link:hover { text-decoration: underline; }

/* Portfolio */
.portfolio-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.port-summary-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.port-summary-card span {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 4px;
}

.port-summary-card strong { font-size: 1.1rem; }

.port-summary-card.summary-up strong { color: var(--green); }
.port-summary-card.summary-down strong { color: var(--red); }

.portfolio-add-form, .alert-add-form, .note-add-form {
  margin-bottom: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
}

.portfolio-add-form h3, .alert-add-form h3, .note-add-form h3 {
  font-size: 0.92rem;
  margin: 0 0 12px;
}

.port-form-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.port-form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 120px;
}

.port-form-field label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.port-form-field input,
.port-form-field select,
.port-form-field textarea {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.88rem;
  color: var(--ink);
  background: #fbfbf8;
  outline: none;
  font-family: inherit;
  resize: vertical;
}

.port-form-field input:focus,
.port-form-field select:focus,
.port-form-field textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 122, 91, 0.12);
}

.port-add-btn {
  min-height: 40px;
  border: none;
  border-radius: 8px;
  padding: 0 18px;
  color: #fff;
  background: var(--green);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.port-add-btn:hover { background: #17654b; }

/* Portfolio table */
.portfolio-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.portfolio-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.portfolio-table th {
  padding: 12px 14px;
  text-align: left;
  font-size: 0.74rem;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 244, 238, 0.6);
}

.portfolio-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.portfolio-table tr:last-child td { border-bottom: none; }

.portfolio-table .up { color: var(--green); font-weight: 700; }
.portfolio-table .down { color: var(--red); font-weight: 700; }

.port-ticker-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.port-remove-btn {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.port-remove-btn:hover { border-color: var(--red); color: var(--red); }

/* Alerts */
.alerts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.alert-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  background: var(--panel);
  transition: border-color 0.2s;
}

.alert-card.alert-triggered { border-color: var(--gold); background: rgba(188, 132, 36, 0.05); }

.alert-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.alert-card-top > div { flex: 1; min-width: 0; }
.alert-card-top strong { display: block; font-size: 0.95rem; }
.alert-card-top span { font-size: 0.76rem; color: var(--muted); }

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

.alert-label {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 2px;
}

.alert-triggered-badge {
  margin-top: 10px;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(188, 132, 36, 0.12);
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 800;
  text-align: center;
}

/* Notes */
.notes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.note-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  background: var(--panel);
}

.note-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.note-card-top > div { flex: 1; min-width: 0; }
.note-card-top strong { display: block; font-size: 0.95rem; }
.note-card-top span { font-size: 0.76rem; color: var(--muted); }

.note-date {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.note-text {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.55;
  white-space: pre-wrap;
}

/* Settings */
.settings-cards {
  display: grid;
  gap: 16px;
}

.settings-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  background: var(--panel);
}

.settings-card h3 { margin: 0 0 12px; font-size: 1rem; }
.settings-card p { color: var(--muted); font-size: 0.88rem; margin-bottom: 14px; }

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
}

.settings-danger {
  border-color: rgba(185, 72, 63, 0.3);
}

.settings-danger h3 { color: var(--red); }

.settings-delete-btn {
  min-height: 40px;
  border: 1px solid var(--red);
  border-radius: 8px;
  padding: 0 18px;
  color: var(--red);
  background: rgba(185, 72, 63, 0.06);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.settings-delete-btn:hover { background: var(--red); color: #fff; }

/* ========================================================== */
/* RESPONSIVE — ACCOUNT                                        */
/* ========================================================== */
@media (max-width: 768px) {
  .account-header { flex-direction: column; align-items: flex-start; }
  .account-quick-stats { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); }
  .portfolio-summary { grid-template-columns: 1fr; }
  .port-form-row { flex-direction: column; }
  .favorites-grid { grid-template-columns: 1fr; }
  .alerts-grid { grid-template-columns: 1fr; }
  .account-tabs { gap: 2px; }
  .account-tab { padding: 0 10px; font-size: 0.76rem; }
  .nav-username { display: none; }
}

/* ========================================================== */
/* MODAL USER ACTION BUTTONS (Favorites + Portfolio)           */
/* ========================================================== */
.modal-user-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.modal-fav-btn,
.modal-portfolio-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-fav-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(188, 132, 36, 0.06);
}

.modal-fav-btn.active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(188, 132, 36, 0.1);
}

.modal-fav-btn.active svg { color: var(--gold); }

.modal-portfolio-btn:hover {
  border-color: var(--green);
  color: var(--green);
  background: rgba(31, 122, 91, 0.06);
}

/* Inline portfolio form inside modal */
.modal-portfolio-form {
  margin-top: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(246, 244, 238, 0.6);
  animation: modalSlide 0.15s ease;
}

.modal-portfolio-form.hidden { display: none; }

.modal-port-inline {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.modal-port-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.modal-port-field label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.modal-port-field input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  font-size: 0.88rem;
  color: var(--ink);
  background: #fff;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.modal-port-field input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 122, 91, 0.1);
}

.modal-port-confirm {
  min-height: 38px;
  border: none;
  border-radius: 8px;
  padding: 0 16px;
  color: #fff;
  background: var(--green);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.modal-port-confirm:hover { background: #17654b; }

.modal-port-success {
  text-align: center;
  padding: 12px;
  color: var(--green);
  font-weight: 700;
  font-size: 0.92rem;
  animation: fadeIn 0.2s ease;
}

.modal-port-success.hidden { display: none; }
.modal-port-inline.hidden { display: none; }

@media (max-width: 480px) {
  .modal-user-actions { flex-direction: column; }
  .modal-port-inline { flex-direction: column; }
}

/* ========================================================== */
/* COOKIE CONSENT BANNER                                       */
/* ========================================================== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9998;
  padding: 16px 24px;
  background: rgba(23, 32, 28, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  animation: slideUpBanner 0.3s ease;
}

.cookie-banner.hiding {
  animation: slideDownBanner 0.3s ease forwards;
}

@keyframes slideUpBanner {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes slideDownBanner {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(100%); opacity: 0; }
}

.cookie-banner-text {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.84rem;
  line-height: 1.5;
  max-width: 600px;
}

.cookie-banner-text a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-banner-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.cookie-accept-btn {
  min-height: 36px;
  border: none;
  border-radius: 8px;
  padding: 0 20px;
  color: #fff;
  background: var(--green);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.cookie-accept-btn:hover { background: #17654b; }

.cookie-settings-btn {
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 0 16px;
  color: rgba(255, 255, 255, 0.7);
  background: none;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.cookie-settings-btn:hover {
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

/* ========================================================== */
/* LEGAL PAGES                                                 */
/* ========================================================== */
.legal-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.legal-content h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.legal-content .legal-updated {
  color: var(--muted);
  font-size: 0.86rem;
  margin-bottom: 36px;
}

.legal-content h2 {
  font-size: 1.2rem;
  margin-top: 36px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.legal-content h3 {
  font-size: 1rem;
  margin-top: 20px;
  margin-bottom: 8px;
}

.legal-content p,
.legal-content li {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
  margin-bottom: 12px;
}

.legal-content ul {
  padding-left: 20px;
  margin-bottom: 16px;
}

.legal-content li { margin-bottom: 6px; }

.legal-content a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-disclaimer-box {
  padding: 20px 24px;
  border: 2px solid var(--gold);
  border-radius: 12px;
  background: rgba(188, 132, 36, 0.06);
  margin: 24px 0;
}

.legal-disclaimer-box h3 {
  color: var(--gold);
  margin-top: 0;
}

.legal-disclaimer-box p {
  color: var(--ink);
  font-weight: 500;
}

/* ========================================================== */
/* TOAST NOTIFICATIONS                                         */
/* ========================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  pointer-events: auto;
  animation: toastIn 0.3s ease;
  max-width: 360px;
}

.toast.toast-success { background: var(--green); }
.toast.toast-warning { background: var(--gold); color: var(--ink); }
.toast.toast-error { background: var(--red); }

.toast.hiding { animation: toastOut 0.3s ease forwards; }

@keyframes toastIn {
  from { transform: translateX(100%) scale(0.8); opacity: 0; }
  to { transform: translateX(0) scale(1); opacity: 1; }
}

@keyframes toastOut {
  from { transform: translateX(0) scale(1); opacity: 1; }
  to { transform: translateX(100%) scale(0.8); opacity: 0; }
}

/* Footer legal links */
.footer-legal {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.footer-legal a {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-legal a:hover { color: var(--green); }

@media (max-width: 600px) {
  .cookie-banner { flex-direction: column; text-align: center; padding: 14px 16px; }
  .toast-container { left: 16px; right: 16px; bottom: 16px; }
  .toast { max-width: 100%; }
}

/* ========================================================== */
/* MOBILE UX OVERHAUL                                          */
/* All styles below are mobile-only — desktop is untouched.    */
/* ========================================================== */

/* ---------- Global: touch, reduced-motion, spacing ---------- */
@media (pointer: coarse) {
  *,
  *::before,
  *::after {
    -webkit-tap-highlight-color: transparent;
  }

  /* Ensure minimum 44px touch targets on interactive items */
  .category-card,
  .momentum-stock,
  .mentioned-card,
  .trending-card,
  .watchlist-card,
  .dip-card,
  .calc-card,
  .heat-cell,
  .portfolio-pick,
  .chain-node,
  .supply-stock-pill {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========================================================== */
/* TABLET — max-width: 760px                                   */
/* ========================================================== */
@media (max-width: 760px) {

  /* ---------- Global spacing ---------- */
  .app-shell {
    padding: 8px 0 20px;
  }

  /* ---------- Navigation — 2-row stacked layout ---------- */
  .site-nav-inner {
    flex-direction: column;
    padding: 8px 0 4px;
    gap: 6px;
  }

  .site-nav-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    font-size: 0.82rem;
    line-height: 1.2;
  }

  .site-nav-brand svg {
    width: 18px;
    height: 18px;
  }

  .site-nav-links {
    width: 100%;
    justify-content: center;
    gap: 3px;
  }

  .site-nav-link {
    flex: 1;
    justify-content: center;
    padding: 5px 6px;
    font-size: 0.74rem;
    border-radius: 6px;
    text-align: center;
  }

  .site-nav-link.active::after {
    bottom: -5px;
    width: 18px;
  }

  .nav-login-btn {
    min-height: 30px;
    padding: 0 10px;
    font-size: 0.72rem;
  }

  /* ---------- Hero — compact ---------- */
  .hero-copy {
    min-height: auto;
    padding: 20px;
  }

  .hero-copy h1 {
    font-size: clamp(1.5rem, 5vw, 2.2rem);
  }

  .lede {
    font-size: 0.86rem;
    line-height: 1.4;
  }

  /* ---------- API Bar — compact ---------- */
  .api-bar {
    padding: 8px 12px;
    margin-bottom: 10px;
  }

  .api-bar-inner {
    gap: 8px;
  }

  #api-status-text {
    font-size: 0.78rem;
  }

  /* ---------- Alert Carousel ---------- */
  .live-alert-bar {
    padding: 6px 0;
  }

  .alert-track {
    gap: 18px;
  }

  .alert-item {
    font-size: 0.74rem;
    gap: 5px;
  }

  .alert-badge {
    font-size: 0.58rem;
    padding: 2px 5px;
  }

  /* ---------- Section Heads ---------- */
  .section-head h2 {
    font-size: 1.1rem;
  }

  .eyebrow {
    font-size: 0.68rem;
  }

  /* ---------- Page Teasers ---------- */
  .page-teasers {
    gap: 10px;
    margin-bottom: 16px;
  }

  .page-teaser-card {
    min-height: 140px;
    padding: 16px;
  }

  .page-teaser-card h3 {
    font-size: 1rem;
  }

  .page-teaser-card p {
    font-size: 0.8rem;
    margin-bottom: 8px;
  }

  .teaser-featured {
    transform: scale(1);
  }

  .teaser-featured:hover {
    transform: translateY(-2px) !important;
  }

  /* ---------- Roadmap (How It Works) ---------- */
  .roadmap-section {
    margin-bottom: 14px;
    padding: 14px;
  }

  .roadmap-card {
    padding: 14px;
  }

  /* ---------- Trending Picks (Community Monitor) ---------- */
  .trending-picks-section {
    padding: 14px;
    margin-bottom: 14px;
  }

  .trending-card {
    padding: 12px;
  }

  .trending-card-head strong {
    font-size: 0.92rem;
  }

  .trending-card-desc {
    font-size: 0.76rem;
  }

  .trending-source-note {
    font-size: 0.7rem;
    padding: 8px 10px;
  }

  /* ---------- Momentum Board ---------- */
  .momentum-board {
    margin-bottom: 14px;
  }

  .momentum-spotlight {
    min-height: 320px;
    padding: 20px 16px;
  }

  .spotlight-title {
    font-size: 1.1rem;
  }

  .spotlight-price {
    font-size: 1.6rem;
  }

  /* ---------- Dip Board ---------- */
  .dip-board {
    padding: 14px;
    margin-bottom: 14px;
  }

  .dip-card {
    padding: 12px;
  }

  .dip-stats > div {
    padding: 0;
  }

  .dip-label {
    font-size: 0.62rem;
  }

  .dip-daily {
    font-size: 0.88rem;
  }

  .dip-yearly {
    font-size: 0.8rem;
  }

  /* ---------- Watchlist ---------- */
  .watchlist-section {
    padding: 14px;
    margin-bottom: 14px;
  }

  .watchlist-card {
    padding: 10px;
  }

  .watchlist-card-top strong {
    font-size: 0.92rem;
  }

  /* ---------- Calculator ---------- */
  .calculator-section {
    padding: 14px;
    margin-bottom: 14px;
  }

  .calc-input-row {
    margin-bottom: 12px;
    gap: 8px;
  }

  .calc-label input {
    width: 110px;
    font-size: 0.95rem;
  }

  .calc-card {
    padding: 10px;
  }

  /* ---------- Heatmap ---------- */
  .heatmap-section {
    padding: 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .heatmap-grid {
    min-width: 500px;
    padding: 6px 0;
  }

  /* ---------- Dashboard Mentioned (Social) ---------- */
  .mentioned-board {
    padding: 14px;
  }

  .mentioned-card {
    padding: 12px;
  }

  .mentioned-symbol strong {
    font-size: 0.92rem;
  }

  .mentioned-stats {
    padding: 6px 0;
    gap: 4px;
  }

  .mentioned-stat-label {
    font-size: 0.6rem;
  }

  .mentioned-stat strong {
    font-size: 0.82rem;
  }

  .mentioned-chart .mini-line {
    height: 32px;
  }

  .mentioned-source-note {
    font-size: 0.7rem;
    padding: 8px 10px;
  }

  /* ---------- Portfolio Builder ---------- */
  .portfolio-builder {
    padding: 14px;
    margin-bottom: 14px;
  }

  .portfolio-pick {
    padding: 3px 6px;
    font-size: 0.72rem;
  }

  /* ---------- Value Chain Buttons — horizontal scroll ---------- */
  .value-chain {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    gap: 6px;
    padding-bottom: 6px;
    scrollbar-width: none;
  }

  .value-chain::-webkit-scrollbar {
    display: none;
  }

  .chain-filter-btn {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 0.76rem;
  }

  /* ---------- Supply Chain Infographic ---------- */
  .chain-infographic .chain-node {
    min-height: 100px !important;
    padding-top: 28px !important;
  }

  .chain-node-title {
    font-size: 0.82rem;
  }

  .chain-node-body {
    font-size: 0.72rem;
  }

  .supply-stock-pill {
    font-size: 0.7rem;
    padding: 3px 6px;
  }

  .chain-section {
    margin-bottom: 14px;
  }

  /* ---------- Stock Modal — better mobile ---------- */
  .stock-modal {
    width: min(540px, calc(100vw - 16px));
    max-height: 92vh;
    padding: 20px 16px 16px;
    border-radius: 14px;
  }

  .modal-close {
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--line);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  .modal-company {
    font-size: 0.82rem;
  }

  .modal-trend-chart {
    height: 100px;
  }

  .modal-frac-note {
    font-size: 0.76rem;
    padding: 8px 10px;
  }


  /* ---------- Footer — compact ---------- */
  .site-footer {
    margin-top: 24px;
    padding: 18px 0 6px;
  }

  .footer-disclaimer {
    font-size: 0.76rem;
  }

  .footer-meta {
    font-size: 0.76rem;
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }

  .footer-meta > span:nth-child(2) {
    display: none;
  }

  .footer-legal {
    gap: 10px;
  }

  .footer-legal a {
    font-size: 0.72rem;
  }
}

/* ========================================================== */
/* PHONE — max-width: 480px                                    */
/* ========================================================== */
@media (max-width: 480px) {

  /* ---------- Navigation — ultra compact ---------- */
  .site-nav-inner {
    padding: 5px 0 3px;
    gap: 4px;
  }

  .site-nav-brand {
    font-size: 0.76rem;
  }

  .site-nav-brand svg {
    width: 16px;
    height: 16px;
  }

  .site-nav-link {
    padding: 4px 4px;
    font-size: 0.68rem;
  }

  /* ---------- Hero — minimal ---------- */
  .hero-copy {
    padding: 16px;
  }

  .hero-copy h1 {
    font-size: 1.4rem;
  }

  .lede {
    font-size: 0.82rem;
    -webkit-line-clamp: 3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .market-pulse > div {
    min-height: 44px !important;
    padding: 4px 6px !important;
  }

  .pulse-label {
    font-size: 0.58rem !important;
  }

  .market-pulse strong {
    font-size: 0.78rem !important;
  }

  /* ---------- Sections — tight spacing ---------- */
  .section-head h2 {
    font-size: 1rem;
  }

  .result-count {
    font-size: 0.72rem;
  }

  /* ---------- Page Teasers ---------- */
  .page-teaser-card {
    min-height: auto;
    padding: 14px;
  }

  .page-teaser-card .teaser-icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
  }

  .page-teaser-card h3 {
    font-size: 0.92rem;
    margin-bottom: 4px;
  }

  .page-teaser-card p {
    font-size: 0.76rem;
    margin-bottom: 6px;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .teaser-featured .teaser-cta {
    padding: 8px 14px;
    font-size: 0.82rem;
  }

  /* ---------- Trending picks — very compact ---------- */
  .trending-picks-section {
    padding: 12px;
  }

  .trending-card {
    padding: 10px;
    gap: 8px;
  }

  .trending-card-meta {
    gap: 5px;
  }

  .trending-confidence,
  .trending-interest {
    font-size: 0.62rem;
    padding: 2px 6px;
  }

  .trending-card-price strong {
    font-size: 0.8rem;
  }

  .trending-card-price .mini-line {
    height: 22px;
  }

  .trending-card-price .up,
  .trending-card-price .down {
    font-size: 0.76rem;
  }

  /* ---------- Momentum — compact ---------- */
  .momentum-spotlight {
    min-height: 260px;
    padding: 16px 14px;
  }

  .spotlight-price {
    font-size: 1.3rem;
  }

  .spotlight-title {
    font-size: 0.95rem;
  }

  .momentum-stock {
    min-width: 156px;
    max-width: 190px;
    min-height: 130px;
    padding: 12px 10px;
  }

  /* ---------- Dip Board ---------- */
  .dip-board {
    padding: 12px;
  }

  .dip-card {
    padding: 10px;
  }

  .dip-swap-btn {
    font-size: 0.72rem;
    padding: 6px;
  }

  /* ---------- Calculator ---------- */
  .calculator-section {
    padding: 12px;
  }

  .calc-label span {
    width: 36px;
    height: 38px;
    font-size: 0.95rem;
  }

  .calc-label input {
    width: 90px;
    height: 38px;
    font-size: 0.88rem;
  }

  .calc-card-head strong {
    font-size: 0.84rem;
  }

  .calc-card-result {
    font-size: 0.8rem;
  }

  /* ---------- Watchlist ---------- */
  .watchlist-section {
    padding: 12px;
  }

  .watchlist-card {
    padding: 8px;
    gap: 6px;
  }

  .watchlist-swap {
    font-size: 0.7rem;
    padding: 5px;
  }

  /* ---------- Dashboard Mentioned ---------- */
  .mentioned-board {
    padding: 12px;
  }

  .mentioned-card {
    padding: 10px;
    gap: 8px;
  }

  .mentioned-rank {
    font-size: 0.65rem;
    padding: 2px 6px;
  }

  .mentioned-change {
    font-size: 0.8rem;
  }

  /* ---------- Heatmap — allow scroll ---------- */
  .heatmap-section {
    padding: 12px;
  }

  .heatmap-grid {
    min-width: 420px;
  }

  /* ---------- Modal — full screen feel ---------- */
  .stock-modal {
    width: calc(100vw - 12px);
    max-height: 94vh;
    padding: 16px 12px 14px;
    border-radius: 12px;
  }

  .modal-close {
    position: sticky;
    top: 0;
    right: 0;
    margin-left: auto;
    margin-bottom: -36px;
    z-index: 20;
    width: 36px;
    height: 36px;
    font-size: 1.3rem;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--line);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  .modal-ticker {
    font-size: 1.15rem;
  }

  .modal-price-row {
    gap: 6px;
  }

  .modal-price-row > div {
    padding: 8px;
  }

  .modal-trend-chart {
    height: 80px;
  }

  .modal-detail-grid {
    gap: 6px;
  }

  .modal-btn {
    min-height: 40px;
    font-size: 0.8rem;
    padding: 0 12px;
  }

  /* ---------- Portfolio Builder ---------- */
  .portfolio-builder {
    padding: 12px;
  }

  .portfolio-layer-card {
    padding: 10px;
  }

  .portfolio-layer-head strong {
    font-size: 0.82rem;
  }

  .portfolio-buy-btn {
    font-size: 0.72rem;
    padding: 0 10px;
    min-height: 30px;
  }

  /* ---------- Supply Chain — compact nodes ---------- */
  .chain-infographic .chain-node {
    min-height: 80px !important;
    padding: 22px 12px 12px !important;
  }

  .chain-node-title {
    font-size: 0.76rem;
  }

  .chain-node-body {
    font-size: 0.68rem;
  }

  .chain-stage-header h3 {
    font-size: 0.88rem;
  }

  .bottleneck-tag {
    font-size: 0.56rem;
    padding: 1px 4px;
    top: 6px;
    right: 6px;
  }

  /* ---------- Dashboard Tabs ---------- */
  .dashboard-tabs {
    margin: 16px 0 12px;
    padding: 3px;
  }

  .tab-btn {
    min-height: 34px;
    font-size: 0.7rem;
    gap: 3px;
    padding: 0 4px;
  }

  .tab-icon svg {
    width: 13px;
    height: 13px;
  }

  /* ---------- Footer — minimal ---------- */
  .site-footer {
    margin-top: 18px;
    padding: 14px 0 4px;
  }

  .footer-disclaimer {
    font-size: 0.7rem;
    line-height: 1.4;
  }

  .footer-meta {
    font-size: 0.7rem;
  }
}

/* ========================================================== */
/* VERY SMALL PHONES — max-width: 360px                        */
/* ========================================================== */
@media (max-width: 360px) {
  .app-shell {
    width: calc(100% - 12px);
  }

  .hero-copy h1 {
    font-size: 1.25rem;
  }

  .market-pulse {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  .page-teaser-card .teaser-icon {
    display: none;
  }

  .trending-card-desc {
    display: none;
  }

  .momentum-stock {
    min-width: 140px;
  }

  .tab-btn span:not(.tab-icon) {
    font-size: 0.64rem;
  }
}
