:root {
  color-scheme: dark;
  --bg: #101317;
  --panel: #171c22;
  --panel-strong: #1f2630;
  --line: #303946;
  --text: #f2f5f8;
  --muted: #9aa6b2;
  --accent: #20c997;
  --danger: #ff6b6b;
  --warning: #ffd166;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(12, 16, 21, 0.88), rgba(16, 19, 23, 0.98)),
    radial-gradient(circle at 55% -10%, rgba(32, 201, 151, 0.08), transparent 32rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle, rgba(211, 197, 255, 0.94) 0 1.5px, transparent 3px) 8% 18% / 12px 12px no-repeat,
    radial-gradient(circle, rgba(32, 201, 151, 0.62) 0 1.5px, transparent 3px) 18% 63% / 12px 12px no-repeat,
    radial-gradient(circle, rgba(211, 197, 255, 0.86) 0 1.5px, transparent 3px) 31% 38% / 12px 12px no-repeat,
    radial-gradient(circle, rgba(32, 201, 151, 0.52) 0 1.5px, transparent 3px) 43% 16% / 12px 12px no-repeat,
    radial-gradient(circle, rgba(211, 197, 255, 0.82) 0 1.5px, transparent 3px) 56% 58% / 12px 12px no-repeat,
    radial-gradient(circle, rgba(32, 201, 151, 0.55) 0 1.5px, transparent 3px) 68% 28% / 12px 12px no-repeat,
    radial-gradient(circle, rgba(211, 197, 255, 0.86) 0 1.5px, transparent 3px) 82% 52% / 12px 12px no-repeat,
    radial-gradient(circle, rgba(211, 197, 255, 0.78) 0 1.5px, transparent 3px) 94% 20% / 12px 12px no-repeat;
  filter:
    drop-shadow(0 0 5px rgba(175, 138, 255, 0.68))
    drop-shadow(0 0 16px rgba(124, 58, 237, 0.32));
  opacity: 0.48;
  animation: pageFireflies 12s linear infinite, pageFireflyPulse 3s ease-in-out infinite;
  mask-image: linear-gradient(to bottom, black 0%, black 42%, rgba(0, 0, 0, 0.42) 58%, transparent 75%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle, rgba(211, 197, 255, 0.72) 0 1px, transparent 2.5px) 13% 46% / 10px 10px no-repeat,
    radial-gradient(circle, rgba(32, 201, 151, 0.48) 0 1px, transparent 2.5px) 25% 22% / 10px 10px no-repeat,
    radial-gradient(circle, rgba(211, 197, 255, 0.74) 0 1px, transparent 2.5px) 38% 72% / 10px 10px no-repeat,
    radial-gradient(circle, rgba(32, 201, 151, 0.42) 0 1px, transparent 2.5px) 51% 33% / 10px 10px no-repeat,
    radial-gradient(circle, rgba(211, 197, 255, 0.7) 0 1px, transparent 2.5px) 72% 67% / 10px 10px no-repeat,
    radial-gradient(circle, rgba(32, 201, 151, 0.44) 0 1px, transparent 2.5px) 90% 41% / 10px 10px no-repeat;
  filter:
    drop-shadow(0 0 5px rgba(211, 197, 255, 0.48))
    drop-shadow(0 0 14px rgba(32, 201, 151, 0.24));
  opacity: 0.26;
  animation: pageFirefliesAlt 16s linear infinite, pageFireflyPulse 4.2s ease-in-out infinite reverse;
  mask-image: linear-gradient(to bottom, black 0%, black 38%, rgba(0, 0, 0, 0.34) 56%, transparent 75%);
}

@keyframes pageFireflies {
  0% {
    transform: translate3d(0, 0, 0) scale(0.92);
  }
  45% {
    transform: translate3d(38px, -54px, 0) scale(1.08);
  }
  100% {
    transform: translate3d(0, 0, 0) scale(0.92);
  }
}

@keyframes pageFirefliesAlt {
  0% {
    transform: translate3d(0, 0, 0) scale(0.9);
  }
  50% {
    transform: translate3d(-48px, 34px, 0) scale(1.12);
  }
  100% {
    transform: translate3d(0, 0, 0) scale(0.9);
  }
}

@keyframes pageFireflyPulse {
  0%, 100% {
    opacity: 0.08;
  }
  45% {
    opacity: 0.58;
  }
  72% {
    opacity: 0.24;
  }
}

