/* Geist font - self-hosted with fallback for balance between speed and consistency */
@font-face {
  font-family: 'Geist';
  src: url('/fonts/Geist-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: fallback;
}

@font-face {
  font-family: 'Geist';
  src: url('/fonts/Geist-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: fallback;
}

@font-face {
  font-family: 'Geist';
  src: url('/fonts/Geist-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: fallback;
}

@font-face {
  font-family: 'Geist';
  src: url('/fonts/Geist-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: fallback;
}

@font-face {
  font-family: 'Geist';
  src: url('/fonts/Geist-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: fallback;
}

/* ==========================================================================
   DESIGN SYSTEM
   ==========================================================================
   
   Typography:
   - Font: Geist (sans-serif)
   - Base size: 15px
   - Weight: 500 (medium)
   - Sublabels: 11px, muted
   - Line-height: 1.4
   - Tabular nums for data
   
   Colors:
   - Background layers: bg → bg-card (slight elevation)
   - Text hierarchy: primary → secondary → muted
   - Semantic: positive (green), negative (red)
   
   Borders & Shadows:
   - Subtle borders: 5% white
   - Focus rings: layered (inner 15%, gap, outer 6%)
   - Separators: 8% white
   
   Spacing:
   - Card padding: 20px
   - Card gap: 10px
   - Section gap: 16-24px
   
   Radius:
   - Cards: 20px
   - Inputs/Buttons: 12px
   
   Animation:
   - Springs: duration 0.2-0.3s, bounce 0.05-0.1
   - Stagger: 0.04s between elements
   
   ========================================================================== */

:root {
  /* Background layers */
  --bg: #000000;
  --bg-card: #141414;
  --bg-card-hover: #111111;
  --bg-card-default: #0e0e0e;
  
  /* Text hierarchy */
  --text-primary: #ffffff;
  --text: #fafafa;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;
  --text-placeholder: #666666;
  
  /* Semantic colors */
  --positive: #4ade80;
  --negative: #f87171;
  --warning: #fbbf24;
  
  /* Legacy aliases */
  --green: var(--positive);
  --red: var(--negative);
  
  /* Borders & separators */
  --border: #1e1e1e;
  --border-subtle: rgba(255, 255, 255, 0.03);
  --border-separator: rgba(255, 255, 255, 0.08);
  --border-focus-inner: rgba(255, 255, 255, 0.15);
  --border-focus-outer: rgba(255, 255, 255, 0.06);
  
  /* Radius */
  --radius: 20px;

  /* Dock dimensions */
  --dock-height: 56px;
  --radius-sm: 12px;
}

.fund-card,
.news-card,
.portfolio-change,
.dock,
.dock-backdrop,
.dock-fill,
.dock-item,
.dock-item-bg,
.login-input,
.login-button,
.passkey-button,
.command-dialog,
.load-more-button {
  /* Shadows */
  --shadow-card: inset 0 0 0 1px var(--border-subtle);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  overflow-x: hidden;
}

/* Pull-to-refresh */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

body {
  user-select: none;
  -webkit-user-select: none;
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  background: var(--bg, #000);
  color: var(--text);
  min-height: 100dvh; /* dvh for iOS dynamic viewport */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


#root {
  isolation: isolate;
}

/* Progressive blur behind dock - based on kennethnym.com/blog/progressive-blur-in-css */
.progressive-blur {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  pointer-events: none;
  z-index: 89; /* Below the gradient overlay */
}

.progressive-blur > .blur-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

/* Layer 1: weakest blur at top */
.progressive-blur > .blur-layer:nth-child(1) {
  backdrop-filter: blur(0.5px);
  -webkit-backdrop-filter: blur(0.5px);
  mask: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,1) 10%, rgba(0,0,0,1) 30%, rgba(0,0,0,0) 40%);
  -webkit-mask: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,1) 10%, rgba(0,0,0,1) 30%, rgba(0,0,0,0) 40%);
}

.progressive-blur > .blur-layer:nth-child(2) {
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  mask: linear-gradient(to bottom, rgba(0,0,0,0) 10%, rgba(0,0,0,1) 20%, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 50%);
  -webkit-mask: linear-gradient(to bottom, rgba(0,0,0,0) 10%, rgba(0,0,0,1) 20%, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 50%);
}

.progressive-blur > .blur-layer:nth-child(3) {
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  mask: linear-gradient(to bottom, rgba(0,0,0,0) 15%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 60%);
  -webkit-mask: linear-gradient(to bottom, rgba(0,0,0,0) 15%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 60%);
}

.progressive-blur > .blur-layer:nth-child(4) {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  mask: linear-gradient(to bottom, rgba(0,0,0,0) 20%, rgba(0,0,0,1) 40%, rgba(0,0,0,1) 60%, rgba(0,0,0,0) 70%);
  -webkit-mask: linear-gradient(to bottom, rgba(0,0,0,0) 20%, rgba(0,0,0,1) 40%, rgba(0,0,0,1) 60%, rgba(0,0,0,0) 70%);
}

.progressive-blur > .blur-layer:nth-child(5) {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  mask: linear-gradient(to bottom, rgba(0,0,0,0) 40%, rgba(0,0,0,1) 60%, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 90%);
  -webkit-mask: linear-gradient(to bottom, rgba(0,0,0,0) 40%, rgba(0,0,0,1) 60%, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 90%);
}

.progressive-blur > .blur-layer:nth-child(6) {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  mask: linear-gradient(to bottom, rgba(0,0,0,0) 60%, rgba(0,0,0,1) 80%);
  -webkit-mask: linear-gradient(to bottom, rgba(0,0,0,0) 60%, rgba(0,0,0,1) 80%);
}

.progressive-blur > .blur-layer:nth-child(7) {
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  mask: linear-gradient(to bottom, rgba(0,0,0,0) 70%, rgba(0,0,0,1) 100%);
  -webkit-mask: linear-gradient(to bottom, rgba(0,0,0,0) 70%, rgba(0,0,0,1) 100%);
}

/* Gradient overlay on top of blur - hides glitches and adds fade to black */
#root::after {
  content: '';
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
  z-index: 90;
}

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 16px 64px;
  outline: none; /* No focus ring when app container is focused for keyboard nav */
}

@media (max-width: 480px) {
  .app {
    padding: 0 8px 64px;
  }
}