.home-page {
  background: inherit;
}

.login-page {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 22px;
  padding: 20px;
}

.login-shell {
  width: min(420px, 100%);
}

.login-panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-panel h1 {
  margin-bottom: 22px;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.login-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f1318;
  color: var(--text);
  padding: 0 12px;
}

.login-message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.login-message.error {
  color: var(--danger);
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.home-hero {
  position: relative;
  min-height: 520px;
  display: grid;
  align-items: end;
  overflow: hidden;
  margin-bottom: 16px;
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(26, 18, 20, 0.94), rgba(11, 15, 20, 0.96) 45%, rgba(12, 26, 22, 0.96)),
    #0b0f14;
  box-shadow: var(--shadow);
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, transparent, black 22%, black 78%, transparent);
  opacity: 0.55;
}

.home-hero-content {
  position: relative;
  z-index: 3;
  max-width: 820px;
}

.home-hero h1 {
  margin-bottom: 12px;
  font-size: clamp(2.8rem, 6vw, 6rem);
  line-height: 0.94;
}

.home-hero-content > p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.primary-action,
.secondary-action,
.action-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 900;
  text-decoration: none;
}

.primary-action {
  padding: 0 18px;
  border: 1px solid rgba(32, 201, 151, 0.72);
  background: #20c997;
  color: #06110e;
  box-shadow: 0 14px 34px rgba(32, 201, 151, 0.22);
}

.secondary-action,
.action-link {
  padding: 0 16px;
  border: 1px solid var(--line);
  background: rgba(15, 19, 24, 0.82);
  color: var(--text);
}

.primary-action:hover,
.primary-action:focus-visible,
.secondary-action:hover,
.secondary-action:focus-visible,
.action-link:hover,
.action-link:focus-visible {
  transform: translateY(-1px);
}

.market-creature {
  position: absolute;
  z-index: 1;
  width: min(44vw, 560px);
  aspect-ratio: 1.35;
  bottom: 74px;
  opacity: 0.2;
  filter: blur(0.2px);
  background: rgba(255, 255, 255, 0.72);
  pointer-events: none;
}

.market-creature.bear {
  left: -70px;
  background: rgba(255, 107, 107, 0.42);
  clip-path: polygon(8% 60%, 15% 35%, 26% 32%, 36% 18%, 47% 32%, 62% 30%, 78% 38%, 91% 56%, 86% 68%, 72% 62%, 62% 76%, 49% 72%, 36% 82%, 26% 70%, 15% 74%);
}

.market-creature.bull {
  right: -64px;
  background: rgba(32, 201, 151, 0.42);
  clip-path: polygon(8% 58%, 18% 34%, 32% 32%, 38% 16%, 47% 34%, 58% 32%, 68% 15%, 73% 36%, 88% 42%, 94% 56%, 84% 66%, 72% 58%, 65% 75%, 50% 70%, 36% 78%, 27% 62%, 16% 68%);
}

.hero-chart-line {
  position: absolute;
  z-index: 2;
  inset: 92px 8% 120px;
  opacity: 0.82;
  background:
    url("data:image/svg+xml,%3Csvg width='1200' height='360' viewBox='0 0 1200 360' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' x2='1' y1='0' y2='0'%3E%3Cstop offset='0' stop-color='%23ff5c66'/%3E%3Cstop offset='.48' stop-color='%23ffd166'/%3E%3Cstop offset='1' stop-color='%2320c997'/%3E%3C/linearGradient%3E%3Cfilter id='glow'%3E%3CfeGaussianBlur stdDeviation='5' result='b'/%3E%3CfeMerge%3E%3CfeMergeNode in='b'/%3E%3CfeMergeNode in='SourceGraphic'/%3E%3C/feMerge%3E%3C/filter%3E%3C/defs%3E%3Cpath d='M20 250 L135 282 L230 220 L315 245 L410 185 L505 210 L612 134 L704 158 L805 92 L908 115 L1010 58 L1180 38' fill='none' stroke='url(%23g)' stroke-width='9' stroke-linecap='round' stroke-linejoin='round' filter='url(%23glow)'/%3E%3C/svg%3E")
    center / contain no-repeat;
  pointer-events: none;
}