/* Native iOS app mode (loaded with ?native=1) */
/* Native iOS app mode - CSS handles safe areas */
.app.native-mode {
  padding-top: env(safe-area-inset-top);
}

/* Progressive blur behind status bar for native iOS app (iPhone only) */
.progressive-blur-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: env(safe-area-inset-top, 20px);
  pointer-events: none;
  z-index: 9999;
}

/* Hide blur/gradient on iPad (larger screens) */
@media (min-width: 768px) {
  .progressive-blur-top {
    display: none;
  }
}

.progressive-blur-top > .blur-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.progressive-blur-top > .blur-layer:nth-child(1) {
  backdrop-filter: blur(0.5px);
  -webkit-backdrop-filter: blur(0.5px);
  mask: linear-gradient(to top, rgba(0,0,0,0), rgba(0,0,0,1) 20%, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 70%);
  -webkit-mask: linear-gradient(to top, rgba(0,0,0,0), rgba(0,0,0,1) 20%, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 70%);
}

.progressive-blur-top > .blur-layer:nth-child(2) {
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  mask: linear-gradient(to top, rgba(0,0,0,0) 10%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 60%, rgba(0,0,0,0) 80%);
  -webkit-mask: linear-gradient(to top, rgba(0,0,0,0) 10%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 60%, rgba(0,0,0,0) 80%);
}

.progressive-blur-top > .blur-layer:nth-child(3) {
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  mask: linear-gradient(to top, rgba(0,0,0,0) 20%, rgba(0,0,0,1) 40%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 90%);
  -webkit-mask: linear-gradient(to top, rgba(0,0,0,0) 20%, rgba(0,0,0,1) 40%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 90%);
}

.progressive-blur-top > .blur-layer:nth-child(4) {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  mask: linear-gradient(to top, rgba(0,0,0,0) 30%, rgba(0,0,0,1) 50%, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 100%);
  -webkit-mask: linear-gradient(to top, rgba(0,0,0,0) 30%, rgba(0,0,0,1) 50%, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 100%);
}

.progressive-blur-top > .blur-layer:nth-child(5) {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  mask: linear-gradient(to top, rgba(0,0,0,0) 50%, rgba(0,0,0,1) 70%, rgba(0,0,0,1) 100%);
  -webkit-mask: linear-gradient(to top, rgba(0,0,0,0) 50%, rgba(0,0,0,1) 70%, rgba(0,0,0,1) 100%);
}

.progressive-blur-top > .blur-layer:nth-child(6) {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  mask: linear-gradient(to top, rgba(0,0,0,0) 60%, rgba(0,0,0,1) 85%, rgba(0,0,0,1) 100%);
  -webkit-mask: linear-gradient(to top, rgba(0,0,0,0) 60%, rgba(0,0,0,1) 85%, rgba(0,0,0,1) 100%);
}

.progressive-blur-top > .blur-layer:nth-child(7) {
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  mask: linear-gradient(to top, rgba(0,0,0,0) 70%, rgba(0,0,0,1) 100%);
  -webkit-mask: linear-gradient(to top, rgba(0,0,0,0) 70%, rgba(0,0,0,1) 100%);
}

/* Black gradient on top of blur - dims content behind status bar */
.progressive-blur-top::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
  z-index: 10;
}

/* Portfolio Summary */
.portfolio-summary {
  margin: 64px 0 32px;
  text-align: center;
  /* Break out of padded container to center on viewport */
  width: 100vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  /* Fixed height to prevent layout shift */
  min-height: 80px;
}

/* More bottom margin when header is followed by card lists (not chart) */
.portfolio-summary:has(+ .signals-list),
.portfolio-summary:has(+ .funds-list) {
  margin-bottom: 40px;
}

.portfolio-total {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 13px;
  white-space: nowrap;
  text-align: center;
  /* Fixed line-height to prevent font-related shift */
  line-height: 1.1;
}


.market-summary {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-secondary);
  text-align: center;
  text-wrap: balance;
  margin: 0;
}

@media (max-width: 480px) {
  .market-summary {
    padding: 0 10px;
  }
}

/* Market Mood Image */


/* Inline ticker badges in market summary */
.inline-ticker-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  background: rgba(255, 255, 255, 0.08);
  padding: 0 5px 0 4px;
  border-radius: 8px;
  margin: 0 1px;
  vertical-align: baseline;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.inline-ticker-logo {
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
  border-radius: 4px;
  object-fit: contain;
  align-self: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.inline-ticker-name {
  color: var(--text);
  font-weight: 500;
  line-height: 1.4;
}

/* =============================================================================
   DIGEST VIEW
   ============================================================================= */

.digest-view {
  /* No max-width - inherits from .app container */
  padding: 0;
  /* Vertically center content within viewport (dock ~64px + padding) */
  min-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.digest-header {
  text-align: left;
  margin: 0;
}

.digest-date {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.digest-title {
  /* Same as body copy but white */
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text);
  margin: 0 0 8px 0;
  text-wrap: balance;
}

.digest-summary {
  /* Match market-summary */
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-secondary);
  text-wrap: balance;
  margin: 0;
}

/* Digest Pills - inline badges with performance coloring */
.digest-pill {
  /* Match inline-ticker-badge */
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  background: rgba(255, 255, 255, 0.08);
  padding: 0 5px 0 4px;
  border-radius: 8px;
  margin: 0 1px;
  vertical-align: baseline;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.digest-pill.positive {
  background: rgba(74, 222, 128, 0.12);
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.15);
}

.digest-pill.positive .digest-pill-label {
  color: var(--positive);
}

.digest-pill.negative {
  background: rgba(248, 113, 113, 0.12);
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.15);
}

.digest-pill.negative .digest-pill-label {
  color: var(--negative);
}

/* Digest pill icon with blur glow effect */
.digest-pill-icon-wrapper {
  position: relative;
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
  align-self: center;
}

.digest-pill-icon {
  position: absolute;
  inset: 0;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  object-fit: contain;
  z-index: 2;
}

/* Inner border highlight */
.digest-pill-icon-wrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  pointer-events: none;
  z-index: 3;
}

.digest-pill-icon-blur {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(2) translateZ(0);
  width: 14px;
  height: 14px;
  border-radius: 4px;
  object-fit: contain;
  filter: blur(8px) saturate(2);
  opacity: 0.5;
  z-index: 1;
  -webkit-transform: translate(-50%, -50%) scale(2) translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.digest-pill-label {
  /* Match inline-ticker-name */
  color: var(--text);
  font-weight: 500;
  line-height: 1.4;
  font-size: 15px;
}

/* Digest Signals - exact same styling as inline .digest-pill */
.digest-signals-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.digest-signal-pill {
  /* Exact match to .digest-pill */
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.08);
  padding: 0 5px 0 4px;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.digest-signal-pill-logo {
  /* Exact match to .digest-pill-logo */
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
  border-radius: 4px;
  object-fit: contain;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.digest-signal-pill-ticker {
  /* Exact match to .digest-pill-label */
  font-weight: 500;
  font-size: 15px;
  line-height: 1.4;
  color: var(--text);
}

.digest-signal-pill-type {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
}

.digest-signal-pill-type.buy,
.digest-signal-pill-type.bullish {
  color: var(--positive);
}

.digest-signal-pill-type.sell,
.digest-signal-pill-type.bearish {
  color: var(--negative);
}

@media (max-width: 480px) {
  .digest-view {
    padding: 0;
  }
  
  .digest-header {
    margin: 0;
  }
  
  .digest-signals-row {
    gap: 6px;
  }
}

/* Digest Live Dot - pulsing indicator when markets are open */
.digest-live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--positive);
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.9); }
}

/* Digest Insights - minimal list of dynamic info */
.digest-insights {
  list-style: none;
  padding: 0;
  margin: 20px 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.digest-insight {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.digest-insight:last-child {
  border-bottom: none;
}

.digest-insight-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #444;
}

.digest-insight-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.5;
}

/* Insight logo with blur effect */
.digest-insight-logo-wrapper {
  position: relative;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.digest-insight-logo {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  object-fit: cover;
  position: relative;
  z-index: 2;
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: none;
}

/* Inner border highlight */
.digest-insight-logo-wrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  pointer-events: none;
  z-index: 3;
}

/* No blur for logos - only flags/emojis get blur */
.digest-insight-logo-blur {
  display: none;
}

.digest-insight-icon-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
}

.digest-insight-text {
  position: relative;
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #666;
}

/* When accent color is extracted, apply gradient overlay */
.digest-insight-text[style*="--accent"] {
  position: relative;
}

.digest-insight-text.has-accent::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  /* Single color gradient with oklch for smooth fade */
  background: linear-gradient(in oklch to right, var(--accent) 0%, transparent 15%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  mix-blend-mode: plus-lighter;
  opacity: 0.6;
}

/* Two-color gradient - secondary at bottom (default) */
.digest-insight-text.has-secondary::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  /* Gradient with oklch: primary at top, secondary at bottom */
  background: linear-gradient(in oklch to bottom, var(--accent) 0%, var(--accent) 25%, var(--accent2) 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  mix-blend-mode: plus-lighter;
  opacity: 0.6;
  -webkit-mask-image: linear-gradient(to right, black 0%, transparent 20%);
  mask-image: linear-gradient(to right, black 0%, transparent 20%);
}