.fireflies {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.fireflies span {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 231, 150, 0.82);
  box-shadow: 0 0 12px rgba(255, 231, 150, 0.72);
  animation: fireflyFloat 8s ease-in-out infinite;
  opacity: 0.45;
}

.fireflies span:nth-child(1) { left: 14%; top: 25%; animation-delay: -1s; }
.fireflies span:nth-child(2) { left: 28%; top: 64%; animation-delay: -3s; }
.fireflies span:nth-child(3) { left: 48%; top: 21%; animation-delay: -5s; }
.fireflies span:nth-child(4) { left: 70%; top: 62%; animation-delay: -2s; }
.fireflies span:nth-child(5) { left: 86%; top: 30%; animation-delay: -6s; }
.fireflies span:nth-child(6) { left: 58%; top: 78%; animation-delay: -4s; }

@keyframes fireflyFloat {
  0%, 100% { transform: translate3d(0, 0, 0); opacity: 0.18; }
  35% { transform: translate3d(10px, -18px, 0); opacity: 0.55; }
  70% { transform: translate3d(-12px, 10px, 0); opacity: 0.34; }
}

.home-section {
  margin-bottom: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

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

.product-card {
  min-height: 210px;
  display: grid;
  align-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 46%),
    var(--panel-strong);
}

.product-card {
  overflow: hidden;
}

.product-visual {
  min-height: 116px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: #0f1318;
}

.rsi-visual {
  background:
    url("data:image/svg+xml,%3Csvg width='440' height='130' viewBox='0 0 440 130' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18 96 L74 82 L128 93 L176 56 L232 68 L286 30 L342 46 L420 20' fill='none' stroke='%2320c997' stroke-width='6' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M18 42 H420' stroke='%23ffd166' stroke-width='2' stroke-dasharray='8 8' opacity='.58'/%3E%3Cpath d='M18 92 H420' stroke='%23ff6b6b' stroke-width='2' stroke-dasharray='8 8' opacity='.55'/%3E%3C/svg%3E")
    center / cover no-repeat,
    #10161c;
}