/* Two-color gradient - secondary at top (inverted) */
.digest-insight-text.has-secondary.secondary-top::before {
  /* Gradient with oklch: secondary at top, primary at bottom */
  background: linear-gradient(in oklch to bottom, var(--accent2) 0%, var(--accent) 60%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-mask-image: linear-gradient(to right, black 0%, transparent 20%);
  mask-image: linear-gradient(to right, black 0%, transparent 20%);
}

@media (max-width: 480px) {
  .digest-insights {
    margin: 16px 0 0 0;
  }
  
  .digest-insight {
    padding: 7px 0;
  }
}

/* =============================================================================
   END DIGEST VIEW
   ============================================================================= */

.portfolio-changes {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.portfolio-change {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 13px;
}

.portfolio-change.clickable {
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.portfolio-change.clickable:hover {
  opacity: 0.8;
}

.portfolio-change.positive {
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.08);
}

.portfolio-change.positive .change-label {
  color: rgba(74, 222, 128, 0.5);
}

.portfolio-change.negative {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.08);
}

.portfolio-change.negative .change-label {
  color: rgba(248, 113, 113, 0.5);
}

.portfolio-change.neutral {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.portfolio-change.neutral .change-label {
  color: var(--text-muted);
}

/* News Ticker Marquee (header) */
.news-ticker-marquee {
  overflow: hidden;
  width: 100%;
  max-width: 568px;
  margin: 0 auto;
  mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}

@media (max-width: 480px) {
  .news-ticker-marquee {
    max-width: none;
  }
}

.news-ticker-track {
  display: inline-flex;
  animation: news-ticker-scroll 40s linear infinite;
}

.news-ticker-set {
  display: inline-flex;
  gap: 8px;
  padding-right: 8px;
}

@keyframes news-ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.change-label {
  color: var(--text-muted);
}

/* Performance Chart - full width, minimal */
.chart-container {
  /* Break out of narrow container to full viewport width */
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  width: 100vw;
  margin-bottom: 0;
  padding: 0 60px 40px;
  box-sizing: border-box;
  overflow: visible;
}

@media (max-width: 480px) {
  .chart-container {
    padding: 0 8px 40px;
  }
}

/* Disable chart interaction on iPhone native to prevent conflicts with pull-to-refresh */
@media (max-width: 480px) {
  .native-mode .chart-container {
    pointer-events: none;
  }
}

.chart-header {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chart-summary {
  font-size: 13px;
  font-weight: 500;
}

.chart-change.positive {
  color: var(--positive);
}

.chart-change.negative {
  color: var(--negative);
}


.chart-wrapper {
  width: 100%;
  height: 240px;
  position: relative;
}

.chart-wrapper > div {
  width: 100%;
  height: 100%;
}

@media (max-width: 480px) {
  .chart-wrapper {
    height: 160px;
  }
}

.chart-wrapper svg:focus,
.chart-wrapper *:focus {
  outline: none;
}

.chart-loading {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

/* Funds List */
.funds-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 100px;
}

/* Fund Card */
.fund-card {
  background: var(--bg-card-default);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 12px 12px 10px 12px; /* 10px bottom to visually balance with logo */
  cursor: pointer;
  outline: none;
  transition: background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  will-change: transform, opacity; /* GPU layer for smooth animation */
}

.fund-card.focused {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 
    0 0 0 1px var(--bg),
    0 0 0 3px rgba(255, 255, 255, 0.06);
}

/* Fund Logo */
.fund-logo-wrapper {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 8px; /* Concentric: card 20px - padding 12px = 8px */
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  background: var(--bg-card-hover);
  align-self: flex-start;
}

.fund-logo-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.fund-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fund-content {
  flex: 1;
  min-width: 0;
}

.fund-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.fund-title {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.fund-name {
  font-weight: 500;
}

.fund-value {
  color: var(--text-secondary);
}

.fund-ytd {
  font-weight: 500;
}

/* Fund Details (expanded) */
.fund-details {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.detail-item--tappable {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.detail-item--tappable:active {
  opacity: 0.6;
}

.detail-label {
  color: var(--text-muted);
}

.detail-value {
  color: var(--text-secondary);
  text-align: right;
  min-width: 80px;
}

/* Holdings (expanded) */
/* History (expanded) */
.fund-history {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.year-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.year-label {
  flex-shrink: 0;
  min-width: 40px;
  color: var(--text-muted);
}

.year-end-price {
  flex-shrink: 0;
  min-width: 70px;
  color: var(--text-secondary);
  text-align: left;
}

.year-value {
  flex: 1;
  font-weight: 500;
  text-align: right;
}

/* Fund Meta (expanded) */
.fund-meta {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fund-fullname {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fund-meta-right {
  flex-shrink: 0;
  white-space: nowrap;
  text-align: right;
}

/* Colors */
.positive { color: var(--green); }
.negative { color: var(--red); }

/* Buttons */
.btn {
  padding: 6px 12px;
  font-family: inherit;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  background: var(--border);
  color: var(--text);
  cursor: pointer;
}

.btn:hover {
  background: #2a2a2a;
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
}

/* Dialog */
.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 100;
}

.dialog-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  width: 90%;
  max-width: 340px;
  z-index: 101;
}

.dialog-title {
  font-weight: 500;
  margin-bottom: 4px;
}

.dialog-description {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* Forms */
.field {
  margin-bottom: 20px;
}

.field-label {
  display: block;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.input {
  width: 100%;
  padding: 12px 16px;
  font-family: inherit;
  font-weight: 500;
  background: var(--bg, #000);
  border: none;
  border-radius: 12px;
  color: var(--text);
  outline: none;
}

.input:focus {
  box-shadow: 0 0 0 2px var(--border);
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.total-preview {
  padding: 16px;
  background: var(--bg, #000);
  border-radius: 12px;
  color: var(--text-secondary);
  text-align: center;
}

.total-preview strong {
  color: var(--text);
  font-weight: 500;
}

/* Login Screen */
.login-screen {
  position: fixed;
  inset: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  touch-action: none; /* Prevent pull-to-refresh and scroll gestures */
  background: #000;
}

.login-form {
  display: flex;
  gap: 8px;
}

.login-input {
  width: 120px;
  height: 40px;
  padding: 0 16px;
  font-size: 16px; /* Prevents iOS zoom on focus */
  font-family: inherit;
  -webkit-text-security: disc;
  font-weight: 400;
  text-align: center;
  letter-spacing: 4px;
  line-height: 40px;
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  outline: none;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.15s;
}

.login-input:focus {
  box-shadow: 
    inset 0 0 0 1px var(--border-focus-inner),
    0 0 0 1px var(--bg),
    0 0 0 3px var(--border-focus-outer);
}

.login-input.error {
  box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.4);
}

.login-input::placeholder {
  color: var(--text-placeholder);
  letter-spacing: 4px;
  font-weight: 400;
}

.login-button {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: opacity 0.15s;
}

.login-button:disabled {
  cursor: not-allowed;
}

.login-button:not(:disabled):hover {
  opacity: 0.9;
}

/* Passkey/Biometric login */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.login-container.ready {
  opacity: 1;
  transform: scale(1);
}

.passkey-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 168px; /* Same as input + button */
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s, border-color 0.15s;
  min-width: 168px;
  /* Hidden by default - always rendered to reserve space */
  opacity: 0;
  pointer-events: none;
}

.passkey-button.visible {
  opacity: 1;
  pointer-events: auto;
}

.passkey-button:hover:not(:disabled) {
  background: var(--bg-card);
  border-color: var(--border);
}

.passkey-button:focus-visible {
  outline: none;
  box-shadow: 
    inset 0 0 0 1px var(--border-focus-inner),
    0 0 0 1px var(--bg),
    0 0 0 3px var(--border-focus-outer);
}

.passkey-button:disabled:not(.visible) {
  opacity: 0;
}

.passkey-button.visible:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.passkey-icon {
  font-size: 20px;
}

.passkey-error {
  color: #f87171;
  font-size: 12px;
  margin: 0;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 12px;
  width: 100%;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

/* Skeleton loading */
.skeleton {
  display: inline-block;
  vertical-align: middle;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.04) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
}

.fund-title .skeleton,
.fund-header .skeleton {
  margin-top: 2px;
}

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

/* Command Menu (cmdk) */
.command-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 18vh;
  z-index: 1000;
  outline: none;
}

.command-overlay *:focus,
.command-overlay *:focus-visible {
  outline: none !important;
}

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

/* Command menu - concentric radii */
.command-menu-wrapper {
  width: 480px;
  max-width: calc(100vw - 32px);
  display: flex;
  flex-direction: column;
  will-change: transform, opacity;
}

.command-menu {
  --cmd-padding: 5px;
  --cmd-item-radius: 9px;
  --cmd-radius: calc(var(--cmd-item-radius) + var(--cmd-padding));
  --cmd-icon-size: 20px;
  
  width: 100%;
  background: var(--bg-card);
  border-radius: var(--cmd-radius);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

/* Shadow on pseudo-element so it doesn't re-render during scale animation */
.command-menu::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  z-index: -1;
  pointer-events: none;
}

/* Remove focus ring from all cmdk elements */
.command-menu *:focus,
.command-menu *:focus-visible,
.command-menu [cmdk-root],
.command-menu [cmdk-group] {
  outline: none !important;
}

.command-input-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  min-height: 46px; /* Prevent layout shift on view change */
}

.command-search-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.command-menu [cmdk-input] {
  flex: 1;
  padding: 0;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  border: none;
  outline: none;
}

.command-menu [cmdk-input]::placeholder {
  color: var(--text-muted);
}

.command-menu [cmdk-list] {
  max-height: min(70vh, 600px);
  overflow-y: auto;
  overflow-x: hidden; /* Prevent horizontal shift */
  padding: var(--cmd-padding);
  scroll-padding-bottom: var(--cmd-padding);
  outline: none; /* Remove focus ring */
}

/* When showing article detail, allow height to fit content */
.command-menu:has(.command-article-detail) [cmdk-list] {
  max-height: none;
}

.command-menu [cmdk-list]::-webkit-scrollbar {
  display: none;
}

.command-menu [cmdk-empty] {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.command-menu [cmdk-group] {
  padding-bottom: 4px;
  /* Prevent horizontal shift when virtual list renders */
  overflow: hidden;
}

.command-menu [cmdk-group]:last-child {
  padding-bottom: 0;
}

.command-menu [cmdk-group-heading] {
  padding: 6px 10px 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.command-menu [cmdk-item] {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--cmd-item-radius);
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
  outline: none;
}

.command-menu [cmdk-item][data-selected="true"],
.command-menu [cmdk-item]:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.command-menu [cmdk-item][aria-selected="true"] {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.command-menu [cmdk-item][data-selected="true"] .command-shortcut,
.command-menu [cmdk-item]:hover .command-shortcut,
.command-menu [cmdk-item][aria-selected="true"] .command-shortcut {
  color: var(--text);
}

.command-icon {
  opacity: 0.6;
  flex-shrink: 0;
  /* Reserve space before icon loads to prevent layout shift */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--cmd-icon-size);
  height: var(--cmd-icon-size);
  min-width: var(--cmd-icon-size);
  min-height: var(--cmd-icon-size);
}

.command-icon svg {
  stroke-width: 2.5;
}

.command-search-icon {
  width: var(--cmd-icon-size);
  height: var(--cmd-icon-size);
}

.command-back svg {
  width: var(--cmd-icon-size);
  height: var(--cmd-icon-size);
}

.command-active {
  width: calc(var(--cmd-icon-size) - 4px);
  height: calc(var(--cmd-icon-size) - 4px);
  margin-left: auto;
  color: var(--text);
  opacity: 0.7;
}

/* Active model highlight */
.command-icon-active {
  opacity: 1;
  color: #fff;
}

.command-label-active {
  color: #fff;
}

.command-shortcut {
  margin-left: auto;
  font-size: 11px;
  font-family: inherit;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.command-back {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  width: var(--cmd-icon-size);
  height: var(--cmd-icon-size);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.command-back:hover {
  color: var(--text);
}

.command-db-entry {
  justify-content: space-between;
}

.command-db-date {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.command-db-value {
  color: var(--text);
}

/* Archive search entries */
.command-archive-entry {
  display: flex;
  align-items: center;
  gap: 10px;
}

.command-archive-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.command-archive-meta {
  color: var(--text-muted);
  font-size: 12px;
  flex-shrink: 0;
}

.command-archive-sentiment.positive {
  color: var(--positive);
  opacity: 1;
}

.command-archive-sentiment.negative {
  color: var(--negative);
  opacity: 1;
}

.command-archive-sentiment.neutral {
  color: var(--text-muted);
  opacity: 1;
}

/* Virtual list for large datasets (react-window) */
.command-menu .virtual-list {
  outline: none !important;
  /* Prevent horizontal layout shift */
  overflow-x: hidden !important;
}

.command-menu .virtual-list > div {
  padding: 0 var(--cmd-padding);
  box-sizing: border-box;
}

/* Article detail view - matches news card typography */
.command-detail-title {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.command-article-detail {
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.command-article-detail .news-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.command-article-detail .news-title {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text);
  text-wrap: balance;
}

.command-article-detail .news-summary {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
  text-wrap: balance;
}

.command-article-detail .news-context {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
  text-wrap: balance;
}

.command-article-detail .news-context strong {
  font-weight: 500;
  color: var(--text);
}

.command-article-detail .news-link {
  display: inline-block;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.command-article-detail .news-link:hover {
  color: var(--text);
}

.command-archive-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.command-archive-title {
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.command-archive-meta {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* Subline in Command Menu (used for costs, etc.) */
.command-subline {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}

/* Command menu - mobile */
@media (max-width: 480px) {
  .command-overlay {
    padding: 10px;
    padding-bottom: 90px; /* Room for dock */
    align-items: stretch;
    z-index: 99; /* Below dock on mobile */
    touch-action: none; /* Prevent scroll-through on iOS */
    overscroll-behavior: contain;
  }
  
  .command-menu-wrapper {
    max-width: none;
    flex: 1;
    min-height: 0;
  }
  
  .command-menu {
    --cmd-item-radius: 12px;
    --cmd-radius: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  
  .command-menu [cmdk-list] {
    max-height: none;
    flex: 1;
    overflow-y: auto;
  }
  
  .command-input-wrapper {
    padding: 16px;
  }
  
  .command-menu [cmdk-input] {
    font-size: 16px; /* Prevent iOS zoom */
  }
}

/* Chart placeholder */
.chart-placeholder {
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 420px;
  margin: 0 auto 24px;
  padding: 0 16px;
}

@media (max-width: 480px) {
  .chart-placeholder {
    height: 160px;
  }
}

/* Chart tooltip - wrapper reset and pill styling */
.recharts-tooltip-wrapper {
  margin: 0 !important;
  padding: 0 !important;
}

.chart-tooltip-pill {
  --tooltip-padding: 5px 14px 6px;
  --tooltip-radius: 100px;
  --tooltip-border: 1px;
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: var(--tooltip-padding);
  border-radius: var(--tooltip-radius);
  white-space: nowrap;
}

.chart-tooltip-backdrop {
  position: absolute;
  inset: calc(-1 * var(--tooltip-border));
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px) saturate(1.5);
  -webkit-backdrop-filter: blur(12px) saturate(1.5);
  border-radius: var(--tooltip-radius);
  z-index: 0;
}

.chart-tooltip-fill {
  position: absolute;
  inset: 0;
  background: rgb(10, 10, 11);
  border-radius: var(--tooltip-radius);
  z-index: 1;
}

.chart-tooltip-date {
  position: relative;
  z-index: 2;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.chart-tooltip-year {
  position: relative;
  z-index: 2;
  font-size: 13px;
  color: var(--text-muted);
}


/* Dock - concentric radii: outer = inner + padding */
.dock {
  --dock-padding: 4px;
  --dock-item-size: 48px;
  --dock-item-radius: 18px;
  --dock-radius: calc(var(--dock-item-radius) + var(--dock-padding));
  --dock-border: 1px;
  
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateZ(0);
  display: flex;
  gap: 8px;
  padding: var(--dock-padding);
  border-radius: var(--dock-radius);
  z-index: 100;
  /* Prevent movement during scroll/pull-to-refresh */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.dock-backdrop {
  position: absolute;
  inset: calc(-1 * var(--dock-border));
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px) saturate(1.5);
  -webkit-backdrop-filter: blur(10px) saturate(1.5);
  border-radius: calc(var(--dock-radius) + var(--dock-border));
  z-index: 0;
}

.dock-fill {
  position: absolute;
  inset: 0;
  background: rgb(15, 15, 15);
  border-radius: var(--dock-radius);
  z-index: 1;
}


.dock-item {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--dock-item-size);
  height: var(--dock-item-size);
  background: transparent;
  border: none;
  border-radius: var(--dock-item-radius);
  color: var(--text-muted);
  outline: none;
  cursor: pointer;
  transition: color 0.15s ease;
}

.dock-item-bg {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--dock-item-radius);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  will-change: transform; /* GPU layer for smooth animation */
}

.dock-icon {
  position: relative;
  z-index: 1;
}

.dock-item svg {
  stroke-width: 2;
}

.dock-item:hover {
  color: var(--text);
}

.dock-item:has(.dock-item-bg) {
  color: var(--text);
}

/* Hide command menu button on desktop (use ⌘K instead) */
.dock-item--mobile-only {
  display: none;
}

@media (max-width: 480px) {
  .dock-item--mobile-only {
    display: flex;
  }
  
  /* Hide research on phones (keep on tablet+) */
  .dock-item--tablet-up {
    display: none;
  }
}

/* News View */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
  padding-bottom: 100px;
}


.news-loading {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
  font-size: 14px;
}

/* News Card */
.news-card {
  --card-gap: 12px;
  background: var(--bg-card-default);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
  /* No gap - use explicit margins to avoid jump when AnimatePresence unmounts */
}

.news-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border);
}

.news-card.focused {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 
    0 0 0 1px var(--bg),
    0 0 0 3px rgba(255, 255, 255, 0.06);
}

/* Header: Logos + title */
.news-header {
  display: flex;
  flex-direction: column;
  gap: var(--card-gap);
}


.ticker-logos {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ticker-logo-wrapper {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.ticker-logo-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

.ticker-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Keep small raster logos from looking soft after downscaling. */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  transform: translateZ(0);
}

.ticker-logo-emoji {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  z-index: 2;
}

.ticker-logo-emoji-blur {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(2.5);
  width: 18px;
  height: 18px;
  filter: blur(8px) saturate(2);
  opacity: 0.4;
  z-index: 1;
}

/* Flag icons as fallback */
.flag-icons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.flag-icon-wrapper {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.flag-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 16px;
  height: 12px;
  border-radius: 2px;
}

.flag-icon-blur {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(2.5);
  width: 100%;
  height: 100%;
  filter: blur(10px) saturate(2);
  opacity: 0.3;
  z-index: 1;
}

.flag-icon-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  pointer-events: none;
  z-index: 3;
}

/* Emoji Icons (Twemoji) - same styling as flags */
.emoji-icons {
  display: flex;
  gap: 4px;
}

.emoji-icon-wrapper {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.emoji-icon {
  position: absolute;
  inset: 0;
  margin: auto;
  z-index: 2;
  width: 16px;
  height: 16px;
}

/* Banknote emojis need slight vertical adjustment */
.emoji-icon--banknote {
  transform: translateY(-1px);
}

.emoji-icon-blur {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(2.5);
  width: 100%;
  height: 100%;
  filter: blur(10px) saturate(2);
  opacity: 0.3;
  z-index: 1;
}

.emoji-icon-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  pointer-events: none;
  z-index: 3;
}

.source-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Live Price Tickers - Marquee */
.price-ticker-marquee {
  position: relative;
  overflow: hidden;
  width: 100%;
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 10%,
    black 90%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 10%,
    black 90%,
    transparent 100%
  );
}

.price-ticker-track {
  display: inline-flex;
  gap: 0;
  white-space: nowrap;
  animation: ticker-scroll 60s linear infinite;
}

.price-ticker-set {
  display: inline-flex;
  gap: 8px;
  padding-right: 8px; /* Gap between the two sets */
}

@keyframes ticker-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.price-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-family: "Geist Mono", "SF Mono", "Monaco", monospace;
  font-variant-numeric: tabular-nums;
}

.price-ticker-item.positive {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0%, rgba(74, 222, 128, 0.15) 100%);
}

.price-ticker-item.negative {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0%, rgba(248, 113, 113, 0.15) 100%);
}

.price-ticker-symbol {
  color: var(--text-secondary);
  font-weight: 500;
}

.price-ticker-change {
  font-weight: 600;
}

.price-ticker-change.positive {
  color: var(--positive);
}

.price-ticker-change.negative {
  color: var(--negative);
}

.news-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: var(--card-gap);
}

.news-title {
  font-weight: 500;
  font-size: 15px;
  line-height: 1.3;
  color: var(--text);
  text-align: left;
  text-wrap: balance;
  margin-top: 4px;
  max-width: 480px;
}

/* Summary: Always visible - 15px main content */
.news-summary {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
  margin-top: var(--card-gap);
  text-wrap: balance;
  max-width: 480px;
}

/* Expanded content wrapper - no margin, content inside has margin */
.news-expanded-content {
  /* margin handled by inner content */
}

/* Expanded context section */
.news-context-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: var(--card-gap);
  max-width: 480px;
}

.news-context {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
  text-wrap: balance;
  max-width: 480px;
}

.news-link {
  font-size: 15px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.news-link:hover {
  color: var(--text);
}


.news-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
  font-size: 14px;
}

/* Load More button for historical articles */
.load-more-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 16px;
  background: var(--bg-card-default);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}

.load-more-button:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--border);
}

.load-more-button:focus-visible,
.load-more-button.focused {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 
    0 0 0 1px var(--bg),
    0 0 0 3px rgba(255, 255, 255, 0.06);
}

.load-more-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ==========================================================================
   DIVIDEND VIEW
   ========================================================================== */

/* Next payment (right side of card header) */
.dividend-next {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
}

.dividend-amount {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.dividend-amount.positive {
  color: var(--positive);
}

.dividend-when {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ==========================================================================
   SIGNALS VIEW
   ========================================================================== */

.signals-view {
  /* No horizontal padding - uses .app container padding */
}

.signals-spinner {
  animation: spin 1s linear infinite;
}

.signals-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
  padding-bottom: 100px;
}

.signals-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.signals-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}

.signals-empty-icon {
  width: 48px;
  height: 48px;
  opacity: 0.3;
}

.signals-empty p {
  margin: 0;
  font-size: 15px;
}

.signals-empty-hint {
  font-size: 13px;
  opacity: 0.5;
}

/* Signal Card - Matches news card structure exactly */
.signal-card {
  --card-gap: 12px;
  background: var(--bg-card-default);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 16px;
  transition: background 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
}

.signal-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border);
}

.signal-card.focused {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow:
    0 0 0 1px var(--bg),
    0 0 0 3px rgba(255, 255, 255, 0.06);
}

/* Header: Icons + Title (matches news-header) */
.signal-header {
  display: flex;
  flex-direction: column;
  gap: var(--card-gap);
}

.signal-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Gist: 2-3 sentence summary, white text */
.signal-gist {
  font-size: 15px;
  font-weight: 450;
  line-height: 1.5;
  color: var(--text);
  margin: var(--card-gap) 0 0 0;
  text-wrap: balance;
}

/* Signal direction icon */
.signal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex-shrink: 0;
}

.signal-icon--bullish {
  color: var(--positive);
  background: rgba(74, 222, 128, 0.08);
}

.signal-icon--bearish {
  color: var(--negative);
  background: rgba(248, 113, 113, 0.08);
}

.signal-icon--hold {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
}

/* Ticker logo fallback for signals */
.signal-card .ticker-logo-fallback {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.06);
}

.signal-card .ticker-logo-fallback.visible {
  display: flex;
}

/* Use same margins as news cards */
.signal-card .news-summary {
  margin-top: var(--card-gap);
}

.signal-card .news-time {
  margin-top: var(--card-gap);
}

/* Expanded details - matches news-expanded-content */
.signal-details {
  /* No padding here - inner content handles spacing */
}

.signal-details-inner {
  margin-top: var(--card-gap);
}

/* Full reasoning shown on expand */
.signal-reasoning {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
  text-wrap: balance;
}

.signal-meta-list {
  display: flex;
  flex-direction: column;
  margin-top: var(--card-gap);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  overflow: hidden;
}

.signal-meta-item {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.4;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.signal-meta-item:last-child {
  border-bottom: none;
}

.signal-meta-item strong {
  flex-shrink: 0;
  font-weight: 500;
  color: var(--text);
  min-width: 58px;
}

.signal-meta-item span {
  color: var(--text-secondary);
  overflow: hidden;
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  text-overflow: ellipsis;
}

/* =============================================================================
   UNIFIED ARTICLE ICON COMPONENT
   Used by NewsView, CommandMenu list, and CommandMenu detail view
   ============================================================================= */

.article-icons {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Base icon wrapper */
.article-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  overflow: hidden;
}

/* Size variants */
.article-icon-wrapper--large {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
}

.article-icon-wrapper--small {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  border-radius: 6px;
}

/* Inner border overlay */
.article-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  pointer-events: none;
  z-index: 5;
}