.crypto-visual {
  background:
    radial-gradient(circle at 24% 45%, rgba(32, 201, 151, 0.58) 0 22px, transparent 23px),
    radial-gradient(circle at 50% 38%, rgba(255, 209, 102, 0.48) 0 18px, transparent 19px),
    radial-gradient(circle at 74% 55%, rgba(99, 179, 237, 0.38) 0 24px, transparent 25px),
    linear-gradient(135deg, #10161c, #151b24);
}

.congress-visual {
  background:
    linear-gradient(90deg, rgba(32, 201, 151, 0.52) 0 14px, transparent 14px 26px) 28px 32px / 90px 18px no-repeat,
    linear-gradient(90deg, rgba(255, 107, 107, 0.52) 0 14px, transparent 14px 26px) 28px 68px / 130px 18px no-repeat,
    linear-gradient(90deg, rgba(255, 209, 102, 0.52) 0 14px, transparent 14px 26px) 28px 92px / 112px 18px no-repeat,
    linear-gradient(135deg, #10161c, #151b24);
}

.product-card h3 {
  margin: 0 0 8px;
  font-size: 1.45rem;
}

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

.product-kicker {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 18px;
  align-items: center;
  margin-top: 22px;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer p {
  max-width: 560px;
  margin: 4px 0 0;
  font-size: 0.88rem;
}

.footer-brand {
  color: var(--text);
  font-size: 1rem;
  font-weight: 950;
  text-decoration: none;
}

.footer-links,
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-links a,
.social-links a {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.footer-links a:hover,
.footer-links a:focus-visible,
.social-links a:hover,
.social-links a:focus-visible {
  color: var(--text);
}

.social-links a[aria-disabled="true"] {
  opacity: 0.72;
}

.login-footer {
  width: min(920px, 100%);
}

.topbar,
.control-panel,
.workspace,
.log-panel {
  margin-bottom: 16px;
}

.topbar {
  display: grid;
  gap: 12px;
  padding-bottom: 2px;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.app-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.app-logo-mark {
  position: relative;
  width: 58px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.app-logo-mark img {
  width: 56px;
  height: 56px;
  display: block;
  object-fit: contain;
  transition: transform 180ms ease;
}

.app-logo:hover .app-logo-mark img,
.app-logo:focus-visible .app-logo-mark img {
  transform: scale(1.08);
}

.app-logo-text {
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.site-nav a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}

.site-nav a[aria-current="page"] {
  background: #0f1318;
  color: var(--text);
}

.page-title {
  display: grid;
  gap: 2px;
}

.eyebrow,
#selectedMeta,
#congressSelectedMeta {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1;
}

h2 {
  margin-bottom: 0;
  font-size: 1rem;
}

.status-pill {
  min-width: 108px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  text-align: center;
}

.status-pill.success,
.positive {
  color: var(--accent);
}

.status-pill.error,
.negative {
  color: var(--danger);
}

.control-panel {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 10px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.field {
  display: grid;
  gap: 6px;
}

label {
  color: var(--muted);
  font-size: 0.78rem;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f1318;
  color: var(--text);
  padding: 0 11px;
}

button,
.chart-header a {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #06120e;
  padding: 0 14px;
  font-weight: 750;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

button.secondary,
.chart-header a {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}

.icon-button {
  width: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.congress-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.congress-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
  margin-bottom: 16px;
}

.watchlist,
.chart-area,
.log-panel,
.congress-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.watchlist {
  min-height: 590px;
  padding: 14px;
}

.congress-watchlist {
  overflow: visible;
}

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

.watchlist-tools {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
}

.congress-tools {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.search-field,
.sort-field,
.market-field {
  display: grid;
  gap: 4px;
}

.search-field {
  min-width: 170px;
  flex: 1 1 170px;
}

.sort-field {
  min-width: 150px;
  flex: 0 1 170px;
}

.market-field {
  min-width: 126px;
  flex: 0 1 140px;
}

.search-field span,
.sort-field span,
.market-field span {
  color: var(--muted);
  font-size: 0.72rem;
}

.search-field input,
.sort-field select,
.market-field select {
  min-height: 36px;
  font-size: 0.84rem;
  padding: 0 8px;
}

.panel-note {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.watch-item {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  cursor: pointer;
}

.watch-item:hover {
  border-color: rgba(32, 201, 151, 0.55);
}

.watch-item.active {
  border-color: var(--accent);
}

.metric-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.metric-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 6px;
  border: 1px solid rgba(154, 166, 178, 0.22);
  border-radius: 5px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.7rem;
  font-weight: 800;
}

.metric-badge.positive {
  border-color: rgba(32, 201, 151, 0.28);
  color: var(--accent);
}

.metric-badge.negative {
  border-color: rgba(255, 107, 107, 0.32);
  color: var(--danger);
}

.metric-badge.hot {
  border-color: rgba(255, 211, 105, 0.38);
  color: var(--warning);
}

.symbol {
  margin: 0;
  font-weight: 800;
}

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

.instrument-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: #11161c;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.instrument-badge.crypto {
  border-color: rgba(32, 201, 151, 0.42);
  color: var(--accent);
}

.instrument-badge.congress-purchase {
  border-color: rgba(32, 201, 151, 0.55);
  color: var(--accent);
  background: rgba(32, 201, 151, 0.1);
}

.instrument-badge.congress-sale {
  border-color: rgba(255, 107, 107, 0.55);
  color: var(--danger);
  background: rgba(255, 107, 107, 0.1);
}

.instrument-badge.etf,
.instrument-badge.derivative {
  border-color: rgba(255, 209, 102, 0.42);
  color: var(--warning);
}

.subline {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.session-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #11161c;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.session-badge.open {
  border-color: rgba(32, 201, 151, 0.5);
  color: var(--accent);
}

.session-badge.closed {
  border-color: rgba(255, 107, 107, 0.5);
  color: var(--danger);
}

.session-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.session-badge.open .session-dot {
  box-shadow: 0 0 0 0 rgba(32, 201, 151, 0.75);
  animation: pulse-open 1.4s infinite;
}

.session-badge.closed .session-dot {
  width: 10px;
  height: 10px;
  box-shadow: 0 0 10px rgba(255, 107, 107, 0.22);
}

@keyframes pulse-open {
  0% {
    box-shadow: 0 0 0 0 rgba(32, 201, 151, 0.75);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(32, 201, 151, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(32, 201, 151, 0);
  }
}

.rsi {
  text-align: right;
  font-weight: 850;
  font-size: 1.4rem;
}

.watch-metrics {
  display: grid;
  justify-items: end;
  align-items: center;
}

.entry {
  color: var(--danger);
}

.neutral {
  color: var(--accent);
}

.loading {
  color: var(--warning);
}

.remove-button {
  grid-column: 1 / -1;
  min-height: 32px;
  justify-self: start;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 0 10px;
}

.chart-area {
  min-height: 590px;
  padding: 14px;
}

#tradingviewWidget {
  width: 100%;
  height: 640px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b0e11;
}

.fallback-chart {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
}

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

.fallback-chart-header div {
  display: grid;
  gap: 3px;
}

.fallback-chart-header span,
.fallback-chart p {
  color: var(--muted);
  font-size: 0.84rem;
}

#fallbackChartCanvas {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.opinion-panel {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11161c;
}

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

.opinion-heading h2,
.opinion-body h3 {
  margin-bottom: 4px;
}

#opinionMeta,
.opinion-note,
.news-list span {
  color: var(--muted);
  font-size: 0.84rem;
}

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

.asset-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.asset-links-title {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.asset-links a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f1318;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.asset-links a:hover {
  border-color: rgba(32, 201, 151, 0.55);
}

.opinion-body p,
.opinion-body ul {
  margin: 0;
  color: var(--text);
  line-height: 1.45;
}

.opinion-body ul {
  padding-left: 18px;
}

.news-list {
  display: grid;
  gap: 7px;
}

.news-list li {
  display: grid;
  gap: 2px;
}

.news-list a {
  color: var(--text);
  text-decoration-color: rgba(32, 201, 151, 0.55);
}

.log-panel {
  padding: 14px;
}

.alert-log {
  display: grid;
  gap: 8px;
  min-height: 64px;
}

.log-entry {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.summary-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

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

#summaryMeta,
#watchlistMeta,
#watchlistMetaBottom,
#congressTransactionsMeta,
#congressFilingsMeta,
#congressSummaryMeta,
#congressFixedIncomeMeta {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.countdown {
  margin: 5px 0 0;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 800;
}

.watchlist-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.pager {
  display: flex;
  gap: 8px;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.action-link:hover,
.action-link:focus-visible {
  border-color: var(--accent);
}

.summary-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.summary-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  background: #11161c;
}

.fixed-income-table {
  min-width: 1040px;
}

.summary-table th,
.summary-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.summary-table tbody tr {
  cursor: pointer;
}

.summary-table tbody tr:hover td,
.summary-table tbody tr:focus-visible td {
  background: rgba(255, 255, 255, 0.025);
}

.summary-table tbody tr.active td {
  background: rgba(65, 214, 169, 0.055);
  box-shadow:
    inset 0 1px 0 var(--accent),
    inset 0 -1px 0 var(--accent);
}

.summary-table tbody tr.active td:first-child {
  box-shadow:
    inset 1px 0 0 var(--accent),
    inset 0 1px 0 var(--accent),
    inset 0 -1px 0 var(--accent);
  border-radius: 8px 0 0 8px;
}

.summary-table tbody tr.active td:last-child {
  box-shadow:
    inset -1px 0 0 var(--accent),
    inset 0 1px 0 var(--accent),
    inset 0 -1px 0 var(--accent);
  border-radius: 0 8px 8px 0;
}

.summary-table th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.summary-table td:first-child {
  display: grid;
  gap: 2px;
}

.summary-table td:first-child span {
  color: var(--muted);
  font-size: 0.78rem;
}

.summary-symbol-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
}

.summary-flag {
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1;
}

.summary-table .metric-strip {
  margin-top: 4px;
}

.summary-table .metric-badge {
  font-size: 0.68rem;
}

.summary-table .metric-badge.positive {
  color: var(--accent);
}

.summary-table .metric-badge.negative {
  color: var(--danger);
}

.summary-table .metric-badge.hot {
  color: var(--warning);
}

.summary-symbol-button {
  width: fit-content;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
  text-align: left;
}

.summary-symbol-button:hover,
.summary-symbol-button:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

.summary-table tr:last-child td {
  border-bottom: 0;
}

.congress-shell .summary-table {
  min-width: 0;
}

.congress-shell .summary-table td {
  white-space: normal;
}

.congress-shell .summary-table td:first-child {
  min-width: 140px;
}

.congress-shell .summary-table td:first-child span {
  display: -webkit-box;
  max-width: 520px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.gain {
  color: var(--accent);
  font-weight: 800;
}

.loss {
  color: var(--danger);
  font-weight: 800;
}

.empty-cell {
  color: var(--muted);
  text-align: center;
}

.empty {
  color: var(--muted);
}

.congress-list,
.filing-list {
  display: grid;
  gap: 10px;
}

.congress-card,
.filing-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.congress-card {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.congress-card > div:first-child,
.congress-card > div,
.filing-row div {
  min-width: 0;
  max-width: 100%;
}

.congress-card .symbol,
.congress-card .subline,
.filing-row strong,
.filing-row span {
  overflow-wrap: anywhere;
}

.congress-card .subline {
  display: -webkit-box;
  max-width: 100%;
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--muted);
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.congress-card.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(32, 201, 151, 0.45);
}

.fixed-income-card {
  cursor: default;
}

.congress-card-meta,
.filing-row div {
  display: grid;
  gap: 4px;
}

.congress-card-meta {
  min-width: 150px;
  justify-items: end;
  text-align: right;
  color: var(--muted);
}

.congress-card-meta a,
.filing-row a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.filing-row span {
  color: var(--muted);
  font-size: 0.84rem;
}

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

.congress-info-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.congress-info-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.congress-info-main strong,
.congress-info-main span,
.congress-info-main p {
  overflow-wrap: anywhere;
}

.congress-info-main strong {
  display: block;
  line-height: 1.25;
}

.congress-info-main span,
.congress-info-main p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.congress-info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
}

.congress-info-grid.fixed-income-grid {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}

.congress-info-grid div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #141920;
}

.congress-info-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.congress-info-grid strong {
  display: block;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.congress-info-grid a {
  color: var(--accent);
  text-decoration: none;
}

#congressTradingviewWidget {
  width: 100%;
  height: 560px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b0e11;
}

.congress-member-panel {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.congress-member-detail {
  display: grid;
  gap: 14px;
}

.member-profile {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.member-profile img,
.member-initials {
  width: 82px;
  height: 98px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: #0f1318;
}

.member-initials {
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 1.35rem;
  font-weight: 900;
}

.member-profile h3,
.congress-news h3 {
  margin: 0 0 4px;
}

.member-profile p,
.congress-detail-grid span {
  margin: 0;
  color: var(--muted);
}

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

.congress-detail-grid div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #141920;
}

.congress-detail-grid strong {
  display: block;
  margin-top: 4px;
}

.congress-detail-grid a {
  color: var(--accent);
  text-decoration: none;
}

.congress-news {
  display: grid;
  gap: 8px;
}

@media (max-width: 980px) {
  .control-panel,
  .workspace,
  .congress-workspace,
  .congress-layout {
    grid-template-columns: 1fr;
  }

  .compact {
    min-width: 0;
  }

  .product-grid,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .congress-info-grid,
  .congress-info-grid.fixed-income-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .app-shell {
    padding: 14px;
  }

  .home-hero,
  .home-section {
    padding: 16px;
  }

  .home-hero {
    min-height: 500px;
  }

  .home-hero h1 {
    font-size: 2rem;
    line-height: 1.05;
  }

  .market-creature {
    width: 72vw;
    bottom: 40px;
    opacity: 0.14;
  }

  .market-creature.bear {
    left: -38vw;
  }

  .market-creature.bull {
    right: -38vw;
  }

  .hero-chart-line {
    inset: 120px 2% 140px;
    opacity: 0.62;
  }

  .topbar,
  .panel-heading,
  .chart-header,
  .summary-heading,
  .congress-tools,
  .congress-card,
  .filing-row,
  .log-entry {
    align-items: flex-start;
    flex-direction: column;
  }

  .congress-card-meta {
    justify-items: start;
    text-align: left;
  }

  .site-footer {
    align-items: start;
  }

  .congress-info-main,
  .congress-info-grid,
  .congress-info-grid.fixed-income-grid {
    grid-template-columns: 1fr;
  }

  .watchlist-tools,
  .congress-tools,
  .search-field,
  .sort-field,
  .market-field,
  .opinion-grid {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .member-profile,
  .congress-detail-grid {
    grid-template-columns: 1fr;
  }

  #tradingviewWidget {
    height: 440px;
  }

  #congressTradingviewWidget {
    height: 440px;
  }
}