/* Logo - sits on top */
.article-icon-logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 4;
}

/* Flag icon */
.article-icon-flag {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 2px;
  z-index: 2;
}

.article-icon-flag.article-icon--large {
  width: 16px;
  height: 12px;
}

.article-icon-flag.article-icon--small {
  width: 14px;
  height: 10px;
}

/* Flag blur effect */
.article-icon-flag-blur {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(2.5);
  width: 100%;
  height: 100%;
  filter: blur(10px) saturate(2);
  opacity: 0.3;
  z-index: 1;
}

/* Emoji icon */
.article-icon-emoji {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.article-icon-emoji.article-icon--large {
  width: 16px;
  height: 16px;
}

.article-icon-emoji.article-icon--small {
  width: 14px;
  height: 14px;
}

/* Emoji blur effect */
.article-icon-emoji-blur {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(2);
  filter: blur(8px) saturate(2);
  opacity: 0.4;
  z-index: 1;
}

.article-icon-emoji-blur.article-icon--large {
  width: 16px;
  height: 16px;
}

.article-icon-emoji-blur.article-icon--small {
  width: 14px;
  height: 14px;
}

/* Banknote special case - nudged up 1px */
.article-icon-emoji--banknote {
  transform: translate(-50%, -50%) translateY(-1px) !important;
}

/* Large banknote slightly larger */
.article-icon-emoji--banknote.article-icon--large {
  width: 18px !important;
  height: 18px !important;
}

/* ==========================================================================
   RESEARCH VIEW
   ========================================================================== */

.research-view {
  width: 100%;
}

.research-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: calc(20px + var(--dock-height) + 20px + 52px + 40px);
  min-height: 50vh;
}

.research-messages--empty {
  min-height: 0;
  padding-bottom: 0;
}

/* Bottom fade overlay for smooth scroll transition */
.research-fade {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  /* Tall enough to cover: dock area (20px + 56px) + input area (20px gap + ~60px input) + fade above */
  height: calc(20px + var(--dock-height) + 20px + 80px + 80px);
  background: linear-gradient(to top, var(--bg) 0%, var(--bg) 60%, transparent 100%);
  pointer-events: none;
  z-index: 80;
}

/* Message cards - same styling as fund cards */
.research-card {
  background: var(--bg-card-default);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 16px;
}

.research-card--question {
  background: var(--bg-card-default);
  border: 1px solid var(--border-subtle);
}

.research-question {
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
}

/* AI replies - like article content, denser */
.research-answer {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.45;
}

.research-paragraphs {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.research-paragraphs p {
  margin: 0;
  text-wrap: balance;
}

.research-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.research-list li {
  line-height: 1.5;
  padding-left: 20px;
  position: relative;
}

.research-list li::before {
  content: "•";
  color: var(--text-muted);
  position: absolute;
  left: 0;
}


/* Actual ticker badges in lists - already styled, remove bullet */
.research-list li .inline-ticker-badge {
  margin-right: 4px;
}

/* Markdown headers */
.research-h2 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  margin-top: 8px;
}

.research-h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  margin-top: 4px;
}

.research-h4 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0;
}

/* Remove gap before first element and after headers */
.research-paragraphs > *:first-child {
  margin-top: 0;
}

.research-h2 + p,
.research-h3 + p,
.research-h4 + p {
  margin-top: -8px;
}

.research-answer a {
  color: var(--text-muted);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: rgba(102, 102, 102, 0.5);
}

.research-answer a:hover {
  color: var(--text-secondary);
  text-decoration-color: rgba(102, 102, 102, 0.8);
}

.research-time {
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-muted);
}

.research-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 15px;
}

.research-spinner {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  flex-shrink: 0;
  aspect-ratio: 1;
  border: 2px solid var(--border);
  border-top-color: var(--text-secondary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.research-streaming-indicator {
  display: flex;
  align-items: center;
  margin-top: 12px;
  opacity: 0.6;
}

/* Input wrapper - centered when empty */
.research-input-wrapper {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  margin-top: 25vh;
}

/* Docked state - aligned with dock */
.research-input-wrapper--docked {
  position: fixed;
  bottom: calc(20px + var(--dock-height) + 20px);
  /* Center without transform (motion.div uses transform for animation) */
  left: 0;
  right: 0;
  /* Match dock width: 5 items * 48px + 4 gaps * 8px + 2 * 4px padding */
  width: calc(5 * 48px + 4 * 8px + 2 * 4px);
  margin: 0 auto;
  z-index: 90;
}

/* Smaller input when docked */
.research-input-wrapper--docked .research-input {
  min-height: 60px;
  max-height: 200px;
  height: auto;
  padding: 18px 16px;
  padding-right: 60px;
  overflow-y: auto;
}

/* Keep button at bottom-right in docked input, 10px gaps, centered */
.research-input-wrapper--docked .research-send {
  width: 40px;
  height: 40px;
  right: 10px;
  bottom: 10px;
}

.research-input-wrapper--docked .research-send svg {
  width: 22px;
  height: 22px;
}

.research-input-container {
  position: relative;
  width: 100%;
  max-width: none;
}

/* Input - same fill/border as cards, matches news card font */
.research-input {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 160px;
  background: var(--bg-card-default);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 16px;
  padding-right: 60px;
  padding-bottom: 16px;
  color: var(--text);
  font-size: 16px; /* Prevents iOS zoom on focus */
  font-weight: 500;
  line-height: 1.4;
  font-family: inherit;
  resize: none;
  outline: none;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.research-input:focus {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow:
    0 0 0 1px var(--bg),
    0 0 0 3px rgba(255, 255, 255, 0.06);
}

.research-input::placeholder {
  color: var(--text-secondary);
}

.research-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Send button - 10px from inner edge of textarea, concentric radius */
.research-send {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 10px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.research-send:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
}

.research-send:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.research-send svg {
  color: #fff;
  width: 20px;
  height: 20px;
  stroke-width: 3px;
}

/* Suggestions - same font style as cards */
.research-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}


.research-suggestions button {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 10px 6px 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.research-suggestions button svg {
  opacity: 0.6;
}

.research-suggestions button:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.08);
}

/* =============================================================================
   WATCHLIST VIEW
   ============================================================================= */

.watchlist-search-container {
  position: relative;
  margin-top: 10px;
  margin-bottom: 10px; /* Match gap between watchlist cards */
}

.watchlist-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.watchlist-search-icon {
  position: absolute;
  left: 16px;
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  pointer-events: none;
}

.watchlist-search-input {
  width: 100%;
  background: var(--bg-card-default);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 14px 16px 14px 48px;
  color: var(--text);
  font-size: 16px; /* Prevents iOS zoom on focus */
  font-weight: 500;
  font-family: inherit;
  outline: none;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.watchlist-search-input:focus {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow:
    0 0 0 1px var(--bg),
    0 0 0 3px rgba(255, 255, 255, 0.06);
}

.watchlist-search-input::placeholder {
  color: var(--text-secondary);
}

.watchlist-search-spinner {
  position: absolute;
  right: 16px;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--text-muted);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Dropdown */
.watchlist-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 320px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.watchlist-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s ease;
  font-family: inherit;
}

.watchlist-dropdown-item:hover {
  background: var(--bg-card-hover);
}

.watchlist-dropdown-item.focused {
  background: var(--bg-card-hover);
  box-shadow: 
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 0 0 1px var(--bg),
    0 0 0 3px rgba(255, 255, 255, 0.06);
}

.watchlist-dropdown-item:not(:last-child) {
  border-bottom: 1px solid var(--border-subtle);
}

.watchlist-dropdown-logo-wrapper {
  position: relative;
  width: 32px;
  height: 32px;
  min-width: 32px;
}

.watchlist-dropdown-logo-fallback {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--bg-card-hover);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.watchlist-dropdown-logo {
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.watchlist-dropdown-content {
  flex: 1;
  min-width: 0;
}

.watchlist-dropdown-ticker {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.watchlist-dropdown-eur {
  display: inline-block;
  padding: 2px 5px;
  background: rgba(74, 222, 128, 0.15);
  color: var(--positive);
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
}

.watchlist-dropdown-name {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.watchlist-dropdown-exchange {
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
}

/* Empty state */
.watchlist-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-secondary);
}

.watchlist-empty svg {
  opacity: 0.4;
}

.watchlist-empty p {
  margin: 0;
}

.watchlist-empty-hint {
  font-size: 13px;
  color: var(--text-muted);
}

.watchlist-loading {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}

/* Remove button */
.watchlist-remove-btn {
  padding: 0;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.2);
  font-size: inherit;
  font-weight: inherit;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.15s ease;
  text-align: left;
}

.watchlist-remove-btn:hover {
  color: var(--text-muted);
}

/* Watchlist card focus state - ensure visibility with Reorder.Item */
.funds-list .fund-card.focused {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 
    0 0 0 1px var(--bg),
    0 0 0 3px rgba(255, 255, 255, 0.06);
}

/* Reorder drag state */
.fund-card[style*="z-index"] {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  cursor: grabbing;
}
