:root {
  color-scheme: light;
  --bg: #fbfbfa;
  --paper: #ffffff;
  --surface: rgba(255, 255, 255, 0.82);
  --ink: #181818;
  --muted: #707070;
  --soft: #979797;
  --line: #d8d8d8;
  --line-soft: #ececec;
  --accent: #111111;
  --accent-soft: #f3f3f3;
  --blush: #f6dfdc;
  --blush-soft: #fff4f2;
  --tile: rgba(255, 249, 248, 0.78);
  --danger: #d70015;
  --green: #248a3d;
  --orange: #bf5b00;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.06);
  --font-ui: "Inter", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Segoe UI", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", "Songti SC", "SimSun", serif;
  --qp-card-radius: 34px;
  --qp-inner-radius: 24px;
  --qp-glass-surface:
    radial-gradient(circle at 88% 0%, rgba(168, 85, 247, 0.16), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.115), rgba(255, 255, 255, 0.052)),
    rgba(18, 18, 24, 0.78);
  --qp-glass-border: rgba(255, 255, 255, 0.16);
  --qp-glass-shadow: 0 24px 74px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 8%, rgba(0, 0, 0, 0.035), transparent 27%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(251, 251, 250, 0) 420px);
  pointer-events: none;
}

button,
textarea {
  font: inherit;
}

.page {
  width: min(1380px, calc(100% - 42px));
  margin: 0 auto;
  padding: 0 0 72px;
}

.topbar,
.flow-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar {
  background: rgba(251, 251, 250, 0.78);
  min-height: 78px;
  padding: 16px 0 8px;
  position: relative;
  top: 0;
  z-index: 10;
  animation: pageIn 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.brand strong,
.brand span,
.env span {
  display: block;
}

.brand span,
.env {
  color: var(--muted);
  font-size: 12px;
}

.brand strong {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.brand span {
  font-size: 11px;
  margin-left: 3px;
}

.site-nav {
  align-items: center;
  display: flex;
  gap: 30px;
  left: 50%;
  position: absolute;
  top: 25px;
  transform: translateX(-50%);
}

.site-nav a {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
  transition: color 180ms ease, transform 180ms ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--ink);
}

.site-nav a:hover {
  transform: translateY(-1px);
}

.env {
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: right;
}

.env span {
  border-radius: 999px;
  background: transparent;
  padding: 4px 0;
}

.topbar .env span {
  display: none;
}

.journey-btn,
.hero-cta,
.ghost-cta {
  background: #111111;
  border: 1px solid #111111;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  color: #ffffff;
  cursor: pointer;
  font-weight: 650;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.ghost-cta {
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--line-soft);
  box-shadow: none;
  color: var(--ink);
}

.journey-btn {
  min-height: 34px;
  padding: 0 18px;
}

.hero-cta,
.ghost-cta {
  font-size: 14px;
  min-height: 48px;
  padding: 0 34px;
}

.journey-btn:hover,
.hero-cta:hover,
.ghost-cta:hover {
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.ghost-cta:hover {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.journey-btn:active,
.hero-cta:active,
.ghost-cta:active {
  transform: translateY(0) scale(0.98);
}

.hero {
  min-height: 650px;
  padding: 34px 0 0;
  position: relative;
  text-align: center;
}

.hero-copy {
  animation: heroRise 760ms 90ms cubic-bezier(0.16, 1, 0.3, 1) both;
  margin: 0 auto;
  position: relative;
  width: min(680px, 100%);
  z-index: 4;
}

.hero h1 {
  font-family: Georgia, "Times New Roman", "Songti SC", "STSong", serif;
  font-size: clamp(58px, 7.7vw, 118px);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.94;
  margin: 0 auto;
  max-width: 760px;
  text-shadow: 0 16px 38px rgba(0, 0, 0, 0.08);
}

.hero p {
  color: #686868;
  font-size: 15px;
  line-height: 1.7;
  margin: 28px auto 25px;
  max-width: 540px;
}

.quant-visual {
  height: 470px;
  inset: 205px 0 auto;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.dot-field {
  --dot: rgba(20, 20, 20, 0.78);
  animation: dotDrift 8s ease-in-out infinite;
  background-image: radial-gradient(circle, var(--dot) 1.05px, transparent 1.25px);
  background-size: 8px 8px;
  filter: contrast(1.08);
  height: 350px;
  opacity: 0.72;
  position: absolute;
  top: 42px;
  width: min(46vw, 590px);
}

.dot-field::after {
  background:
    radial-gradient(circle at 55% 48%, transparent 0 24%, rgba(251, 251, 250, 0.88) 25% 34%, transparent 35%),
    linear-gradient(90deg, rgba(251, 251, 250, 0.96), transparent 22%, transparent 78%, rgba(251, 251, 250, 0.98));
  content: "";
  inset: -3px;
  position: absolute;
}

.dot-field-left {
  border-radius: 44% 48% 54% 42%;
  clip-path: polygon(0 20%, 22% 0, 58% 9%, 100% 43%, 88% 62%, 58% 57%, 66% 100%, 35% 83%, 23% 55%, 0 50%);
  left: -18px;
}

.dot-field-right {
  animation-delay: -1.8s;
  border-radius: 48% 42% 46% 54%;
  clip-path: polygon(18% 18%, 52% 8%, 98% 17%, 100% 56%, 72% 58%, 57% 88%, 42% 60%, 0 66%, 13% 42%);
  right: -12px;
}

.signal-arc {
  border: 1px dotted rgba(0, 0, 0, 0.42);
  border-color: rgba(0, 0, 0, 0.42) transparent transparent transparent;
  border-radius: 50%;
  height: 260px;
  left: 50%;
  opacity: 0.42;
  position: absolute;
  top: 116px;
  transform: translateX(-50%) rotate(7deg);
  width: 540px;
}

.arc-two {
  animation: arcTrace 5.8s ease-in-out infinite;
  border-top-color: rgba(0, 0, 0, 0.28);
  top: 166px;
  transform: translateX(-50%) rotate(-11deg);
  width: 410px;
}

.quant-core {
  animation: coreFloat 7s ease-in-out infinite;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 50%;
  height: 230px;
  left: 50%;
  position: absolute;
  top: 174px;
  transform: translateX(-50%);
  width: 230px;
}

.quant-core::before,
.quant-core::after {
  border: 1px solid rgba(0, 0, 0, 0.11);
  border-radius: 50%;
  content: "";
  inset: 34px;
  position: absolute;
}

.quant-core::after {
  background: radial-gradient(circle, rgba(0, 0, 0, 0.68) 0 3px, transparent 4px);
  box-shadow: 0 0 0 10px rgba(0, 0, 0, 0.035);
  inset: 78px;
}

.node {
  background: rgba(251, 251, 250, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 999px;
  color: #222222;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 9px;
  position: absolute;
}

.node.alpha {
  left: 20px;
  top: 45px;
}

.node.risk {
  right: 12px;
  top: 60px;
}

.node.data {
  bottom: 45px;
  left: 34px;
}

.node.pm {
  bottom: 36px;
  right: 35px;
}

.price-path {
  background:
    linear-gradient(135deg, transparent 0 22%, rgba(0, 0, 0, 0.42) 23% 25%, transparent 26% 42%, rgba(0, 0, 0, 0.42) 43% 45%, transparent 46% 62%, rgba(0, 0, 0, 0.42) 63% 65%, transparent 66%);
  display: block;
  height: 88px;
  left: 50%;
  position: absolute;
  top: 73px;
  transform: translateX(-50%);
  width: 128px;
}

.method-panel {
  animation: panelIn 720ms 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  margin: -18px auto 0;
  padding: 44px 46px;
  position: relative;
  width: min(1030px, 100% - 120px);
  z-index: 5;
}

.method-intro {
  align-items: end;
  display: grid;
  gap: 80px;
  grid-template-columns: 0.9fr 1.1fr;
}

.method-intro span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.24em;
  margin-bottom: 22px;
}

.method-intro h2 {
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(32px, 3.3vw, 46px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.method-intro p {
  font-size: 14px;
  line-height: 1.85;
  max-width: 460px;
}

.cache-maintenance {
  align-items: center;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-top: 30px;
  padding: 10px 10px 10px 18px;
}

.cache-maintenance div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.cache-maintenance strong {
  font-size: 12px;
  letter-spacing: 0;
}

.cache-maintenance span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cache-update-btn {
  background: #111111;
  border: 1px solid #111111;
  border-radius: 999px;
  color: #ffffff;
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 650;
  min-height: 34px;
  padding: 0 16px;
  transition: opacity 180ms ease, transform 180ms ease;
}

.cache-update-btn:hover {
  transform: translateY(-1px);
}

.cache-update-btn:active {
  transform: translateY(0) scale(0.98);
}

.cache-update-btn:disabled {
  cursor: wait;
  opacity: 0.55;
  transform: none;
}

.method-grid {
  border-top: 1px solid var(--line-soft);
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 38px;
  padding-top: 26px;
}

.method-grid article {
  background: rgba(248, 248, 248, 0.76);
  min-height: 122px;
  padding: 22px 24px;
  position: relative;
  transition: background 180ms ease, transform 180ms ease;
}

.method-grid article:hover {
  background: #ffffff;
  transform: translateY(-2px);
}

.method-grid article::after {
  content: "→";
  position: absolute;
  right: 22px;
  top: 20px;
}

.method-grid span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-bottom: 14px;
}

.method-grid strong {
  display: block;
  font-size: 14px;
  margin-bottom: 12px;
}

.method-grid p {
  font-size: 12px;
  line-height: 1.65;
}

.composer {
  padding: 74px 0 30px;
}

.lab-section {
  scroll-margin-top: 28px;
}

.composer-grid {
  align-items: end;
  display: grid;
  gap: 42px;
  grid-template-columns: minmax(320px, 0.9fr) minmax(440px, 1.1fr);
  min-height: 410px;
}

.composer-copy {
  animation: pageIn 620ms 80ms cubic-bezier(0.16, 1, 0.3, 1) both;
  padding-bottom: 12px;
}

.intro-label {
  color: var(--accent);
  display: inline-block;
  font-size: 13px;
  font-weight: 720;
  margin-bottom: 18px;
}

.composer-copy p {
  max-width: 620px;
  margin-top: 16px;
}

.research-summary {
  border-top: 1px solid var(--line-soft);
  display: grid;
  gap: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 36px;
  max-width: 620px;
}

.research-summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  padding: 14px 14px 0 0;
}

.input-surface {
  animation: panelIn 680ms 160ms cubic-bezier(0.16, 1, 0.3, 1) both;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(210, 210, 215, 0.72);
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.08);
  padding: 18px;
}

.input-toolbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 0 2px 14px;
}

.input-toolbar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(40px, 4.4vw, 58px);
  font-weight: 780;
  line-height: 1.08;
  max-width: 680px;
}

h2 {
  font-size: 25px;
  font-weight: 720;
  line-height: 1.3;
  margin-top: 4px;
}

h3 {
  font-size: 20px;
}

p {
  color: var(--muted);
  line-height: 1.72;
}

.primary,
.chip {
  min-height: 38px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--paper);
  color: var(--ink);
  padding: 0 16px;
  cursor: pointer;
  position: relative;
  transition: background 220ms ease, border-color 220ms ease, color 220ms ease, transform 220ms ease, box-shadow 220ms ease;
}

.primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  font-weight: 700;
  min-width: 116px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.primary:hover,
.chip:hover {
  transform: translateY(-1px);
}

.primary:active,
.chip:active {
  transform: translateY(0) scale(0.98);
}

.primary:disabled {
  opacity: 0.65;
  cursor: wait;
  box-shadow: none;
}

.primary.loading::after {
  animation: buttonScan 1.2s linear infinite;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  content: "";
  inset: 0;
  position: absolute;
  transform: translateX(-100%);
}

.intensity-row {
  align-items: center;
  background: #f5f5f7;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  padding: 10px;
}

.intensity-row > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-right: 2px;
}

.intensity-row label {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 2px 8px;
  grid-template-columns: 18px auto;
  min-width: 142px;
  padding: 8px 10px;
  border-radius: 11px;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.intensity-row label:has(input:checked) {
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.06);
}

.intensity-row input {
  accent-color: var(--accent);
  grid-row: span 2;
}

.intensity-row strong {
  font-size: 14px;
}

.intensity-row small {
  color: var(--muted);
  font-size: 12px;
}

textarea {
  width: 100%;
  min-height: 148px;
  margin-top: 0;
  resize: vertical;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  outline: none;
  padding: 20px 22px;
  line-height: 1.65;
  box-shadow: none;
}

textarea:focus {
  border-color: rgba(0, 0, 0, 0.32);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.08);
}

.quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip {
  min-height: 34px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.74);
  border-color: var(--line-soft);
}

.library-section {
  display: none;
  padding-top: 20px;
}

body.library-view .hero,
body.library-view .method-panel,
body.library-view .composer,
body.library-view .flow-shell {
  display: none;
}

body.library-view .library-section {
  animation: pageIn 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
  display: block;
}

.library-hero {
  min-height: 560px;
  overflow: hidden;
  padding-top: 64px;
  position: relative;
  text-align: center;
}

.library-hero-copy {
  margin: 0 auto;
  position: relative;
  width: min(760px, 100%);
  z-index: 4;
}

.library-hero h1 {
  font-family: Georgia, "Times New Roman", "Songti SC", "STSong", serif;
  font-size: clamp(64px, 8vw, 126px);
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 0.94;
  margin: 0 auto;
  max-width: 860px;
  text-shadow: 0 16px 38px rgba(0, 0, 0, 0.08);
}

.library-hero p {
  color: #686868;
  font-size: 15px;
  line-height: 1.75;
  margin: 28px auto 24px;
  max-width: 620px;
}

.library-hero-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.library-visual {
  height: 370px;
  inset: 245px 0 auto;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.library-dot-left {
  height: 285px;
  left: -42px;
  opacity: 0.58;
  top: 32px;
  width: min(43vw, 560px);
}

.library-dot-right {
  height: 300px;
  opacity: 0.62;
  right: -52px;
  top: 20px;
  width: min(44vw, 590px);
}

.library-arc-one {
  top: 112px;
  width: 620px;
}

.library-arc-two {
  top: 166px;
  width: 450px;
}

.compare-core {
  animation: coreFloat 7s ease-in-out infinite;
  height: 236px;
  left: 50%;
  position: absolute;
  top: 92px;
  transform: translateX(-50%);
  width: 236px;
}

.compare-ring {
  border: 1px solid rgba(0, 0, 0, 0.13);
  border-radius: 50%;
  position: absolute;
}

.ring-one {
  inset: 0;
}

.ring-two {
  inset: 45px;
}

.compare-core::after {
  background: radial-gradient(circle, rgba(0, 0, 0, 0.72) 0 4px, transparent 5px);
  content: "";
  inset: 101px;
  position: absolute;
}

.compare-line {
  background: rgba(0, 0, 0, 0.42);
  border-radius: 999px;
  height: 3px;
  left: 58px;
  position: absolute;
  transform-origin: left center;
  width: 132px;
}

.line-one {
  top: 86px;
  transform: rotate(-22deg);
}

.line-two {
  top: 125px;
  transform: rotate(-38deg);
}

.line-three {
  top: 158px;
  transform: rotate(-12deg);
}

.library-controlbar {
  align-items: end;
  border-top: 1px solid var(--line-soft);
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 20px;
  padding-top: 28px;
}

.library-controlbar h2 {
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(34px, 4.2vw, 58px);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 1.02;
  margin: 10px 0 0;
}

.library-actions {
  align-items: center;
  background: #f5f5f7;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  display: flex;
  gap: 4px;
  padding: 5px;
}

.library-filter {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 680;
  min-height: 32px;
  padding: 0 14px;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.library-filter.active {
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.06);
  color: var(--ink);
}

.library-stats,
.library-compare-metrics,
.library-metrics {
  display: grid;
  gap: 10px;
}

.library-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.library-stats div,
.library-compare-metrics div,
.library-metrics div {
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(0, 0, 0, 0.052);
  border-radius: 18px;
  padding: 14px 16px;
}

.library-stats span,
.library-compare-metrics span,
.library-compare-metrics small,
.library-metrics span,
.strategy-card small,
.strategy-card-main span,
.library-holdings span,
.strategy-compare-empty span,
.library-empty span {
  color: var(--muted);
  font-size: 12px;
}

.library-stats strong,
.library-compare-metrics strong,
.library-metrics strong {
  display: block;
  font-size: 22px;
  font-weight: 720;
  margin-top: 5px;
}

.strategy-compare-shell {
  margin-bottom: 18px;
}

.strategy-compare,
.strategy-compare-empty,
.library-empty {
  animation: softAppear 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.035);
  display: grid;
  gap: 14px;
  padding: 18px;
}

.strategy-compare-empty strong,
.library-empty strong {
  font-size: 18px;
}

.strategy-compare-empty p,
.library-empty p {
  font-size: 13px;
  margin: 0;
}

.library-compare-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.strategy-card {
  animation: cardLift 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(0, 0, 0, 0.052);
  border-radius: 22px;
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.04);
  display: grid;
  gap: 14px;
  overflow: hidden;
  padding: 18px;
  transition: opacity 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.strategy-card:hover {
  box-shadow: 0 26px 68px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

.strategy-card.archived {
  opacity: 0.68;
}

.strategy-card-top,
.strategy-card-main,
.strategy-card-actions {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.compare-toggle {
  align-items: center;
  background: #f5f5f7;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  gap: 7px;
  min-height: 30px;
  padding: 0 11px;
}

.compare-toggle input {
  accent-color: var(--accent);
}

.compare-toggle span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.strategy-card-main {
  align-items: flex-start;
}

.strategy-card-main h3 {
  font-size: 22px;
  line-height: 1.25;
  margin: 4px 0 8px;
}

.strategy-card-main p {
  font-size: 13px;
  margin: 0;
}

.library-pass,
.library-review {
  border-radius: 999px;
  font-size: 12px;
  padding: 7px 10px;
  white-space: nowrap;
}

.library-pass {
  background: rgba(36, 138, 61, 0.09);
  color: var(--green);
}

.library-review {
  background: rgba(191, 91, 0, 0.09);
  color: var(--orange);
}

.library-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.library-metrics div {
  border-radius: 16px;
  padding: 12px;
}

.library-metrics strong {
  font-size: 19px;
}

.library-holdings {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.library-holdings span {
  background: rgba(245, 245, 247, 0.9);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 6px 9px;
}

.library-expert-strip {
  background: rgba(245, 245, 247, 0.72);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 12px;
}

.library-expert-strip div {
  display: grid;
  gap: 3px;
}

.library-expert-strip span {
  color: var(--muted);
  font-size: 11px;
}

.library-expert-strip strong {
  font-size: 16px;
}

.library-expert-strip p {
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 12px;
  grid-column: 1 / -1;
  margin: 2px 0 0;
  padding-top: 8px;
}

.strategy-card-actions {
  border-top: 1px solid var(--line-soft);
  justify-content: flex-start;
  padding-top: 13px;
}

.strategy-card-actions button,
.strategy-editor button {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 680;
  min-height: 34px;
  padding: 0 13px;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.strategy-card-actions button:hover,
.strategy-editor button:hover {
  background: #ffffff;
  transform: translateY(-1px);
}

.strategy-card-actions .danger-action {
  color: var(--danger);
}

.strategy-editor {
  background: rgba(245, 245, 247, 0.82);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  display: none;
  gap: 12px;
  padding: 14px;
}

.strategy-editor.open {
  display: grid;
}

.strategy-editor label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 680;
  gap: 6px;
}

.strategy-editor input,
.strategy-editor textarea {
  background: #ffffff;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  color: var(--ink);
  font: inherit;
  min-height: 40px;
  outline: none;
  padding: 10px 12px;
}

.strategy-editor textarea {
  min-height: 82px;
  resize: vertical;
}

.strategy-editor div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.flow-shell {
  padding-top: 34px;
}

.flow-head {
  color: var(--muted);
  font-size: 13px;
  border-bottom: 1px solid var(--line-soft);
  padding: 0 0 14px;
}

.flow-head span {
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 7px 12px;
}

.flow-head span:empty {
  display: none;
}

.flow {
  position: relative;
}

.live-status {
  align-items: flex-start;
  animation: softAppear 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
  background: rgba(255, 255, 255, 0.46);
  border: 1px solid rgba(210, 210, 215, 0.58);
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.035);
  display: grid;
  gap: 14px;
  grid-template-columns: 28px minmax(0, 1fr);
  margin: 18px 0 10px;
  overflow: hidden;
  padding: 16px 18px;
  position: relative;
}

.live-status::before {
  background: linear-gradient(90deg, rgba(0, 113, 227, 0.08), rgba(255, 255, 255, 0));
  content: "";
  inset: 0;
  opacity: 0.72;
  pointer-events: none;
  position: absolute;
}

.live-orb,
.live-copy {
  position: relative;
  z-index: 1;
}

.live-orb {
  display: grid;
  height: 24px;
  place-items: center;
}

.live-orb span {
  background: var(--accent);
  border-radius: 999px;
  box-shadow: 0 0 0 7px rgba(0, 113, 227, 0.08);
  display: block;
  height: 8px;
  width: 8px;
}

.live-status.active .live-orb span {
  animation: activePulse 1.4s ease-in-out infinite;
}

.live-status.done .live-orb span,
.live-status.complete .live-orb span {
  background: var(--green);
  box-shadow: 0 0 0 7px rgba(36, 138, 61, 0.08);
}

.live-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.live-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.live-meta span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 680;
}

.live-meta small {
  color: var(--soft);
  font-size: 12px;
  font-weight: 620;
}

.live-copy p {
  color: rgba(29, 29, 31, 0.72);
  font-size: 14px;
  line-height: 1.6;
  max-width: 780px;
}

.live-track {
  background: rgba(210, 210, 215, 0.5);
  border-radius: 999px;
  height: 2px;
  margin-top: 2px;
  overflow: hidden;
  width: min(420px, 100%);
}

.live-track span {
  animation: statusScan 1.55s ease-in-out infinite;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  border-radius: inherit;
  display: block;
  height: 100%;
  transform: translateX(-65%);
  width: 45%;
}

.live-status.done .live-track span,
.live-status.complete .live-track span {
  animation: none;
  background: var(--green);
  transform: none;
  width: 100%;
}

.live-history {
  display: grid;
  gap: 4px;
  margin-top: 2px;
}

.live-history div {
  color: var(--soft);
  font-size: 12px;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  align-items: start;
  border-bottom: 1px solid var(--line-soft);
  display: grid;
  gap: 10px;
  min-height: 220px;
  padding: 64px clamp(24px, 3.8vw, 56px);
}

.empty-state h2 {
  margin-bottom: 8px;
}

.flow-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(168px, 218px) minmax(0, 1fr);
}

.flow-nav {
  align-self: start;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 4px 8px 0 22px;
  position: sticky;
  top: 92px;
}

.flow-nav-head {
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  display: grid;
  gap: 2px;
  margin-bottom: 14px;
  padding: 0 0 13px;
}

.flow-nav-head span {
  color: rgba(230, 220, 255, 0.56);
  font-size: 13px;
  font-weight: 700;
}

.flow-nav-head strong {
  color: rgba(255, 255, 255, 0.86);
  font-size: 16px;
  font-weight: 820;
}

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

.flow-nav-list button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: rgba(246, 241, 255, 0.76);
  cursor: pointer;
  display: grid;
  gap: 0 12px;
  grid-template-columns: 22px minmax(0, 1fr);
  min-height: 36px;
  padding: 4px 8px 4px 0;
  text-align: left;
}

.flow-nav-list button:hover {
  background: rgba(184, 132, 255, 0.07);
  color: rgba(255, 255, 255, 0.86);
}

.flow-nav-list button span {
  align-self: start;
  color: rgba(194, 151, 255, 0.78);
  font-size: 0;
  font-weight: 800;
  grid-row: span 2;
  height: 10px;
  justify-self: center;
  margin-top: 8px;
  width: 10px;
}

.flow-nav-list button span::before {
  background: currentColor;
  border-radius: 999px;
  content: "";
  display: block;
  height: 10px;
  width: 10px;
}

.flow-nav-list button strong {
  color: rgba(255, 255, 255, 0.84);
  font-size: 16px;
  font-weight: 840;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-nav-list button small {
  display: none;
}

.flow-nav-list button.error span,
.flow-nav-list button.error strong {
  color: #ff8fa8;
}

.flow-nav-empty {
  cursor: default;
  display: block;
  min-height: 38px;
  opacity: 0.64;
  overflow: hidden;
  padding: 10px 12px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-step {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 18px;
  margin: 22px 0;
  padding: 0;
  animation: rise 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.rail {
  position: relative;
  display: flex;
  justify-content: center;
}

.rail::after {
  display: none;
}

.flow-step:last-child .rail::after {
  display: none;
}

.rail span {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  margin-top: 28px;
  border-radius: 999px;
  border: 0;
  background: #111111;
  box-shadow: 0 0 0 10px rgba(17, 17, 17, 0.04);
}

.flow-step.active .rail span {
  background: #111111;
  box-shadow: 0 0 0 10px rgba(17, 17, 17, 0.07);
  animation: activePulse 1.4s ease-in-out infinite;
}

.flow-step.done .rail span {
  background: var(--accent);
}

.flow-step.selected .rail span {
  background: var(--green);
}

.flow-step.error .rail span {
  background: var(--danger);
}

.step-content {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 244, 242, 0.68)),
    var(--paper);
  border: 1px solid rgba(0, 0, 0, 0.055);
  border-radius: 28px;
  box-shadow: 0 24px 70px rgba(25, 22, 20, 0.055);
  min-width: 0;
  overflow: hidden;
  padding: 24px 28px 28px;
  position: relative;
}

.step-content::before {
  background:
    radial-gradient(circle at 10% 0, rgba(246, 223, 220, 0.58), transparent 34%),
    radial-gradient(circle at 95% 10%, rgba(255, 255, 255, 0.92), transparent 24%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.step-content > * {
  position: relative;
  z-index: 1;
}

.step-content h2 {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.32;
}

.flow-step.active .step-content {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 241, 238, 0.78)),
    var(--paper);
  border-radius: 28px;
  box-shadow: 0 28px 80px rgba(25, 22, 20, 0.075);
  margin-left: 0;
  padding: 24px 28px 28px;
}

.kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.loading-bars {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  max-width: 520px;
}

.loading-bars span {
  animation: loadingSweep 1.15s ease-in-out infinite;
  background: linear-gradient(90deg, #eeeeef 0%, #ffffff 45%, #eeeeef 100%);
  background-size: 220% 100%;
  border-radius: 999px;
  display: block;
  height: 10px;
}

.loading-bars span:nth-child(2) {
  animation-delay: 110ms;
  width: 78%;
}

.loading-bars span:nth-child(3) {
  animation-delay: 220ms;
  width: 54%;
}

.strategy-lines,
.metrics-strip,
.allocation-summary,
.pm-agent,
.holding-list,
.rebalance-block,
.regime-list,
.debate,
.judge,
.candidate-lines,
.selected-result,
.chart-stack,
details {
  margin-top: 18px;
}

.strategy-lines {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-left: 0;
}

.strategy-lines > div {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(0, 0, 0, 0.055);
  border-radius: 22px;
  min-height: 138px;
  padding: 18px 18px 20px;
}

.strategy-lines span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.industry-search-path {
  background: rgba(8, 8, 14, 0.46);
  border: 1px solid rgba(192, 132, 252, 0.22);
  border-radius: 14px;
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
}

.industry-search-path strong {
  color: var(--text);
  font-size: 13px;
}

.industry-search-path p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.industry-search-path div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.industry-search-path span {
  background: rgba(168, 85, 247, 0.13);
  border: 1px solid rgba(192, 132, 252, 0.20);
  border-radius: 999px;
  color: var(--text);
  font-size: 12px;
  margin: 0;
  padding: 6px 9px;
}

ul {
  margin: 0;
  padding-left: 18px;
  line-height: 1.8;
}

details summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 700;
}

pre {
  max-height: 260px;
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  line-height: 1.5;
  font-size: 12px;
}

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

.metrics-strip div {
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(0, 0, 0, 0.052);
  border-radius: 20px;
  min-height: 78px;
  padding: 14px 16px;
}

.metrics-strip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metrics-strip strong {
  display: block;
  margin-top: 6px;
  font-size: 23px;
  font-weight: 720;
}

.metrics-strip.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.risk-audit {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding: 16px;
}

.integrity-report,
.oos-report,
.position-review {
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding: 16px;
}

.audit-section-head {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.audit-section-head span,
.risk-stress span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.audit-section-head strong {
  font-size: 16px;
}

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

.risk-checks div,
.integrity-check {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(0, 0, 0, 0.052);
  border-radius: 18px;
  display: grid;
  gap: 5px;
  min-height: 78px;
  padding: 12px;
}

.risk-checks span,
.risk-checks small,
.risk-stress li,
.integrity-check span,
.integrity-check small,
.audit-note {
  color: var(--muted);
  font-size: 12px;
}

.risk-checks strong,
.integrity-check strong {
  color: var(--green);
  font-size: 15px;
}

.risk-checks .failed strong,
.integrity-check.fail strong {
  color: var(--danger);
}

.risk-checks .excluded strong,
.integrity-check.warning strong {
  color: var(--accent);
}

.risk-checks.slim {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.audit-note {
  line-height: 1.65;
  margin: 0;
}

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

.oos-grid div {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(0, 0, 0, 0.052);
  border-radius: 18px;
  padding: 14px;
}

.oos-grid span,
.oos-grid small {
  color: var(--muted);
  display: block;
  font-size: 12px;
}

.oos-grid strong {
  display: block;
  font-size: 24px;
  margin: 5px 0 2px;
}

.risk-stress {
  display: grid;
  gap: 8px;
}

.risk-stress ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
}

.chart-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 34px;
}

.chart-stack > div {
  border-top: 1px solid var(--line-soft);
  padding-top: 18px;
}

.chart-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
  padding-left: 2px;
}

svg {
  width: 100%;
  height: auto;
  display: block;
  background: var(--paper);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px var(--line-soft), 0 18px 46px rgba(0, 0, 0, 0.045);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

svg text {
  letter-spacing: 0;
}

svg.dragging {
  cursor: grabbing;
}

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

.position-review-lines {
  display: grid;
  gap: 10px;
}

.position-review-line {
  align-items: center;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(0, 0, 0, 0.052);
  border-radius: 18px;
  display: grid;
  gap: 12px;
  grid-template-columns: 160px 86px minmax(0, 1fr) 220px;
  padding: 13px 15px;
}

.position-review-line span,
.position-review-line strong {
  display: block;
  font-size: 14px;
}

.position-review-line small,
.position-review-line p,
.position-review-line em {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  margin: 0;
}

.position-review-line em {
  font-style: normal;
}

.position-review-line.low strong {
  color: var(--green);
}

.position-review-line.medium strong {
  color: var(--accent);
}

.position-review-line.high strong {
  color: var(--danger);
}

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

.allocation-summary div {
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(0, 0, 0, 0.052);
  border-radius: 20px;
  padding: 14px 16px;
}

.allocation-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.allocation-summary strong {
  display: block;
  margin-top: 5px;
  font-size: 22px;
  font-weight: 720;
}

.pm-agent {
  border-left: 2px solid var(--accent);
  padding-left: 18px;
}

.pm-agent > span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-bottom: 5px;
}

.pm-agent h3 {
  margin-bottom: 12px;
}

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

.pm-votes div {
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 10px;
}

.pm-votes strong {
  display: inline-block;
  margin-right: 8px;
}

.pm-votes em {
  color: var(--accent);
  font-style: normal;
  font-weight: 700;
}

.pm-votes p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.holding-line {
  display: grid;
  grid-template-columns: 32px 110px 100px 70px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(0, 0, 0, 0.052);
  border-radius: 18px;
  min-height: 46px;
  padding: 13px 15px;
  transition: background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.holding-line:hover {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 34px rgba(25, 22, 20, 0.075);
  transform: translateY(-1px);
}

.stock-holding {
  cursor: crosshair;
  outline: none;
}

.stock-holding:focus-visible {
  box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.08), 0 16px 34px rgba(25, 22, 20, 0.075);
}

.holding-line span {
  color: var(--accent);
  font-weight: 800;
}

.holding-line em {
  color: var(--muted);
  font-style: normal;
}

.holding-line b {
  color: var(--green);
}

.cash-line b {
  color: var(--accent);
}

.rebalance-block {
  border-top: 1px solid var(--line-soft);
  padding-top: 16px;
}

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

.rebalance-lines span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-bottom: 5px;
}

.rebalance-lines p {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.65;
}

.trade-reason-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.trade-reason-list li {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.032)),
    rgba(7, 7, 10, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 14px;
  display: grid;
  gap: 5px;
  padding: 10px 12px;
}

.trade-reason-list strong {
  color: var(--ink);
  font-size: 14px;
}

.trade-reason-list b {
  color: var(--green);
  font-weight: 800;
}

.trade-reason-list small {
  color: rgba(248, 247, 255, 0.54);
  font-size: 12px;
  line-height: 1.55;
}

.holding-line small,
.muted {
  color: var(--muted);
}

.sector-rotation {
  border-top: 1px solid var(--line-soft);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  padding-top: 16px;
}

.sector-rotation span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 650;
  margin-bottom: 8px;
}

.sector-rotation ul {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.sector-rotation li {
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  padding-bottom: 8px;
}

.sector-rotation strong {
  font-size: 14px;
}

.sector-rotation li span {
  color: var(--accent);
  font-size: 13px;
  margin: 0;
}

.stock-preview {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 244, 242, 0.92)),
    var(--paper);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 30px;
  box-shadow: 0 28px 90px rgba(25, 22, 20, 0.18);
  display: grid;
  gap: 12px;
  left: 0;
  opacity: 0;
  padding: 16px;
  pointer-events: none;
  position: fixed;
  top: 0;
  transform: translateY(8px) scale(0.985);
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 1000;
}

.stock-preview.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.stock-preview-head {
  align-items: start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.stock-preview-head span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 5px;
}

.stock-preview-head strong {
  display: block;
  font-size: 20px;
  line-height: 1.1;
}

.stock-preview-head em {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-style: normal;
  margin-top: 5px;
}

.stock-preview-head b {
  background: rgba(17, 17, 17, 0.92);
  border-radius: 999px;
  color: #ffffff;
  flex: 0 0 auto;
  font-size: 12px;
  padding: 7px 10px;
}

.stock-preview-head b.up {
  background: rgba(36, 138, 61, 0.12);
  color: var(--green);
}

.stock-preview-head b.down {
  background: rgba(215, 0, 21, 0.1);
  color: var(--danger);
}

.stock-preview-chart {
  background: transparent;
  border-radius: 24px;
  box-shadow: none;
  cursor: default;
  height: auto;
  touch-action: auto;
}

.forecast-panel {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 22px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.forecast-panel > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.forecast-panel > div {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.forecast-panel p {
  background: var(--blush-soft);
  border-radius: 16px;
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px;
}

.forecast-panel strong,
.forecast-panel em,
.forecast-panel small {
  display: block;
}

.forecast-panel strong {
  font-size: 12px;
}

.forecast-panel em {
  color: var(--ink);
  font-size: 18px;
  font-style: normal;
  font-weight: 760;
}

.forecast-panel small {
  color: var(--muted);
  font-size: 10px;
}

.stock-preview-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.preview-skeleton {
  display: grid;
  gap: 10px;
  padding: 8px 0 4px;
}

.preview-skeleton span {
  animation: loadingSweep 1.15s ease-in-out infinite;
  background: linear-gradient(90deg, #eeeeef 0%, #ffffff 45%, #eeeeef 100%);
  background-size: 220% 100%;
  border-radius: 999px;
  display: block;
  height: 12px;
}

.preview-skeleton span:first-child {
  border-radius: 24px;
  height: 150px;
}

.preview-skeleton span:nth-child(3) {
  width: 68%;
}

.regime-list {
  display: grid;
  gap: 12px;
}

.regime-chart-block {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.regime-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.regime-legend span {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  gap: 6px;
}

.regime-legend span::before {
  content: "";
  display: inline-block;
  height: 10px;
  width: 22px;
}

.regime-legend .bull::before {
  background: rgba(36, 138, 61, 0.18);
}

.regime-legend .normal::before {
  background: rgba(0, 113, 227, 0.14);
}

.regime-legend .bear::before {
  background: rgba(215, 0, 21, 0.14);
}

.regime-summary {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line-soft);
  border-top: 1px solid var(--line-soft);
}

.regime-summary div {
  border-bottom: 0;
  border-right: 1px solid var(--line-soft);
  display: grid;
  gap: 4px;
  padding: 13px 14px 13px 0;
}

.regime-summary div:last-child {
  border-right: 0;
}

.regime-summary span {
  color: var(--muted);
  font-size: 12px;
}

.regime-summary strong {
  font-size: 20px;
  font-weight: 720;
}

.regime-line {
  display: grid;
  grid-template-columns: 82px minmax(180px, 1.2fr) 120px 96px minmax(0, 1fr);
  gap: 14px;
  align-items: baseline;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 12px;
}

.regime-line span {
  font-weight: 800;
}

.regime-line.bull span {
  color: var(--green);
}

.regime-line.bear span {
  color: var(--danger);
}

.regime-line.normal span {
  color: var(--accent);
}

.regime-line em {
  color: var(--ink);
  font-style: normal;
  font-weight: 700;
}

.regime-line b,
.regime-line small {
  color: var(--muted);
}

.committee-score {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(0, 0, 0, 0.055);
  border-radius: 24px;
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
  padding: 18px 20px;
}

.committee-score span {
  color: var(--muted);
  font-size: 12px;
}

.committee-score strong {
  font-size: 38px;
  font-weight: 760;
  line-height: 1;
}

.committee-score small {
  color: var(--muted);
}

.independent-experts {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 22px;
}

.independence-model {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.independence-model article {
  background: linear-gradient(135deg, rgba(169, 104, 255, 0.14), rgba(255, 255, 255, 0.035));
  border: 1px solid rgba(185, 134, 255, 0.18);
  border-radius: 18px;
  display: grid;
  gap: 7px;
  padding: 14px;
}

.independence-model span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 720;
}

.independence-model strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.independence-model small,
.independence-model p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
}

.independent-experts article {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.055);
  border-radius: 22px;
  display: grid;
  gap: 11px;
  padding: 16px;
}

.independent-experts article.review {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 244, 242, 0.54));
}

.independent-experts article > div:first-child {
  align-items: baseline;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.independent-experts span,
.expert-evidence span {
  color: var(--muted);
  font-size: 12px;
}

.independent-experts strong {
  font-size: 18px;
}

.independent-experts p {
  font-size: 13px;
  margin: 0;
}

.expert-evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.expert-evidence span {
  background: rgba(245, 245, 247, 0.88);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 5px 8px;
}

.independent-experts ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
}

.independent-experts li {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.scorecard-lines {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.score-line {
  align-items: baseline;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(0, 0, 0, 0.055);
  border-radius: 18px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 14px 16px;
}

.score-line span {
  color: var(--accent);
  font-weight: 800;
}

.score-line em {
  color: var(--ink);
  font-style: normal;
  font-weight: 800;
  justify-self: end;
}

.score-line small {
  color: var(--muted);
  grid-column: 1 / -1;
}

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

.debate > div {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.055);
  border-radius: 22px;
  padding: 18px;
}

.debate span,
.judge span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
}

.debate h3,
.judge h3 {
  margin-bottom: 10px;
}

.debate li {
  margin-bottom: 10px;
}

.debate li strong {
  margin-right: 8px;
}

.debate li span {
  color: var(--muted);
}

.risk-lines {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
  padding-top: 0;
}

.risk-lines div {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.055);
  border-radius: 20px;
  display: grid;
  gap: 4px;
  padding: 16px;
  position: relative;
}

.risk-lines div::before {
  display: none;
}

.risk-lines span {
  color: var(--muted);
  font-size: 12px;
}

.risk-lines strong {
  font-size: 15px;
}

.risk-lines small {
  color: var(--muted);
}

.llm-review,
.signal-block {
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(0, 0, 0, 0.055);
  border-radius: 22px;
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 18px;
}

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

.strategy-brief div {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(0, 0, 0, 0.055);
  border-radius: 22px;
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 20px 22px;
}

.strategy-brief span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.strategy-brief p {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.72;
  margin: 0;
}

.rag-evidence {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding-top: 0;
}

.rag-evidence.not-ready {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(0, 0, 0, 0.055);
  border-radius: 20px;
  padding: 16px;
}

.rag-review-card,
.rag-raw-list > article {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(0, 0, 0, 0.055);
  border-radius: 20px;
  display: grid;
  gap: 6px;
  padding: 16px 18px;
}

.rag-review-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 244, 242, 0.58));
  border-radius: 24px;
  gap: 14px;
  padding: 18px 20px;
}

.rag-review-head {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.rag-review-head span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 680;
  margin-bottom: 5px;
}

.rag-review-head h3 {
  font-size: 22px;
  line-height: 1.28;
  margin: 0;
}

.rag-review-head strong {
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 7px 11px;
  white-space: nowrap;
}

.rag-factor-tags,
.rag-citations,
.rag-objections ul {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.rag-factor-tags span,
.rag-citations span {
  background: rgba(245, 245, 247, 0.9);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  padding: 6px 9px;
}

.rag-objections {
  border-top: 1px solid var(--line-soft);
  display: grid;
  gap: 8px;
  padding-top: 12px;
}

.rag-objections ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rag-objections li {
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  padding: 9px 10px;
}

.rag-raw-evidence {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  padding: 12px;
}

.rag-raw-evidence summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 680;
  list-style-position: inside;
}

.rag-raw-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.rag-evidence strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
}

.rag-evidence em,
.rag-meta {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.rag-evidence p {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.65;
  margin: 0;
}

.rag-evidence code {
  background: #f5f5f7;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  color: var(--ink);
  display: inline-block;
  font-size: 13px;
  padding: 7px 9px;
  width: fit-content;
}

.rag-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.discussion-log {
  background: rgba(255, 247, 245, 0.58);
  border: 1px solid rgba(0, 0, 0, 0.045);
  border-radius: 26px;
  display: grid;
  gap: 16px;
  margin: 18px 0;
  padding: 18px;
}

.discussion-log > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.expert-comment {
  display: grid;
  grid-template-columns: 42px minmax(0, 0.8fr);
  gap: 12px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 260ms ease, transform 260ms ease;
}

.expert-comment.right {
  grid-template-columns: minmax(0, 0.8fr) 42px;
  justify-content: end;
}

.expert-comment.pending {
  opacity: 0;
  transform: translateY(8px);
}

.expert-avatar {
  align-items: center;
  background: #111;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
  color: #fff;
  display: flex;
  font-size: 14px;
  font-weight: 700;
  height: 42px;
  justify-content: center;
  position: relative;
  width: 42px;
}

.expert-avatar span {
  transform: translateY(-1px);
}

.expert-comment.right .expert-avatar {
  background: #f7f7f8;
  border-color: rgba(0, 0, 0, 0.14);
  color: var(--ink);
  grid-column: 2;
  grid-row: 1;
}

.expert-comment.typing .expert-avatar::after {
  animation: talkPulse 860ms ease-in-out infinite;
  background: #34c759;
  border: 2px solid #fff;
  border-radius: 50%;
  bottom: 1px;
  content: "";
  height: 10px;
  position: absolute;
  right: 1px;
  width: 10px;
}

.expert-bubble {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(0, 0, 0, 0.055);
  border-radius: 22px;
  box-shadow: 0 16px 34px rgba(25, 22, 20, 0.045);
  display: grid;
  gap: 9px;
  padding: 16px 18px;
}

.expert-comment.right .expert-bubble {
  background: rgba(255, 255, 255, 0.66);
  grid-column: 1;
  text-align: left;
}

.expert-meta {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.expert-comment strong {
  font-size: 14px;
  font-weight: 650;
}

.expert-comment em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 600;
}

.expert-comment p {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.66;
  min-height: 24px;
  margin: 0;
}

.expert-comment.typing .typewriter-line:not(.done)::after,
.expert-comment.typing .expert-evidence li.typing::after,
.discussion-summary.typing .typewriter-line:not(.done)::after {
  animation: cursorBlink 760ms steps(2, start) infinite;
  color: var(--muted);
  content: "|";
  margin-left: 2px;
}

.expert-comment ul {
  margin: 0;
  padding: 0;
}

.expert-comment li {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 5px 18px;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.expert-comment li.visible {
  opacity: 1;
  transform: translateY(0);
}

.discussion-summary {
  align-items: start;
  background:
    linear-gradient(135deg, rgba(17, 17, 17, 0.94), rgba(51, 45, 43, 0.9)),
    #111111;
  border-radius: 26px;
  box-shadow: 0 18px 46px rgba(25, 22, 20, 0.12);
  color: #ffffff;
  display: grid;
  gap: 14px;
  grid-template-columns: 44px minmax(0, 1fr);
  margin-top: 4px;
  opacity: 1;
  padding: 18px;
  transform: translateY(0);
  transition: opacity 260ms ease, transform 260ms ease;
}

.discussion-summary.pending {
  opacity: 0;
  transform: translateY(10px);
}

.summary-orb {
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  display: flex;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.summary-orb span {
  font-size: 14px;
  font-weight: 800;
}

.discussion-summary strong {
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
}

.discussion-summary p {
  color: rgba(255, 255, 255, 0.76);
  font-size: 14px;
  line-height: 1.72;
  min-height: 24px;
}

.position-chart {
  margin-top: 18px;
}

.market-analysis {
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(210, 210, 215, 0.62);
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.035);
  display: grid;
  gap: 16px;
  margin-top: 18px;
  overflow: hidden;
  padding: 18px;
  position: relative;
}

.market-analysis::before {
  background: linear-gradient(90deg, rgba(0, 113, 227, 0.08), transparent 62%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.market-analysis > * {
  position: relative;
  z-index: 1;
}

.market-analysis > div,
.signal-block {
  display: grid;
  gap: 4px;
}

.market-header {
  align-items: baseline;
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.market-analysis span,
.llm-review > span,
.signal-block span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.market-analysis strong,
.signal-block strong {
  font-size: 18px;
}

.market-analysis em {
  color: var(--muted);
  font-style: normal;
}

.market-grid {
  display: grid !important;
  gap: 0 !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.market-audit-grid {
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  display: grid !important;
  gap: 0 !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
}

.market-audit-grid div {
  border-right: 1px solid var(--line-soft);
  display: grid;
  gap: 5px;
  padding: 12px 14px;
}

.market-audit-grid div:last-child {
  border-right: 0;
}

.market-audit-grid strong {
  font-size: 16px;
}

.market-grid div {
  border-right: 1px solid var(--line-soft);
  display: grid;
  gap: 6px;
  min-height: 72px;
  padding: 13px 14px 13px 0;
}

.market-grid div:last-child {
  border-right: 0;
}

.market-grid strong {
  font-size: 17px;
  font-weight: 720;
}

.market-view,
.market-method,
.market-evidence,
.sector-note {
  display: grid;
  gap: 8px !important;
}

.market-view p,
.market-method p,
.sector-note p {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.68;
}

.paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.paper-links a {
  background: rgba(169, 104, 255, 0.12);
  border: 1px solid rgba(185, 134, 255, 0.28);
  border-radius: 999px;
  color: var(--accent);
  font-size: 12px;
  line-height: 1.35;
  padding: 7px 10px;
  text-decoration: none;
}

.market-evidence ul {
  display: grid;
  gap: 8px;
  list-style: none;
  padding: 0;
}

.market-evidence li {
  align-items: baseline;
  color: var(--muted);
  display: grid;
  font-size: 13px;
  gap: 8px;
  grid-template-columns: 7px minmax(0, 1fr);
  margin: 0;
}

.market-evidence li span {
  background: var(--accent);
  border-radius: 999px;
  display: block;
  height: 7px;
  margin-top: 2px;
  width: 7px;
}

.private-scope-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.private-scope-list li {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  color: var(--muted);
  display: grid;
  gap: 4px;
  padding: 10px 12px;
}

.private-scope-list strong {
  color: var(--ink);
  font-size: 12px;
}

.private-scope-list span {
  font-size: 12px;
  line-height: 1.5;
}

.debate-rounds {
  counter-reset: debate-round;
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}

.debate-rounds li {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.074), rgba(255, 255, 255, 0.036)),
    rgba(8, 8, 12, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  display: grid;
  gap: 6px;
  padding: 12px 14px;
}

.debate-rounds li.conceded,
.debate-rounds li.no_new_evidence {
  border-color: rgba(192, 132, 252, 0.28);
}

.debate-rounds span,
.debate-termination span {
  color: rgba(248, 247, 255, 0.48);
  font-size: 12px;
}

.debate-rounds strong,
.debate-termination strong {
  color: var(--ink);
  font-size: 14px;
}

.debate-rounds p,
.debate-termination p {
  color: rgba(248, 247, 255, 0.68);
  line-height: 1.6;
}

.debate-rounds em {
  color: rgba(248, 247, 255, 0.48);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.debate-termination {
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(192, 132, 252, 0.2);
  border-radius: 16px;
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 12px 14px;
}

.signal-block li {
  color: var(--muted);
  margin: 0 0 6px 18px;
}

.market-analysis small {
  color: var(--muted);
}

.compact-judge {
  margin-top: 12px;
}

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

.judge p {
  margin-top: 12px;
}

.review-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.review-list > strong {
  font-size: 14px;
}

.review-list li {
  color: var(--muted);
  margin: 0 0 6px 18px;
}

.candidate-lines {
  display: grid;
  gap: 16px;
}

.candidate-lines > div {
  display: grid;
  gap: 10px;
  border-bottom: 0;
  padding-bottom: 0;
}

.optimization-chart-block {
  gap: 10px;
}

.optimization-chart-block svg {
  margin-top: 4px;
}

.candidate-lines strong {
  font-size: 16px;
}

.candidate-card {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 244, 242, 0.62)),
    var(--paper);
  border: 1px solid rgba(0, 0, 0, 0.055);
  border-radius: 28px;
  box-shadow: 0 18px 48px rgba(25, 22, 20, 0.045);
  padding: 18px;
}

.candidate-card.passed {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(241, 249, 243, 0.62)),
    var(--paper);
}

.candidate-head {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.candidate-head small {
  display: block;
  margin-top: 5px;
}

.candidate-pass,
.candidate-fail {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 650;
  justify-self: start;
  line-height: 1;
  padding: 6px 9px;
}

.candidate-pass {
  background: rgba(36, 138, 61, 0.1);
  color: var(--green);
}

.candidate-fail {
  background: rgba(215, 0, 21, 0.08);
  color: var(--danger);
}

.candidate-lines span,
.candidate-lines small {
  color: var(--muted);
}

.candidate-hypothesis {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.62;
}

.candidate-change {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.64;
}

.candidate-action-summary {
  background:
    linear-gradient(145deg, rgba(168, 85, 247, 0.12), rgba(255, 255, 255, 0.035)),
    rgba(7, 7, 12, 0.72);
  border: 1px solid rgba(192, 132, 252, 0.15);
  border-radius: 16px;
  display: grid;
  gap: 5px;
  margin: 12px 0;
  padding: 13px 14px;
}

.candidate-action-summary span {
  color: rgba(233, 213, 255, 0.62);
  font-size: 12px;
  font-weight: 760;
}

.candidate-action-summary strong {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  line-height: 1.45;
}

.candidate-action-summary small {
  color: rgba(248, 247, 255, 0.58);
  font-size: 12px;
  line-height: 1.45;
}

.candidate-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.candidate-tags span {
  background: rgba(17, 17, 17, 0.055);
  border-radius: 999px;
  color: var(--ink);
  font-size: 12px;
  padding: 6px 9px;
}

.gate-checks {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  list-style: none;
  margin-top: 4px;
  padding: 0;
}

.gate-checks li {
  align-items: baseline;
  background: rgba(255, 255, 255, 0.58);
  border-radius: 16px;
  display: grid;
  gap: 4px;
  grid-template-columns: 1fr;
  padding: 10px;
}

.gate-checks strong {
  color: var(--green);
  font-size: 13px;
}

.gate-checks .failed strong {
  color: var(--danger);
}

.gate-checks span {
  font-size: 12px;
}

.baseline-line {
  border-left: 0;
  padding-left: 18px;
}

.candidate-compare {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 8px;
}

.candidate-compare div {
  background: rgba(255, 255, 255, 0.64);
  border-radius: 20px;
  display: grid;
  gap: 5px;
  min-height: 112px;
  padding: 14px;
}

.candidate-compare span {
  font-size: 12px;
}

.candidate-compare strong {
  font-size: 24px;
  line-height: 1;
}

.candidate-compare em {
  font-style: normal;
  font-weight: 800;
}

.candidate-compare em.good {
  color: var(--green);
}

.candidate-compare em.bad {
  color: var(--danger);
}

.candidate-compare em.flat {
  color: var(--muted);
}

.selected-compare {
  border-top: 1px solid var(--line-soft);
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
}

.selected-chart-block {
  border-top: 1px solid var(--line-soft);
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
}

.selected-result {
  border-left: 2px solid var(--green);
  padding-left: 18px;
}

.selected-result p {
  margin-top: 8px;
}

.save-decision {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(168, 85, 247, 0.18), rgba(10, 10, 18, 0.92)),
    rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(192, 132, 252, 0.34);
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(168, 85, 247, 0.16);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-top: 18px;
  padding: 18px;
}

.save-decision span {
  color: var(--purple);
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
}

.save-decision strong {
  color: var(--text);
  display: block;
  font-size: 18px;
}

.save-decision p {
  color: var(--muted);
  margin: 6px 0 0;
}

.save-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.save-actions button {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  min-height: 42px;
  padding: 0 16px;
}

.save-actions button:not(.primary) {
  background: rgba(255, 255, 255, 0.07);
}

.save-decision.saved {
  border-color: rgba(52, 211, 153, 0.36);
}

.save-decision.saved span {
  color: var(--green);
}

.save-decision.discarded {
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: none;
}

.selection-reason {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

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

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

@keyframes heroRise {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@keyframes dotDrift {
  0%,
  100% {
    opacity: 0.62;
    transform: translateY(0) scale(1);
  }
  50% {
    opacity: 0.82;
    transform: translateY(-9px) scale(1.015);
  }
}

@keyframes coreFloat {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-11px);
  }
}

@keyframes arcTrace {
  0%,
  100% {
    opacity: 0.22;
    transform: translateX(-50%) rotate(-11deg) scaleX(0.96);
  }
  50% {
    opacity: 0.48;
    transform: translateX(-50%) rotate(-8deg) scaleX(1.03);
  }
}

@keyframes activePulse {
  0%,
  100% {
    box-shadow: 0 0 0 7px rgba(0, 113, 227, 0.08);
  }
  50% {
    box-shadow: 0 0 0 14px rgba(0, 113, 227, 0.03);
  }
}

@keyframes buttonScan {
  to {
    transform: translateX(100%);
  }
}

@keyframes loadingSweep {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

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

@keyframes cardLift {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes statusScan {
  0% {
    transform: translateX(-95%);
  }
  55%,
  100% {
    transform: translateX(235%);
  }
}

@keyframes talkPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.28);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(52, 199, 89, 0);
    transform: scale(1.08);
  }
}

@keyframes cursorBlink {
  0%,
  45% {
    opacity: 1;
  }
  46%,
  100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html:not(.qp-demo-motion) *,
  html:not(.qp-demo-motion) *::before,
  html:not(.qp-demo-motion) *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 820px) {
  .page {
    width: min(100% - 24px, 1240px);
  }

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

  .topbar {
    align-items: center;
    gap: 12px;
    min-height: 62px;
    padding-top: 12px;
  }

  .site-nav {
    display: none;
  }

  .env span {
    display: none;
  }

  .hero {
    min-height: 570px;
    padding-top: 24px;
  }

  .hero h1 {
    font-size: clamp(48px, 13vw, 72px);
    letter-spacing: -0.045em;
  }

  .hero p {
    font-size: 14px;
    margin-top: 22px;
    max-width: 360px;
  }

  .quant-visual {
    height: 360px;
    inset: 210px 0 auto;
  }

  .dot-field {
    background-size: 7px 7px;
    height: 240px;
    top: 50px;
    width: 52vw;
  }

  .signal-arc {
    top: 104px;
    width: 330px;
  }

  .arc-two {
    top: 146px;
    width: 250px;
  }

  .quant-core {
    height: 170px;
    top: 142px;
    width: 170px;
  }

  .node {
    font-size: 10px;
    padding: 4px 7px;
  }

  .price-path {
    height: 58px;
    top: 57px;
    width: 92px;
  }

  .method-panel {
    margin-top: -10px;
    padding: 30px 24px;
    width: 100%;
  }

  .method-intro,
  .method-grid {
    grid-template-columns: 1fr;
  }

  .method-intro {
    gap: 20px;
  }

  .cache-maintenance {
    align-items: flex-start;
    border-radius: 18px;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }

  .cache-maintenance span {
    overflow: visible;
    white-space: normal;
  }

  .cache-update-btn {
    width: 100%;
  }

  .composer-grid {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .library-controlbar {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .library-hero {
    min-height: 500px;
    padding-top: 42px;
  }

  .library-hero h1 {
    font-size: clamp(52px, 14vw, 82px);
  }

  .library-visual {
    inset: 255px 0 auto;
  }

  .composer {
    padding-top: 34px;
  }

  .env {
    text-align: left;
    flex-wrap: wrap;
  }

  .composer-copy h1 {
    font-size: 36px;
  }

  .research-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 24px;
  }

  .input-surface {
    padding: 14px;
  }

  .input-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .input-toolbar .primary {
    width: 100%;
  }

  .metrics-strip,
  .metrics-strip.compact,
  .allocation-summary,
  .library-stats,
  .library-compare-metrics,
  .strategy-library,
  .library-metrics,
  .library-expert-strip,
  .regime-summary,
  .rebalance-lines,
  .sector-rotation,
  .strategy-lines,
  .strategy-brief,
  .scorecard-lines,
  .independent-experts,
  .risk-lines,
  .market-grid,
  .market-audit-grid,
  .risk-checks,
  .risk-checks.slim,
  .integrity-checks,
  .oos-grid,
  .position-review-line,
  .pm-votes,
  .candidate-compare,
  .gate-checks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .holding-line,
  .regime-line,
  .strategy-card-main {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .strategy-card-main {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
  }

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

  .holding-line em,
  .holding-line b,
  .holding-line small,
  .regime-line em,
  .regime-line b,
  .regime-line small {
    grid-column: 2;
  }
}

@media (max-width: 520px) {
  .library-hero {
    min-height: 455px;
    padding-top: 26px;
  }

  .library-hero h1 {
    font-size: clamp(46px, 18vw, 66px);
  }

  .library-hero-actions,
  .library-actions,
  .strategy-card-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .library-actions {
    border-radius: 18px;
  }

  .library-filter,
  .strategy-card-actions button {
    width: 100%;
  }

  .flow-step {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 12px;
  }

  .flow-step.active .step-content {
    margin-left: 0;
    padding: 20px;
  }

  .metrics-strip,
  .metrics-strip.compact,
  .allocation-summary,
  .library-stats,
  .library-compare-metrics,
  .strategy-library,
  .library-metrics,
  .library-expert-strip,
  .regime-summary,
  .rebalance-lines,
  .strategy-lines,
  .strategy-brief,
  .scorecard-lines,
  .independent-experts,
  .risk-lines,
  .market-grid,
  .market-audit-grid,
  .risk-checks,
  .risk-checks.slim,
  .integrity-checks,
  .oos-grid,
  .position-review-line,
  .pm-votes,
  .candidate-compare,
  .gate-checks,
  .forecast-panel > div {
    grid-template-columns: 1fr;
  }

  .expert-comment,
  .expert-comment.right {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .expert-avatar {
    height: 34px;
    width: 34px;
  }

  .discussion-summary {
    grid-template-columns: 36px minmax(0, 1fr);
    padding: 16px;
  }

  .summary-orb {
    height: 36px;
    width: 36px;
  }

  .expert-comment.right .expert-avatar,
  .expert-comment.right .expert-bubble {
    grid-column: auto;
    grid-row: auto;
  }
}

/* Velara-inspired QuantPilot skin */
:root {
  color-scheme: dark;
  --bg: #050506;
  --paper: rgba(12, 12, 15, 0.94);
  --surface: rgba(255, 255, 255, 0.065);
  --surface-strong: rgba(255, 255, 255, 0.1);
  --ink: #f8f7ff;
  --muted: rgba(248, 247, 255, 0.62);
  --soft: rgba(248, 247, 255, 0.42);
  --line: rgba(255, 255, 255, 0.14);
  --line-soft: rgba(255, 255, 255, 0.075);
  --accent: #a855f7;
  --accent-hover: #9333ea;
  --accent-2: #8b5cf6;
  --accent-3: #c084fc;
  --accent-soft: rgba(168, 85, 247, 0.16);
  --blush: rgba(168, 85, 247, 0.2);
  --blush-soft: rgba(168, 85, 247, 0.09);
  --tile: rgba(255, 255, 255, 0.055);
  --danger: #fb7185;
  --green: #10b981;
  --orange: #f59e0b;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

html {
  background: #050506;
  scroll-behavior: smooth;
}

body {
  background: #050506;
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
}

body::before {
  background:
    radial-gradient(circle at 50% 0%, rgba(168, 85, 247, 0.18), transparent 26%),
    radial-gradient(circle at 8% 32%, rgba(139, 92, 246, 0.2), transparent 28%),
    linear-gradient(180deg, rgba(5, 5, 6, 0.18), #050506 760px);
}

::selection {
  background: rgba(168, 85, 247, 0.34);
  color: #ffffff;
}

.page {
  width: min(1480px, calc(100% - 42px));
  padding-bottom: 84px;
}

.topbar {
  background: rgba(9, 9, 12, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.32);
  margin: 18px auto 0;
  min-height: 66px;
  padding: 12px 16px 12px 22px;
  position: sticky;
  top: 14px;
  backdrop-filter: blur(22px);
}

.brand strong {
  color: #ffffff;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand span,
.env,
.env span,
.site-nav a {
  color: rgba(248, 247, 255, 0.58);
}

.site-nav {
  top: 23px;
}

.site-nav a {
  font-size: 13px;
  font-weight: 700;
}

.site-nav a:hover,
.site-nav a.active {
  color: #ffffff;
}

.journey-btn,
.hero-cta,
.primary,
.deposit-btn,
.cache-update-btn {
  background: linear-gradient(180deg, var(--accent), var(--accent-hover));
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 44px rgba(168, 85, 247, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

.ghost-cta,
.secondary,
.library-filter,
.chip {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.88);
}

.hero {
  align-items: center;
  background: #050506;
  border-radius: 38px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  margin-top: 18px;
  min-height: 1060px;
  overflow: hidden;
  padding: 106px 24px 0;
  position: relative;
}

.hero-video {
  height: 100%;
  inset: 0;
  object-fit: cover;
  opacity: 0.62;
  position: absolute;
  width: 100%;
  z-index: 0;
}

.hero-depth {
  background:
    radial-gradient(circle at 50% 28%, rgba(168, 85, 247, 0.18), transparent 26%),
    linear-gradient(180deg, rgba(5, 5, 6, 0.24), rgba(5, 5, 6, 0.74) 54%, #050506 96%),
    linear-gradient(90deg, rgba(5, 5, 6, 0.74), transparent 28%, transparent 72%, rgba(5, 5, 6, 0.74));
  inset: 0;
  position: absolute;
  z-index: 1;
}

.hero-copy {
  color: #ffffff;
  max-width: 840px;
  width: min(840px, 100%);
  z-index: 2;
}

.hero-badge {
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 12px 34px rgba(0, 0, 0, 0.22);
  color: rgba(255, 255, 255, 0.76);
  display: inline-flex;
  font-size: 13px;
  gap: 10px;
  margin-bottom: 22px;
  padding: 8px 14px 8px 8px;
  backdrop-filter: blur(22px);
}

.hero-badge span {
  background: linear-gradient(180deg, var(--accent-3), var(--accent));
  border-radius: 999px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 9px;
}

.hero-badge strong {
  font-weight: 700;
}

.hero-badge em {
  color: #ffffff;
  font-style: normal;
}

.hero h1,
.composer-copy h1,
.library-hero h1,
.method-intro h2 {
  color: #ffffff;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: -0.045em;
}

.hero h1 {
  font-size: clamp(48px, 7.2vw, 96px);
  font-weight: 800;
  line-height: 0.98;
  text-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.hero p {
  color: rgba(248, 247, 255, 0.68);
  font-size: 17px;
  line-height: 1.8;
  margin: 24px auto 28px;
  max-width: 630px;
}

.hero-actions,
.library-hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
}

.hero-cta,
.ghost-cta {
  min-height: 48px;
  padding: 0 28px;
}

.quant-dashboard {
  height: 455px;
  margin: 92px auto 0;
  max-width: 1180px;
  overflow: hidden;
  position: relative;
  width: min(100%, 1180px);
  z-index: 2;
}

.quant-dashboard::after {
  background: linear-gradient(180deg, transparent, rgba(5, 5, 6, 0.78) 58%, #050506 100%);
  bottom: 0;
  content: "";
  height: 120px;
  inset-inline: 0;
  pointer-events: none;
  position: absolute;
}

.dashboard-glow {
  background:
    radial-gradient(circle at 50% 14%, rgba(168, 85, 247, 0.38), transparent 36%),
    radial-gradient(circle at 72% 72%, rgba(16, 185, 129, 0.18), transparent 32%);
  filter: blur(28px);
  inset: 0;
  position: absolute;
}

.dashboard-panel {
  background: rgba(16, 16, 22, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 34px;
  box-shadow: 0 36px 100px rgba(0, 0, 0, 0.52), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  display: grid;
  gap: 18px;
  grid-template-columns: 92px minmax(0, 1fr);
  min-height: 410px;
  padding: 18px;
  position: relative;
  backdrop-filter: blur(24px);
}

.dashboard-sidebar {
  align-items: center;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 12px;
}

.sidebar-logo,
.side-icon {
  align-items: center;
  border-radius: 18px;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
}

.sidebar-logo {
  background: #ffffff;
  color: #09090b;
  height: 48px;
  width: 48px;
}

.side-icon {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.62);
  height: 42px;
  width: 42px;
}

.side-icon.active {
  background: rgba(168, 85, 247, 0.22);
  box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.34);
  color: #ffffff;
}

.dashboard-sidebar img {
  border: 2px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  height: 42px;
  margin-top: auto;
  width: 42px;
}

.dashboard-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

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

.dashboard-search {
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.46);
  display: flex;
  flex: 1;
  gap: 10px;
  min-height: 48px;
  padding: 0 16px;
}

.dashboard-search p {
  flex: 1;
  font-size: 13px;
  margin: 0;
  text-align: left;
}

.dashboard-search em {
  background: rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 11px;
  font-style: normal;
  padding: 4px 8px;
}

.deposit-btn {
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  min-height: 48px;
  padding: 0 20px;
}

.dashboard-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
}

.balance-card,
.asset-card {
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 28px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  padding: 24px;
}

.balance-head {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
}

.balance-head span,
.asset-row span {
  color: rgba(255, 255, 255, 0.5);
  display: block;
  font-size: 12px;
}

.balance-head strong {
  color: #ffffff;
  display: block;
  font-size: clamp(44px, 5vw, 70px);
  font-weight: 850;
  letter-spacing: -0.05em;
  margin-top: 6px;
}

.balance-head em {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: 999px;
  color: #34d399;
  font-style: normal;
  font-weight: 800;
  padding: 7px 10px;
}

.range-toggle {
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  display: inline-flex;
  gap: 4px;
  margin-top: 14px;
  padding: 5px;
}

.range-toggle span {
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  font-weight: 750;
  padding: 6px 10px;
}

.range-toggle .active {
  background: #ffffff;
  color: #09090b;
}

.wave-bars {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(12, minmax(12px, 1fr));
  height: 142px;
  margin-top: 30px;
  padding-top: 22px;
}

.wave-bars i {
  animation: barRise 900ms cubic-bezier(0.16, 1, 0.3, 1) both;
  background: linear-gradient(180deg, rgba(192, 132, 252, 0.98), rgba(139, 92, 246, 0.52));
  border-radius: 999px 999px 8px 8px;
  box-shadow: 0 12px 26px rgba(168, 85, 247, 0.26);
  display: block;
  height: var(--h);
  min-height: 18px;
  position: relative;
}

.wave-bars .peak {
  background: linear-gradient(180deg, #ffffff, #c084fc);
}

.wave-bars b {
  background: #ffffff;
  border-radius: 999px;
  bottom: calc(100% + 8px);
  color: #09090b;
  font-size: 10px;
  font-weight: 850;
  left: 50%;
  padding: 4px 7px;
  position: absolute;
  transform: translateX(-50%);
}

.asset-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.asset-head,
.asset-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.asset-head strong {
  color: #ffffff;
  font-size: 18px;
}

.asset-head span {
  color: rgba(255, 255, 255, 0.42);
  letter-spacing: 0.1em;
}

.asset-row {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 20px;
  gap: 12px;
  padding: 14px;
}

.asset-row i {
  border-radius: 14px;
  flex: 0 0 auto;
  height: 38px;
  width: 38px;
}

.asset-row div {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.asset-row strong,
.asset-row b {
  color: #ffffff;
}

.asset-row.purple i {
  background: linear-gradient(145deg, #a855f7, #8b5cf6);
}

.asset-row.green i {
  background: linear-gradient(145deg, #10b981, #047857);
}

.asset-row.amber i {
  background: linear-gradient(145deg, #f59e0b, #b45309);
}

.method-panel,
.library-hero,
.composer-grid,
.input-surface,
.library-controlbar,
.strategy-compare-shell,
.flow-step .step-content,
.empty-state,
.live-status,
.chart-card,
.risk-audit,
.audit-note,
.discussion-summary,
.expert-bubble,
.candidate-block,
.market-audit,
.strategy-card,
.library-stat,
.library-compare-panel,
.library-detail-panel {
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.105);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.065);
  color: var(--ink);
  backdrop-filter: blur(22px);
}

.method-panel {
  border-radius: 30px;
  margin: -96px auto 0;
  padding: 58px;
  position: relative;
  z-index: 4;
}

.method-intro {
  border-bottom-color: var(--line-soft);
}

.intro-label,
.method-intro span,
.flow-step .kicker,
.section-label {
  color: rgba(255, 255, 255, 0.46);
}

.method-intro h2,
.library-hero h1 {
  font-size: clamp(38px, 5vw, 76px);
  font-weight: 800;
  line-height: 1.02;
}

.method-intro p,
.method-grid p,
.composer-copy p,
.library-hero p,
.flow-step p,
.expert-bubble p,
.candidate-block p,
.strategy-card p {
  color: var(--muted);
}

.cache-maintenance,
.method-grid article,
.research-summary span,
.quick-row .chip,
.intensity-row,
.library-actions,
.library-stats > *,
.library-metrics > *,
.metrics-strip > *,
.allocation-summary > *,
.market-grid > *,
.risk-lines > *,
.scorecard-lines > *,
.strategy-brief > *,
.portfolio-table,
.regime-line,
.holding-line,
.expert-comment,
.candidate-summary,
.gate-check,
.position-review-line > *,
.pm-votes > *,
.factor-row,
.evidence-card,
.comparison-card,
.timeline-card {
  background: rgba(255, 255, 255, 0.052);
  border-color: rgba(255, 255, 255, 0.088);
  color: var(--ink);
}

.method-grid article {
  border-radius: 0;
  padding: 28px 34px;
}

.method-grid article:hover {
  background: rgba(168, 85, 247, 0.1);
  transform: translateY(-3px);
}

.method-grid strong,
.cache-maintenance strong,
.composer-copy h1,
.input-toolbar span,
.flow-step h2,
.flow-step h3,
.library-controlbar h2,
.strategy-card h3,
.expert-bubble strong,
.candidate-block h3 {
  color: #ffffff;
}

.cache-update-btn,
.primary {
  border-radius: 999px;
  cursor: pointer;
  font-weight: 850;
}

.composer {
  padding-top: 96px;
}

.composer-grid {
  border-radius: 34px;
  grid-template-columns: minmax(320px, 0.84fr) minmax(420px, 1.16fr);
  overflow: hidden;
  padding: 46px;
}

.composer-copy h1 {
  font-size: clamp(44px, 5.4vw, 92px);
  font-weight: 850;
  line-height: 0.98;
}

.input-surface {
  border-radius: 30px;
  padding: 24px;
}

textarea {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

textarea::placeholder {
  color: rgba(255, 255, 255, 0.36);
}

textarea:focus {
  border-color: rgba(168, 85, 247, 0.7);
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.16);
  outline: none;
}

.intensity-row label {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid transparent;
  border-radius: 18px;
}

.intensity-row input:checked + strong,
.intensity-row label:has(input:checked) strong {
  color: #ffffff;
}

.intensity-row label:has(input:checked) {
  background: rgba(168, 85, 247, 0.16);
  border-color: rgba(168, 85, 247, 0.34);
}

.library-section {
  padding-top: 92px;
}

.library-hero {
  border-radius: 38px;
  min-height: 600px;
  overflow: hidden;
  padding: 72px 56px;
}

.library-hero::before {
  background:
    radial-gradient(circle at 75% 28%, rgba(168, 85, 247, 0.26), transparent 22%),
    radial-gradient(circle at 28% 88%, rgba(16, 185, 129, 0.12), transparent 26%);
}

.library-hero h1 {
  max-width: 820px;
}

.library-hero p {
  max-width: 560px;
}

.compare-core {
  border-color: rgba(255, 255, 255, 0.18);
}

.compare-ring,
.signal-arc {
  border-color: rgba(255, 255, 255, 0.14);
}

.compare-line {
  background: rgba(255, 255, 255, 0.36);
}

.dot-field {
  --dot: rgba(255, 255, 255, 0.7);
}

.dot-field::after {
  background:
    radial-gradient(circle at 55% 48%, transparent 0 24%, rgba(5, 5, 6, 0.78) 25% 34%, transparent 35%),
    linear-gradient(90deg, rgba(5, 5, 6, 0.98), transparent 22%, transparent 78%, rgba(5, 5, 6, 0.98));
}

.library-controlbar {
  border-radius: 28px;
  margin-top: 22px;
  padding: 28px;
}

.library-filter.active {
  background: #ffffff;
  color: #09090b;
}

.flow-head {
  border-color: var(--line-soft);
  margin-top: 92px;
}

.flow-head span,
.library-card-date,
.muted,
small {
  color: var(--soft);
}

.flow {
  border-left-color: rgba(255, 255, 255, 0.12);
}

.step-dot {
  background: #ffffff;
  box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.06), 0 0 34px rgba(168, 85, 247, 0.32);
}

.flow-step.active .step-content {
  background:
    linear-gradient(135deg, rgba(168, 85, 247, 0.14), rgba(255, 255, 255, 0.052) 38%, rgba(255, 255, 255, 0.075)),
    rgba(255, 255, 255, 0.055);
}

.flow-step.error .step-content {
  background: rgba(251, 113, 133, 0.08);
  border-color: rgba(251, 113, 133, 0.28);
}

.chart-card,
.strategy-compare-shell svg,
.chart-card svg,
.allocation-chart svg,
.library-compare-panel svg {
  background: rgba(5, 5, 6, 0.18);
  border-radius: 22px;
}

.chart-caption,
.range-note,
.source-line,
.evidence-meta,
.strategy-meta,
.regime-summary span,
.holding-line small,
.market-audit small {
  color: var(--soft);
}

.badge,
.status-pill,
.passed,
.accepted,
.chip.active {
  background: rgba(168, 85, 247, 0.16);
  color: #e9d5ff;
}

.danger,
.failed,
.rejected {
  color: #fda4af;
}

.positive,
.success,
.gain {
  color: #34d399;
}

.negative,
.loss {
  color: #fb7185;
}

button:hover {
  transform: translateY(-1px);
}

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

@keyframes barRise {
  from {
    opacity: 0;
    transform: scaleY(0.42) translateY(18px);
    transform-origin: bottom;
  }
  to {
    opacity: 1;
    transform: scaleY(1) translateY(0);
    transform-origin: bottom;
  }
}

@media (max-width: 980px) {
  .page {
    width: min(100% - 24px, 100%);
  }

  .topbar {
    border-radius: 24px;
  }

  .site-nav {
    display: none;
  }

  .hero {
    min-height: 920px;
    padding-top: 72px;
  }

  .quant-dashboard {
    height: auto;
    margin-top: 70px;
  }

  .dashboard-panel {
    grid-template-columns: 1fr;
  }

  .dashboard-sidebar {
    flex-direction: row;
  }

  .dashboard-sidebar img {
    margin-left: auto;
    margin-top: 0;
  }

  .dashboard-grid,
  .composer-grid {
    grid-template-columns: 1fr;
  }

  .method-panel {
    margin-top: -64px;
    padding: 34px 24px;
  }
}

@media (max-width: 620px) {
  .hero {
    border-radius: 28px;
    min-height: 860px;
    padding-inline: 16px;
  }

  .hero h1 {
    font-size: clamp(42px, 15vw, 68px);
  }

  .hero-actions,
  .library-hero-actions,
  .dashboard-topline {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-sidebar {
    display: none;
  }

  .dashboard-panel,
  .balance-card,
  .asset-card,
  .composer-grid,
  .input-surface,
  .library-hero {
    border-radius: 24px;
  }

  .wave-bars {
    gap: 6px;
  }
}

/* Research workspace dark polish */
.lab-section {
  display: grid;
  gap: 22px;
}

.lab-risk-row {
  animation: qpStackRise 620ms 40ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.lab-risk-row .risk-preference-panel {
  border-radius: 26px;
  gap: 16px;
  padding: 18px 20px 20px;
}

.lab-risk-row .risk-preference-panel::before {
  animation: qpControlRail 4200ms linear infinite;
  background:
    linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.6), rgba(192, 132, 252, 0.72), transparent);
  content: "";
  height: 1px;
  inset: auto 24px 0;
  opacity: 0.72;
  position: absolute;
  transform: translateX(-68%);
  width: 46%;
}

.lab-risk-row .risk-preference-track {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lab-risk-row .risk-pref-card {
  min-height: 118px;
}

.composer-grid {
  background:
    radial-gradient(circle at 82% 22%, rgba(168, 85, 247, 0.2), transparent 28%),
    radial-gradient(circle at 52% 105%, rgba(139, 92, 246, 0.16), transparent 28%),
    rgba(255, 255, 255, 0.045);
  align-items: start;
  border-color: rgba(255, 255, 255, 0.115);
}

.strategy-entry-stack {
  display: grid;
  gap: 18px;
}

.strategy-entry-stack > * {
  animation: qpStackRise 640ms cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: var(--stack-delay, 0ms);
}

.strategy-entry-stack > *:nth-child(1) {
  --stack-delay: 80ms;
}

.strategy-entry-stack > *:nth-child(2) {
  --stack-delay: 180ms;
}

.strategy-entry-stack > *:nth-child(3) {
  --stack-delay: 280ms;
}

.input-surface {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.052)),
    rgba(10, 10, 14, 0.84);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow:
    0 32px 96px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(168, 85, 247, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  position: relative;
}

.input-surface::before {
  background:
    radial-gradient(circle at 83% 12%, rgba(168, 85, 247, 0.26), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.085), transparent 38%);
  border-radius: inherit;
  content: "";
  inset: 0;
  opacity: 0.85;
  pointer-events: none;
  position: absolute;
}

.input-surface > * {
  position: relative;
  z-index: 1;
}

.input-toolbar {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 14px;
  padding-bottom: 16px;
}

.input-toolbar span {
  color: rgba(248, 247, 255, 0.76);
  letter-spacing: 0.02em;
}

.risk-preference-panel {
  background:
    radial-gradient(circle at 16% 0%, rgba(34, 211, 238, 0.16), transparent 30%),
    radial-gradient(circle at 88% 16%, rgba(168, 85, 247, 0.24), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(4, 4, 10, 0.36);
  border: 1px solid rgba(192, 132, 252, 0.18);
  border-radius: 24px;
  box-shadow:
    0 26px 80px rgba(0, 0, 0, 0.32),
    0 0 0 1px rgba(168, 85, 247, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: grid;
  gap: 18px;
  overflow: hidden;
  padding: 18px;
  position: relative;
}

.risk-preference-panel::after {
  animation: qpRiskSweep 3200ms ease-in-out infinite;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  transform: translateX(-100%);
}

.risk-preference-panel.preference-switched {
  animation: qpRiskPanelConfirm 720ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.risk-preference-energy {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(192, 132, 252, 0.18), rgba(255, 255, 255, 0.06));
  border-radius: 999px;
  height: 3px;
  inset: auto 18px 14px;
  overflow: hidden;
  position: absolute;
}

.risk-preference-energy span {
  animation: qpRiskSpark 1350ms ease-in-out infinite;
  background: linear-gradient(90deg, rgba(34, 211, 238, 0), rgba(216, 180, 254, 0.95), rgba(34, 211, 238, 0));
  border-radius: inherit;
  box-shadow: 0 0 26px rgba(192, 132, 252, 0.75);
  display: block;
  height: 100%;
  left: 50%;
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  transition: left 260ms cubic-bezier(0.16, 1, 0.3, 1), background 220ms ease;
  width: 34%;
}

.risk-preference-panel:has(.seeking input:checked) .risk-preference-energy span {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0), rgba(251, 191, 36, 0.95), rgba(245, 158, 11, 0));
  box-shadow: 0 0 28px rgba(245, 158, 11, 0.68);
  left: 16.666%;
}

.risk-preference-panel:has(.neutral input:checked) .risk-preference-energy span {
  left: 50%;
}

.risk-preference-panel:has(.averse input:checked) .risk-preference-energy span {
  background: linear-gradient(90deg, rgba(52, 211, 153, 0), rgba(52, 211, 153, 0.95), rgba(52, 211, 153, 0));
  box-shadow: 0 0 28px rgba(52, 211, 153, 0.62);
  left: 83.333%;
}

.risk-preference-head,
.risk-preference-track {
  position: relative;
  z-index: 1;
}

.risk-preference-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 46px;
}

.risk-preference-head div {
  display: grid;
  gap: 4px;
}

.risk-preference-head span,
.risk-pref-card span {
  color: rgba(248, 247, 255, 0.48);
  font-size: 12px;
  font-weight: 780;
}

.risk-preference-head strong {
  color: #ffffff;
  font-size: 18px;
}

.risk-preference-head em {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(192, 132, 252, 0.26);
  border-radius: 999px;
  color: rgba(233, 213, 255, 0.95);
  font-size: 12px;
  font-style: normal;
  font-weight: 820;
  padding: 7px 10px;
  white-space: nowrap;
}

.risk-preference-track {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  isolation: isolate;
}

.risk-pref-card {
  animation: qpFadeLift 520ms ease-out var(--delay, 80ms) both;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.072), rgba(255, 255, 255, 0.026)),
    rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 18px;
  cursor: pointer;
  display: grid;
  gap: 9px;
  min-height: 142px;
  overflow: hidden;
  padding: 16px;
  position: relative;
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease, box-shadow 220ms ease, filter 220ms ease;
}

.risk-pref-card:nth-child(1) {
  --delay: 80ms;
}

.risk-pref-card:nth-child(2) {
  --delay: 170ms;
}

.risk-pref-card:nth-child(3) {
  --delay: 260ms;
}

.risk-pref-card:hover {
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-2px);
}

.risk-pref-card::after {
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.55), transparent 58%),
    radial-gradient(circle, rgba(192, 132, 252, 0.42), transparent 68%);
  border-radius: 999px;
  content: "";
  height: 74px;
  opacity: 0;
  position: absolute;
  right: -28px;
  top: -26px;
  transform: scale(0.72);
  transition: opacity 220ms ease, transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
  width: 74px;
}

.risk-pref-card input {
  accent-color: #c084fc;
  height: 16px;
  margin: 0;
  position: absolute;
  right: 12px;
  top: 12px;
  width: 16px;
}

.risk-pref-card strong {
  color: #ffffff;
  font-size: 17px;
  line-height: 1.2;
}

.risk-pref-card small {
  color: rgba(248, 247, 255, 0.56);
  font-size: 12px;
  line-height: 1.55;
  padding-right: 14px;
}

.risk-pref-card:has(input:checked) {
  background:
    linear-gradient(145deg, rgba(168, 85, 247, 0.22), rgba(255, 255, 255, 0.055)),
    rgba(168, 85, 247, 0.12);
  border-color: rgba(192, 132, 252, 0.48);
  box-shadow:
    0 18px 46px rgba(168, 85, 247, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  filter: saturate(1.08);
  transform: translateY(-3px);
}

.risk-pref-card:has(input:checked)::before {
  animation: qpRiskPulse 900ms ease-out both;
  border: 1px solid rgba(192, 132, 252, 0.54);
  border-radius: inherit;
  content: "";
  inset: 0;
  position: absolute;
}

.risk-pref-card:has(input:checked)::after {
  animation: qpRiskGlowPop 720ms ease-out both;
  opacity: 1;
  transform: scale(1);
}

.risk-pref-card.seeking:has(input:checked) {
  border-color: rgba(245, 158, 11, 0.42);
}

.risk-pref-card.averse:has(input:checked) {
  border-color: rgba(52, 211, 153, 0.42);
}

.prompt-builder {
  background:
    radial-gradient(circle at 90% 0%, rgba(168, 85, 247, 0.14), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.03)),
    rgba(5, 5, 10, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.095);
  border-radius: 22px;
  box-shadow:
    0 20px 62px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 16px;
  overflow: hidden;
  padding: 18px;
  position: relative;
}

.prompt-builder::before {
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.62), rgba(34, 211, 238, 0.16), transparent);
  content: "";
  height: 1px;
  inset: 0 18px auto;
  opacity: 0.55;
  position: absolute;
}

.prompt-builder-head,
.prompt-builder-actions,
.prompt-builder-actions > div {
  align-items: center;
  display: flex;
  gap: 10px;
}

.prompt-builder-head,
.prompt-builder-actions {
  justify-content: space-between;
}

.prompt-builder-head div {
  display: grid;
  gap: 4px;
}

.prompt-builder-head span {
  color: rgba(248, 247, 255, 0.48);
  font-size: 12px;
  font-weight: 760;
}

.prompt-builder-head strong {
  color: #ffffff;
  font-size: 18px;
}

.builder-generate-btn,
.builder-clear-btn,
.builder-chip {
  border-radius: 999px;
  cursor: pointer;
  font-weight: 820;
  min-height: 34px;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
  white-space: nowrap;
}

.builder-generate-btn {
  background: linear-gradient(135deg, #c084fc, #a855f7 56%, #7c3aed);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 14px 34px rgba(168, 85, 247, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  color: #ffffff;
  padding: 0 18px;
}

.builder-generate-btn:hover,
.builder-chip:hover,
.builder-clear-btn:hover {
  transform: translateY(-1px);
}

.builder-generate-btn:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

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

.prompt-builder-grid label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.prompt-builder-grid span {
  color: rgba(248, 247, 255, 0.52);
  font-size: 12px;
  font-weight: 760;
}

.prompt-builder-grid input {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.032)),
    rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  color: rgba(255, 255, 255, 0.92);
  font: inherit;
  min-height: 40px;
  outline: none;
  padding: 0 12px;
}

.prompt-builder-grid input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.prompt-builder-grid input:focus {
  background: rgba(0, 0, 0, 0.34);
  border-color: rgba(192, 132, 252, 0.66);
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.12);
}

.prompt-builder-actions {
  border-top: 1px solid rgba(255, 255, 255, 0.075);
  padding-top: 12px;
}

.prompt-builder-actions > span {
  color: rgba(248, 247, 255, 0.54);
  font-size: 12px;
  line-height: 1.45;
}

.prompt-builder-actions > span[data-state="ready"] {
  color: rgba(52, 211, 153, 0.9);
}

.prompt-builder-actions > span[data-state="loading"] {
  color: rgba(192, 132, 252, 0.94);
}

.prompt-builder-actions > span[data-state="error"] {
  color: rgba(251, 113, 133, 0.92);
}

.builder-chip,
.builder-clear-btn {
  background: rgba(255, 255, 255, 0.052);
  border: 1px solid rgba(255, 255, 255, 0.095);
  color: rgba(248, 247, 255, 0.58);
  padding: 0 12px;
}

.builder-chip:hover {
  background: rgba(168, 85, 247, 0.14);
  border-color: rgba(192, 132, 252, 0.32);
  color: #ffffff;
}

.builder-clear-btn:hover {
  background: rgba(251, 113, 133, 0.1);
  border-color: rgba(251, 113, 133, 0.28);
  color: rgba(255, 228, 230, 0.95);
}

.input-toolbar .primary,
.primary {
  background: linear-gradient(135deg, #c084fc, #a855f7 54%, #7c3aed);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow:
    0 20px 52px rgba(168, 85, 247, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.input-surface textarea {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.082), rgba(255, 255, 255, 0.042)),
    rgba(0, 0, 0, 0.36);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.94);
}

.input-surface textarea::placeholder {
  color: rgba(255, 255, 255, 0.34);
}

.input-surface textarea:focus {
  background: rgba(0, 0, 0, 0.42);
  border-color: rgba(192, 132, 252, 0.72);
  box-shadow:
    0 0 0 4px rgba(168, 85, 247, 0.14),
    0 18px 46px rgba(168, 85, 247, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.intensity-row {
  background: rgba(255, 255, 255, 0.052);
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.intensity-row > span {
  color: rgba(248, 247, 255, 0.62);
}

.intensity-row label {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.66);
}

.intensity-row label:hover {
  background: rgba(255, 255, 255, 0.07);
}

.intensity-row label:has(input:checked) {
  background:
    linear-gradient(135deg, rgba(168, 85, 247, 0.28), rgba(255, 255, 255, 0.08)),
    rgba(168, 85, 247, 0.12);
  border-color: rgba(192, 132, 252, 0.46);
  box-shadow: 0 14px 36px rgba(168, 85, 247, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.intensity-row input {
  accent-color: #c084fc;
}

.intensity-row small,
.chip,
.quick-row .chip {
  color: rgba(248, 247, 255, 0.5);
}

.quick-row .chip {
  background: rgba(255, 255, 255, 0.052);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.quick-row .chip:hover {
  background: rgba(168, 85, 247, 0.14);
  border-color: rgba(192, 132, 252, 0.32);
  color: #ffffff;
}

.research-summary {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 22px;
  overflow: hidden;
}

.research-summary span {
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.74);
  padding: 17px 16px;
}

.research-summary span + span {
  border-left: 1px solid rgba(255, 255, 255, 0.075);
}

.agent-link-map {
  background:
    radial-gradient(circle at 18% 8%, rgba(34, 211, 238, 0.13), transparent 28%),
    radial-gradient(circle at 92% 0%, rgba(168, 85, 247, 0.18), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.026)),
    rgba(5, 5, 10, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 22px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.075);
  display: grid;
  gap: 15px;
  margin-top: 24px;
  max-width: 620px;
  overflow: hidden;
  padding: 18px;
  position: relative;
}

.agent-link-map::before {
  animation: qpAgentRail 3600ms ease-in-out infinite;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.62), rgba(168, 85, 247, 0.64), transparent);
  content: "";
  height: 1px;
  inset: 0 18px auto;
  opacity: 0.58;
  position: absolute;
  transform: translateX(-72%);
  width: 52%;
}

.agent-link-map::after {
  animation: qpAgentScan 5200ms ease-in-out infinite;
  background:
    linear-gradient(180deg, transparent, rgba(192, 132, 252, 0.1), transparent);
  content: "";
  inset: -40% 0 auto;
  height: 60%;
  opacity: 0.8;
  pointer-events: none;
  position: absolute;
}

.agent-link-head {
  align-items: end;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.agent-link-head span {
  color: rgba(248, 247, 255, 0.46);
  font-size: 12px;
  font-weight: 820;
}

.agent-link-head strong {
  color: rgba(255, 255, 255, 0.92);
  font-size: 15px;
  line-height: 1.2;
}

.agent-link-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  position: relative;
  z-index: 1;
}

.agent-link-node {
  animation: qpAgentNodeIn 560ms cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(120ms + var(--node-index, 0) * 75ms);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.062), rgba(255, 255, 255, 0.026)),
    rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 15px;
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: 13px 14px 12px;
  position: relative;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.agent-link-node:nth-child(1) {
  --node-index: 1;
}

.agent-link-node:nth-child(2) {
  --node-index: 2;
}

.agent-link-node:nth-child(3) {
  --node-index: 3;
}

.agent-link-node:nth-child(4) {
  --node-index: 4;
}

.agent-link-node:nth-child(5) {
  --node-index: 5;
}

.agent-link-node:nth-child(6) {
  --node-index: 6;
}

.agent-link-node:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(192, 132, 252, 0.32);
  transform: translateY(-1px);
}

.agent-link-node::after {
  background: rgba(148, 163, 184, 0.55);
  border-radius: 999px;
  box-shadow: 0 0 18px rgba(148, 163, 184, 0.22);
  content: "";
  height: 7px;
  position: absolute;
  right: 12px;
  top: 13px;
  width: 7px;
}

.agent-link-node.active {
  background:
    linear-gradient(145deg, rgba(168, 85, 247, 0.2), rgba(34, 211, 238, 0.055)),
    rgba(168, 85, 247, 0.08);
  border-color: rgba(192, 132, 252, 0.36);
}

.agent-link-node.active::after {
  animation: qpStatusBlink 1250ms ease-in-out infinite;
  background: #34d399;
  box-shadow: 0 0 22px rgba(52, 211, 153, 0.56);
}

.agent-link-node span {
  color: rgba(192, 132, 252, 0.88);
  font-size: 11px;
  font-weight: 880;
}

.agent-link-node strong {
  color: #ffffff;
  font-size: 14px;
  line-height: 1.2;
}

.agent-link-node small {
  color: rgba(248, 247, 255, 0.48);
  font-size: 11px;
  line-height: 1.35;
}

.agent-signal-board {
  align-items: center;
  animation: qpStackRise 680ms 260ms cubic-bezier(0.16, 1, 0.3, 1) both;
  background:
    radial-gradient(circle at 10% 45%, rgba(52, 211, 153, 0.12), transparent 34%),
    radial-gradient(circle at 90% 5%, rgba(168, 85, 247, 0.16), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.064), rgba(255, 255, 255, 0.026)),
    rgba(5, 5, 10, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 22px;
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.065);
  display: grid;
  gap: 14px;
  grid-template-columns: 68px 1fr;
  margin-top: 16px;
  max-width: 620px;
  overflow: hidden;
  padding: 16px 18px;
  position: relative;
}

.agent-signal-board::before {
  animation: qpBoardSweep 4800ms ease-in-out infinite;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  transform: translateX(-100%);
}

.signal-board-core {
  align-items: center;
  aspect-ratio: 1;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(52, 211, 153, 0.24);
  border-radius: 18px;
  display: grid;
  justify-items: center;
  position: relative;
}

.signal-board-core span {
  animation: qpRadarSpin 3800ms linear infinite;
  background: conic-gradient(from 0deg, rgba(52, 211, 153, 0), rgba(52, 211, 153, 0.72), rgba(168, 85, 247, 0.28), rgba(52, 211, 153, 0));
  border-radius: 999px;
  height: 38px;
  opacity: 0.78;
  width: 38px;
}

.signal-board-core i {
  background: #34d399;
  border-radius: 999px;
  box-shadow: 0 0 22px rgba(52, 211, 153, 0.62);
  height: 8px;
  position: absolute;
  width: 8px;
}

.signal-board-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.signal-board-copy span {
  color: rgba(248, 247, 255, 0.44);
  font-size: 12px;
  font-weight: 820;
}

.signal-board-copy strong {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  line-height: 1.35;
}

.signal-board-bars {
  display: grid;
  gap: 7px;
  grid-column: 2;
}

.signal-board-bars b {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  height: 5px;
  overflow: hidden;
  position: relative;
}

.signal-board-bars b::after {
  animation: qpSignalFill 2600ms ease-in-out infinite;
  animation-delay: calc(var(--bar-index, 0) * 220ms);
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.82), rgba(168, 85, 247, 0.9));
  border-radius: inherit;
  content: "";
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: var(--w);
}

.signal-board-bars b:nth-child(1) {
  --bar-index: 1;
}

.signal-board-bars b:nth-child(2) {
  --bar-index: 2;
}

.signal-board-bars b:nth-child(3) {
  --bar-index: 3;
}

.flow-head span,
.live-status,
.flow-step .step-content,
.empty-state {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.082), rgba(255, 255, 255, 0.045)),
    rgba(9, 9, 13, 0.82);
  border-color: rgba(255, 255, 255, 0.105);
  color: rgba(248, 247, 255, 0.72);
}

.live-status::before,
.step-content::before {
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.2), transparent 58%);
}

.live-orb span {
  background: #c084fc;
  box-shadow: 0 0 0 7px rgba(168, 85, 247, 0.14);
}

.flow-step.active .step-content {
  background:
    radial-gradient(circle at 92% 10%, rgba(168, 85, 247, 0.18), transparent 25%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.055)),
    rgba(9, 9, 13, 0.88);
  border-color: rgba(192, 132, 252, 0.24);
}

.flow-step.done .step-content {
  border-color: rgba(255, 255, 255, 0.11);
}

.step-content h2,
.step-content h3,
.empty-state h2,
.live-status strong,
.chart-title {
  color: #ffffff;
}

.step-content p,
.live-status p,
.empty-state p {
  color: rgba(248, 247, 255, 0.62);
}

.metrics-strip div,
.allocation-summary div,
.market-grid div,
.market-audit-grid,
.market-audit-grid div,
.risk-lines div,
.score-line,
.committee-score,
.independent-experts article,
.debate > div,
.llm-review,
.signal-block,
.strategy-brief div,
.rag-evidence.not-ready,
.rag-review-card,
.rag-raw-list > article,
.rag-raw-evidence,
.rag-objections li,
.discussion-log,
.candidate-card,
.candidate-card.passed,
.gate-checks li,
.candidate-compare div,
.library-stats div,
.library-compare-metrics div,
.library-metrics div,
.strategy-compare,
.strategy-compare-empty,
.library-empty,
.strategy-card,
.library-holdings span,
.library-expert-strip,
.strategy-editor,
.forecast-panel p,
.preview-skeleton span {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.078), rgba(255, 255, 255, 0.04)),
    rgba(7, 7, 10, 0.78);
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
  color: var(--ink);
}

.metrics-strip span,
.allocation-summary span,
.market-analysis span,
.market-audit-grid span,
.risk-lines span,
.score-line small,
.committee-score span,
.committee-score small,
.independent-experts span,
.independent-experts li,
.debate span,
.judge span,
.llm-review > span,
.signal-block span,
.strategy-brief span,
.rag-review-head span,
.rag-factor-tags span,
.rag-citations span,
.rag-objections li,
.rag-evidence em,
.rag-meta,
.rag-raw-evidence summary,
.candidate-lines span,
.candidate-lines small,
.candidate-change,
.gate-checks span,
.candidate-compare span,
.selection-reason,
.review-list li,
.library-stats span,
.library-compare-metrics span,
.library-compare-metrics small,
.library-metrics span,
.strategy-card small,
.strategy-card-main span,
.library-holdings span,
.strategy-compare-empty span,
.library-empty span,
.library-expert-strip span {
  color: rgba(248, 247, 255, 0.52);
}

.metrics-strip strong,
.allocation-summary strong,
.market-analysis strong,
.market-audit-grid strong,
.market-grid strong,
.risk-lines strong,
.score-line em,
.committee-score strong,
.independent-experts strong,
.debate h3,
.judge h3,
.strategy-brief p,
.rag-evidence strong,
.rag-review-head h3,
.rag-evidence p,
.candidate-lines strong,
.candidate-hypothesis,
.candidate-compare strong,
.selected-result h3,
.review-list > strong,
.library-stats strong,
.library-compare-metrics strong,
.library-metrics strong,
.strategy-card-main h3,
.strategy-card-actions button,
.strategy-editor button,
.strategy-editor label,
.library-expert-strip strong {
  color: #ffffff;
}

.market-analysis {
  background:
    radial-gradient(circle at 92% 0%, rgba(168, 85, 247, 0.2), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.04)),
    rgba(7, 7, 10, 0.82);
  border-color: rgba(255, 255, 255, 0.1);
}

.market-analysis::before {
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.16), transparent 62%);
}

.market-view p,
.sector-note p,
.debate li span,
.signal-block li,
.selected-result p,
.strategy-card-main p,
.library-expert-strip p {
  color: rgba(248, 247, 255, 0.64);
}

.rag-factor-tags span,
.rag-citations span,
.expert-evidence span,
.candidate-tags span {
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(192, 132, 252, 0.22);
  color: rgba(233, 213, 255, 0.86);
}

.rag-evidence code,
.strategy-editor input,
.strategy-editor textarea {
  background: rgba(0, 0, 0, 0.36);
  border-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.discussion-log {
  background:
    radial-gradient(circle at 18% 0%, rgba(168, 85, 247, 0.14), transparent 30%),
    rgba(255, 255, 255, 0.045);
  border-radius: 30px;
}

.expert-avatar {
  background: linear-gradient(145deg, #c084fc, #7c3aed);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 36px rgba(168, 85, 247, 0.24);
}

.expert-comment.right .expert-avatar {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.expert-bubble,
.expert-comment.right .expert-bubble {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.088), rgba(255, 255, 255, 0.045)),
    rgba(8, 8, 12, 0.82);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.expert-comment p {
  color: rgba(248, 247, 255, 0.74);
}

.expert-comment li {
  color: rgba(248, 247, 255, 0.52);
}

.discussion-summary {
  background:
    linear-gradient(135deg, rgba(168, 85, 247, 0.28), rgba(11, 11, 16, 0.96) 46%),
    #0a0a0e;
  border-color: rgba(192, 132, 252, 0.24);
}

.candidate-card,
.candidate-card.passed {
  border-radius: 26px;
}

.candidate-card.passed {
  background:
    linear-gradient(145deg, rgba(16, 185, 129, 0.1), rgba(255, 255, 255, 0.045)),
    rgba(7, 7, 10, 0.8);
}

.candidate-pass,
.library-pass {
  background: rgba(16, 185, 129, 0.13);
  color: #34d399;
}

.candidate-fail,
.library-review {
  background: rgba(251, 113, 133, 0.12);
  color: #fda4af;
}

.gate-checks strong {
  color: #34d399;
}

.gate-checks .failed strong {
  color: #fda4af;
}

.selected-result {
  border-left-color: #a855f7;
}

.strategy-card-actions button,
.strategy-editor button,
.compare-toggle,
.library-actions,
.library-filter,
.library-holdings span {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.095);
  color: rgba(255, 255, 255, 0.78);
}

.strategy-card-actions button:hover,
.strategy-editor button:hover,
.library-filter:hover {
  background: rgba(168, 85, 247, 0.14);
  color: #ffffff;
}

.compare-toggle span {
  color: rgba(255, 255, 255, 0.76);
}

.library-filter.active {
  background: linear-gradient(135deg, #c084fc, #a855f7);
  color: #ffffff;
  box-shadow: 0 14px 32px rgba(168, 85, 247, 0.28);
}

.library-hero,
.library-controlbar,
.strategy-compare-shell {
  background:
    radial-gradient(circle at 74% 22%, rgba(168, 85, 247, 0.18), transparent 28%),
    rgba(255, 255, 255, 0.045);
}

.chart-stack > div,
.chart-card,
.selected-chart-block,
.optimization-chart-block {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.066), rgba(255, 255, 255, 0.035)),
    rgba(7, 7, 10, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 24px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.flow-step.error .step-content {
  background:
    linear-gradient(145deg, rgba(251, 113, 133, 0.12), rgba(255, 255, 255, 0.045)),
    rgba(8, 8, 12, 0.88);
  border-color: rgba(251, 113, 133, 0.3);
}

@media (max-width: 820px) {
  .research-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .research-summary span:nth-child(3) {
    border-left: 0;
  }
}

/* Final dark-surface corrections for generated strategy cards and stock previews */
.strategy-lines {
  gap: 14px;
}

.strategy-lines > div {
  background:
    radial-gradient(circle at 92% 12%, rgba(192, 132, 252, 0.16), transparent 32%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.082), rgba(255, 255, 255, 0.035)),
    rgba(8, 8, 12, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.105);
  border-radius: 24px;
  box-shadow:
    0 18px 54px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: rgba(248, 247, 255, 0.84);
  min-height: 148px;
  overflow: hidden;
  position: relative;
}

.strategy-lines > div::before {
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.34), transparent 62%);
  content: "";
  height: 1px;
  inset: 0 18px auto;
  opacity: 0.75;
  position: absolute;
}

.strategy-lines span {
  color: rgba(233, 213, 255, 0.72);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.03em;
  margin-bottom: 10px;
}

.strategy-lines ul {
  color: rgba(248, 247, 255, 0.78);
  font-size: clamp(14px, 1.45vw, 16px);
  line-height: 1.7;
  padding-left: 16px;
}

.strategy-lines li::marker {
  color: rgba(192, 132, 252, 0.86);
  font-size: 0.8em;
}

.strategy-lines p {
  color: rgba(248, 247, 255, 0.78);
  font-size: clamp(14px, 1.45vw, 16px);
  line-height: 1.68;
  margin: 0;
}

.step-content details summary {
  color: #c084fc;
  margin-top: 18px;
  text-shadow: 0 0 22px rgba(168, 85, 247, 0.28);
}

.stock-preview {
  background:
    radial-gradient(circle at 86% 8%, rgba(168, 85, 247, 0.24), transparent 31%),
    radial-gradient(circle at 8% 100%, rgba(59, 130, 246, 0.13), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.092), rgba(255, 255, 255, 0.042)),
    rgba(6, 6, 9, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow:
    0 28px 94px rgba(0, 0, 0, 0.58),
    0 0 0 1px rgba(168, 85, 247, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: rgba(248, 247, 255, 0.9);
  overflow: hidden;
}

.stock-preview::before {
  background: linear-gradient(90deg, rgba(192, 132, 252, 0.42), transparent 58%);
  content: "";
  height: 1px;
  inset: 0 18px auto;
  position: absolute;
}

.stock-preview-head span {
  color: rgba(233, 213, 255, 0.66);
}

.stock-preview-head strong {
  color: #ffffff;
}

.stock-preview-head em,
.stock-preview-note {
  color: rgba(248, 247, 255, 0.56);
}

.stock-preview-head b {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(248, 247, 255, 0.88);
}

.stock-preview-head b.up {
  background: rgba(16, 185, 129, 0.13);
  border-color: rgba(16, 185, 129, 0.22);
  color: #34d399;
}

.stock-preview-head b.down {
  background: rgba(251, 113, 133, 0.12);
  border-color: rgba(251, 113, 133, 0.22);
  color: #fb7185;
}

.stock-preview-chart {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.018)),
    rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 24px;
}

.forecast-panel {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.072), rgba(255, 255, 255, 0.032)),
    rgba(0, 0, 0, 0.26);
  border: 1px solid rgba(255, 255, 255, 0.085);
}

.forecast-panel > span {
  color: rgba(233, 213, 255, 0.66);
}

.forecast-panel p {
  background:
    linear-gradient(145deg, rgba(168, 85, 247, 0.11), rgba(255, 255, 255, 0.035)),
    rgba(9, 9, 13, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.075);
}

.forecast-panel strong,
.forecast-panel em {
  color: #ffffff;
}

.forecast-panel small {
  color: rgba(248, 247, 255, 0.5);
}

.preview-skeleton span {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 0%, rgba(192, 132, 252, 0.18) 45%, rgba(255, 255, 255, 0.045) 100%),
    rgba(255, 255, 255, 0.04);
  background-size: 220% 100%;
}

/* Dark audit surface lock: removes leftover light-theme grey blocks. */
.risk-audit,
.integrity-report,
.oos-report,
.position-review {
  background:
    radial-gradient(circle at 5% 0%, rgba(168, 85, 247, 0.15), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.028)),
    rgba(7, 7, 11, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.105);
  border-radius: 26px;
  box-shadow:
    0 18px 56px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.risk-audit .audit-section-head span,
.integrity-report .audit-section-head span,
.oos-report .audit-section-head span,
.position-review .audit-section-head span,
.risk-stress span {
  color: rgba(233, 213, 255, 0.58);
}

.risk-audit .audit-section-head strong,
.integrity-report .audit-section-head strong,
.oos-report .audit-section-head strong,
.position-review .audit-section-head strong {
  color: rgba(255, 255, 255, 0.92);
}

.risk-checks div,
.integrity-check,
.oos-grid div,
.position-review-line {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.062), rgba(255, 255, 255, 0.026)),
    rgba(10, 10, 15, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.085);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
  color: rgba(248, 247, 255, 0.84);
}

.risk-checks div:hover,
.integrity-check:hover,
.oos-grid div:hover,
.position-review-line:hover {
  background:
    linear-gradient(145deg, rgba(168, 85, 247, 0.12), rgba(255, 255, 255, 0.035)),
    rgba(12, 11, 17, 0.86);
  border-color: rgba(192, 132, 252, 0.18);
}

.risk-checks span,
.risk-checks small,
.risk-stress li,
.integrity-check span,
.integrity-check small,
.oos-grid span,
.oos-grid small,
.position-review-line small,
.position-review-line p,
.position-review-line em,
.audit-note {
  color: rgba(248, 247, 255, 0.56);
}

.risk-checks strong,
.integrity-check strong,
.oos-grid strong,
.position-review-line strong {
  color: #34d399;
}

.risk-checks .failed strong,
.integrity-check.fail strong,
.position-review-line.high strong {
  color: #fb7185;
}

.risk-checks .excluded strong,
.integrity-check.warning strong,
.position-review-line.medium strong {
  color: #c084fc;
}

/* Holding rows must stay readable while the stock preview is hovered/open. */
.holding-line {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.028)),
    rgba(9, 9, 13, 0.82);
  border-color: rgba(255, 255, 255, 0.088);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.052);
  color: rgba(248, 247, 255, 0.82);
}

.holding-line:hover,
.holding-line:focus,
.holding-line:focus-visible,
.stock-holding:hover,
.stock-holding:focus,
.stock-holding:focus-visible {
  background:
    radial-gradient(circle at 0% 50%, rgba(168, 85, 247, 0.18), transparent 32%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.082), rgba(255, 255, 255, 0.035)),
    rgba(12, 11, 17, 0.92);
  border-color: rgba(192, 132, 252, 0.22);
  box-shadow:
    0 16px 42px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.holding-line strong {
  color: rgba(255, 255, 255, 0.94);
}

.holding-line span {
  color: #c084fc;
}

.holding-line em,
.holding-line small {
  color: rgba(248, 247, 255, 0.56);
}

.holding-line b {
  color: #34d399;
}

.cash-line b {
  color: #c084fc;
}

.stock-preview {
  background:
    radial-gradient(circle at 86% 8%, rgba(168, 85, 247, 0.18), transparent 31%),
    radial-gradient(circle at 8% 100%, rgba(59, 130, 246, 0.1), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.03)),
    rgba(5, 5, 8, 0.96);
  border-color: rgba(255, 255, 255, 0.12);
}

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

.chart-title-action span {
  color: inherit;
}

.rebalance-open-btn,
.rebalance-close-btn,
.rebalance-range button {
  background: rgba(168, 85, 247, 0.14);
  border: 1px solid rgba(192, 132, 252, 0.28);
  border-radius: 999px;
  color: rgba(248, 247, 255, 0.9);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 760;
  min-height: 32px;
  padding: 0 12px;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
  white-space: nowrap;
}

.rebalance-open-btn:hover,
.rebalance-close-btn:hover,
.rebalance-range button:hover {
  background: rgba(168, 85, 247, 0.22);
  border-color: rgba(192, 132, 252, 0.5);
}

.rebalance-drawer {
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  transition: opacity 180ms ease;
  z-index: 1200;
}

.rebalance-drawer.open {
  opacity: 1;
  pointer-events: auto;
}

.rebalance-drawer-backdrop {
  background: rgba(0, 0, 0, 0.56);
  border: 0;
  cursor: pointer;
  inset: 0;
  position: absolute;
}

.rebalance-drawer-panel {
  background:
    radial-gradient(circle at 92% 4%, rgba(168, 85, 247, 0.22), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.092), rgba(255, 255, 255, 0.042)),
    rgba(7, 7, 11, 0.96);
  border-left: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow:
    -28px 0 92px rgba(0, 0, 0, 0.46),
    inset 1px 0 0 rgba(255, 255, 255, 0.08);
  color: var(--ink);
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 16px;
  height: 100%;
  max-width: min(1120px, calc(100vw - 32px));
  overflow: hidden;
  padding: 24px;
  position: absolute;
  right: 0;
  top: 0;
  transform: translateX(100%);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
  width: 76vw;
  backdrop-filter: blur(24px);
}

.rebalance-drawer.open .rebalance-drawer-panel {
  transform: translateX(0);
}

.rebalance-drawer-head {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.rebalance-drawer-head span,
.rebalance-range span,
.rebalance-drawer-summary span,
.rebalance-history-table th,
.rebalance-history-table small,
.rebalance-reason-grid span {
  color: rgba(248, 247, 255, 0.52);
  font-size: 12px;
}

.rebalance-drawer-head strong {
  color: #ffffff;
  display: block;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.12;
  margin-top: 4px;
}

.rebalance-close-btn {
  border-radius: 999px;
  flex: 0 0 auto;
  font-size: 20px;
  min-height: 38px;
  padding: 0;
  width: 38px;
}

.rebalance-range {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(180px, 240px)) auto;
}

.rebalance-range label {
  display: grid;
  gap: 7px;
}

.rebalance-range input {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03)),
    rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  color: #ffffff;
  font: inherit;
  min-height: 40px;
  padding: 0 12px;
}

.rebalance-range input:focus {
  border-color: rgba(192, 132, 252, 0.7);
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.14);
  outline: none;
}

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

.rebalance-drawer-summary div {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.068), rgba(255, 255, 255, 0.028)),
    rgba(8, 8, 12, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.088);
  border-radius: 18px;
  padding: 13px 14px;
}

.rebalance-drawer-summary strong {
  color: #ffffff;
  display: block;
  font-size: 24px;
  margin-top: 4px;
}

.rebalance-drawer-body {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.rebalance-history-table {
  border-collapse: separate;
  border-spacing: 0 10px;
  min-width: 1040px;
  width: 100%;
}

.rebalance-history-table th {
  font-weight: 720;
  padding: 0 12px 2px;
  text-align: left;
}

.rebalance-history-table td {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.068), rgba(255, 255, 255, 0.028)),
    rgba(8, 8, 12, 0.82);
  border-bottom: 1px solid rgba(255, 255, 255, 0.085);
  border-top: 1px solid rgba(255, 255, 255, 0.085);
  color: rgba(248, 247, 255, 0.78);
  font-size: 12px;
  line-height: 1.55;
  max-width: 220px;
  padding: 12px;
  vertical-align: top;
}

.rebalance-history-table td:first-child {
  border-left: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 16px 0 0 16px;
}

.rebalance-history-table td:last-child {
  border-radius: 0 16px 16px 0;
  border-right: 1px solid rgba(255, 255, 255, 0.085);
}

.rebalance-history-table td strong,
.rebalance-history-table td span {
  color: #ffffff;
  display: block;
}

.rebalance-reason-row td {
  background: rgba(168, 85, 247, 0.08);
  border-radius: 16px;
  border: 1px solid rgba(192, 132, 252, 0.16);
  padding: 0;
}

.rebalance-reason-row details {
  margin: 0;
  padding: 12px 14px;
}

.rebalance-reason-row summary {
  color: rgba(233, 213, 255, 0.88);
  font-size: 12px;
}

.rebalance-reason-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
}

.rebalance-reason-grid > div {
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px;
}

.rebalance-reason-grid ul {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.rebalance-reason-grid li {
  display: grid;
  gap: 4px;
}

.rebalance-reason-grid strong {
  color: #ffffff;
  font-size: 12px;
}

.rebalance-reason-grid li span {
  color: rgba(248, 247, 255, 0.56);
  line-height: 1.55;
}

.rebalance-empty {
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  color: rgba(248, 247, 255, 0.62);
  padding: 18px;
}

@media (max-width: 820px) {
  .rebalance-drawer-panel {
    max-width: 100vw;
    width: 100vw;
  }

  .rebalance-range,
  .rebalance-drawer-summary,
  .rebalance-reason-grid {
    grid-template-columns: 1fr;
  }

  .chart-title-action {
    align-items: flex-start;
    flex-direction: column;
  }
}

.ml-enhancement-card {
  background:
    radial-gradient(circle at 20% 0%, rgba(168, 85, 247, 0.18), transparent 32%),
    rgba(10, 9, 15, 0.74);
  border: 1px solid rgba(192, 132, 252, 0.18);
  border-radius: 22px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
  display: grid;
  gap: 14px;
  padding: 18px;
}

.ml-enhancement-card.passed {
  border-color: rgba(52, 211, 153, 0.34);
  box-shadow: 0 24px 76px rgba(16, 185, 129, 0.08);
}

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

.ml-metrics-grid div {
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  min-width: 0;
  padding: 12px;
}

.ml-metrics-grid span {
  color: rgba(248, 247, 255, 0.52);
  display: block;
  font-size: 12px;
}

.ml-metrics-grid strong {
  color: #ffffff;
  display: block;
  font-size: 18px;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.ml-chart-block,
.ml-debate-block {
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 14px;
}

.ml-debate-block {
  display: grid;
  gap: 14px;
}

.ml-debate-block > span {
  color: rgba(233, 213, 255, 0.78);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 820px) {
  .ml-metrics-grid {
    grid-template-columns: 1fr;
  }
}

.qp-motion-card {
  background:
    radial-gradient(circle at 18% 0%, rgba(168, 85, 247, 0.18), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.028)),
    rgba(7, 7, 12, 0.9);
  border: 1px solid rgba(192, 132, 252, 0.18);
  border-radius: 22px;
  box-shadow:
    0 22px 72px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: rgba(248, 247, 255, 0.94);
  margin: 16px 0;
  overflow: hidden;
  position: relative;
}

.qp-motion-card::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 54px 54px;
  content: "";
  inset: 0;
  mask-image: radial-gradient(circle at center, #000, transparent 76%);
  opacity: 0.45;
  pointer-events: none;
  position: absolute;
}

.qp-strategy-burst {
  min-height: 500px;
}

.qp-motion-shock {
  animation: qpShock 900ms ease-out 760ms both;
  border: 1px solid rgba(168, 85, 247, 0.58);
  border-radius: 50%;
  height: 220px;
  left: 50%;
  opacity: 0;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.2);
  width: 220px;
}

.qp-burst-core {
  align-items: center;
  animation: qpCoreIn 720ms cubic-bezier(0.16, 1, 0.3, 1) 140ms both, qpPulse 1300ms ease-out 780ms both;
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 255, 255, 0.18), transparent 42%),
    linear-gradient(145deg, rgba(86, 32, 139, 0.9), rgba(8, 8, 14, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  box-shadow: 0 24px 80px rgba(124, 58, 237, 0.34);
  display: grid;
  gap: 9px;
  justify-items: center;
  left: 50%;
  min-height: 150px;
  padding: 22px;
  position: absolute;
  text-align: center;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.76);
  width: min(292px, calc(100% - 32px));
  z-index: 2;
}

.qp-burst-core span,
.qp-burst-core small,
.qp-motion-metric span,
.qp-motion-metric small,
.qp-debate-motion span,
.qp-debate-motion small,
.qp-evolution-motion span,
.qp-evolution-motion small,
.qp-ml-steps span,
.qp-ml-steps small,
.qp-final-lock span,
.qp-final-lock small {
  color: rgba(248, 247, 255, 0.56);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.45;
}

.qp-burst-core strong {
  color: #ffffff;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.08;
}

.qp-motion-metric {
  animation: qpBurstOut 980ms cubic-bezier(0.17, 0.89, 0.26, 1.18) var(--delay) both;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.03)),
    rgba(10, 10, 17, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  display: grid;
  gap: 8px;
  left: 50%;
  min-height: 96px;
  opacity: 0;
  padding: 14px;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.3);
  width: 170px;
  z-index: 3;
}

.qp-motion-metric strong {
  color: #ffffff;
  font-size: 25px;
  line-height: 1;
}

.qp-motion-metric.good strong { color: #34d399; }
.qp-motion-metric.bad strong { color: #fb7185; }
.qp-motion-metric.warn strong { color: #f59e0b; }
.qp-motion-metric.info strong { color: #22d3ee; }

.qp-funnel-motion {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.qp-funnel-row {
  align-items: center;
  animation: qpFunnelIn 700ms cubic-bezier(0.16, 1, 0.3, 1) var(--delay) both;
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.24), rgba(34, 211, 238, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  justify-self: center;
  min-height: 50px;
  opacity: 0;
  padding: 0 16px;
  transform: scaleX(0.72) translateY(14px);
  width: var(--w);
}

.qp-funnel-row span {
  color: rgba(248, 247, 255, 0.68);
  font-size: 13px;
  font-weight: 760;
}

.qp-funnel-row strong {
  color: #34d399;
  font-size: 22px;
}

.live-motion-flow {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  margin-top: 6px;
  width: min(840px, 100%);
}

.live-motion-node {
  animation: qpFadeLift 480ms ease-out var(--delay) both;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: rgba(248, 247, 255, 0.54);
  font-size: 11px;
  font-weight: 780;
  min-height: 28px;
  overflow: hidden;
  padding: 7px 8px;
  position: relative;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-motion-node.active {
  background: rgba(168, 85, 247, 0.18);
  border-color: rgba(192, 132, 252, 0.42);
  color: #ffffff;
  box-shadow: 0 0 22px rgba(168, 85, 247, 0.18);
}

.live-motion-node.active::after {
  animation: qpScan 1.2s ease-in-out infinite;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  content: "";
  inset: 0;
  position: absolute;
  transform: translateX(-100%);
}

.live-motion-node.done {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.28);
  color: rgba(209, 250, 229, 0.9);
}

.qp-motion-section-head {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 18px 18px 0;
  position: relative;
  z-index: 2;
}

.qp-motion-section-head div {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.qp-motion-section-head span,
.qp-hold-slot-title span,
.qp-market-stage span,
.qp-market-metric span,
.qp-market-signals span {
  color: rgba(248, 247, 255, 0.52);
  font-size: 12px;
  font-weight: 780;
}

.qp-motion-section-head strong {
  color: #ffffff;
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.15;
}

.qp-motion-section-head p {
  color: rgba(248, 247, 255, 0.62);
  line-height: 1.65;
  margin: 0;
  max-width: 720px;
}

.qp-motion-section-head em {
  background: rgba(168, 85, 247, 0.16);
  border: 1px solid rgba(192, 132, 252, 0.28);
  border-radius: 999px;
  color: rgba(233, 213, 255, 0.92);
  flex: 0 0 auto;
  font-style: normal;
  font-weight: 800;
  padding: 8px 12px;
}

.qp-flow-line {
  background: linear-gradient(90deg, rgba(168, 85, 247, 0), rgba(168, 85, 247, 0.72), rgba(34, 211, 238, 0.5), rgba(52, 211, 153, 0));
  height: 1px;
  margin: 18px 18px 0;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

.qp-flow-line::after {
  animation: qpLineGrow 1200ms ease-out 240ms forwards;
  background: linear-gradient(90deg, #a855f7, #22d3ee, #34d399);
  content: "";
  inset: 0;
  position: absolute;
  transform: scaleX(0);
  transform-origin: left;
}

.qp-hold-execution {
  display: grid;
  gap: 18px;
  padding-bottom: 18px;
}

.qp-hold-flow {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0 18px;
  position: relative;
  z-index: 2;
}

.qp-hold-slot {
  animation: qpFadeLift 560ms ease-out var(--delay, 120ms) both;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.025)),
    rgba(7, 7, 12, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 18px;
  min-width: 0;
  padding: 12px;
}

.qp-hold-slot.buy {
  --delay: 160ms;
  border-color: rgba(52, 211, 153, 0.22);
}

.qp-hold-slot.hold {
  --delay: 300ms;
  border-color: rgba(34, 211, 238, 0.18);
}

.qp-hold-slot.sell {
  --delay: 440ms;
  border-color: rgba(251, 113, 133, 0.2);
}

.qp-hold-slot.limit {
  --delay: 580ms;
  border-color: rgba(245, 158, 11, 0.2);
}

.qp-hold-slot-title {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.qp-hold-slot-title b {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 999px;
  color: rgba(248, 247, 255, 0.78);
  font-size: 11px;
  font-weight: 800;
  padding: 5px 8px;
}

.qp-trade-card-list {
  display: grid;
  gap: 9px;
}

.qp-trade-card {
  animation: qpTradeEnter 620ms cubic-bezier(0.16, 1, 0.3, 1) var(--delay) both;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid rgba(168, 85, 247, 0.72);
  border-radius: 14px;
  display: grid;
  gap: 6px;
  min-height: 104px;
  opacity: 0;
  padding: 11px;
  transform: translateY(14px) scale(0.98);
}

.qp-trade-card.buy {
  border-left-color: #34d399;
}

.qp-trade-card.sell {
  border-left-color: #fb7185;
}

.qp-trade-card.limit {
  border-left-color: #f59e0b;
}

.qp-trade-card > span {
  color: rgba(248, 247, 255, 0.42);
  font-size: 11px;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.qp-trade-card strong {
  color: #ffffff;
  font-size: 15px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.qp-trade-card strong em {
  color: #34d399;
  font-style: normal;
  margin-left: 4px;
}

.qp-trade-card.sell strong em,
.qp-trade-card.limit strong em {
  color: rgba(248, 247, 255, 0.62);
}

.qp-trade-card p {
  color: rgba(248, 247, 255, 0.58);
  font-size: 12px;
  line-height: 1.6;
  margin: 0;
}

.qp-hold-summary {
  display: grid;
  gap: 12px;
  grid-template-columns: 1.05fr 0.95fr;
  padding: 0 18px;
  position: relative;
  z-index: 2;
}

.qp-weight-box,
.qp-event-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 18px;
  display: grid;
  gap: 11px;
  padding: 14px;
}

.qp-weight-box h3,
.qp-event-box h3 {
  color: rgba(248, 247, 255, 0.9);
  font-size: 13px;
  margin: 0;
}

.qp-weight-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(92px, 0.8fr) minmax(120px, 1.4fr) 56px;
}

.qp-weight-row span {
  color: rgba(248, 247, 255, 0.58);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qp-weight-row i {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  display: block;
  height: 8px;
  overflow: hidden;
}

.qp-weight-row b {
  animation: qpBarFill 860ms ease-out var(--delay) forwards;
  background: linear-gradient(90deg, #a855f7, #34d399);
  border-radius: inherit;
  display: block;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left;
  width: min(var(--w), 100%);
}

.qp-weight-row strong {
  color: #ffffff;
  font-size: 12px;
  text-align: right;
}

.qp-event-feed {
  display: grid;
  gap: 8px;
}

.qp-event {
  align-items: center;
  animation: qpSlideIn 560ms ease-out var(--delay) both;
  background: rgba(255, 255, 255, 0.052);
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 14px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 10px 11px;
}

.qp-event b {
  color: #ffffff;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qp-event span {
  color: rgba(248, 247, 255, 0.56);
  font-size: 12px;
}

.qp-event em {
  color: #c084fc;
  font-size: 12px;
  font-style: normal;
  font-weight: 840;
}

.qp-market-scan {
  display: grid;
  gap: 18px;
  padding-bottom: 18px;
}

.qp-market-stages {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0 18px;
  position: relative;
  z-index: 2;
}

.qp-market-stage {
  animation: qpStageSweep 680ms ease-out var(--delay) both;
  background:
    linear-gradient(145deg, rgba(168, 85, 247, 0.14), rgba(255, 255, 255, 0.028)),
    rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 16px;
  display: grid;
  gap: 7px;
  min-height: 102px;
  overflow: hidden;
  padding: 13px;
  position: relative;
}

.qp-market-stage::after {
  animation: qpScan 1400ms ease-in-out calc(var(--delay) + 280ms) both;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  content: "";
  inset: 0;
  position: absolute;
  transform: translateX(-100%);
}

.qp-market-stage strong {
  color: #ffffff;
  font-size: 18px;
  line-height: 1.2;
}

.qp-market-stage small {
  color: rgba(248, 247, 255, 0.56);
  font-size: 12px;
  line-height: 1.55;
}

.qp-market-center {
  align-items: center;
  display: grid;
  gap: 18px;
  grid-template-columns: 260px minmax(0, 1fr);
  padding: 0 18px;
  position: relative;
  z-index: 2;
}

.qp-regime-core {
  animation: qpCoreInCenter 720ms ease-out 520ms both, qpPulseSoft 1500ms ease-out 1040ms both;
  background:
    linear-gradient(145deg, rgba(168, 85, 247, 0.22), rgba(10, 10, 16, 0.94)),
    rgba(10, 10, 16, 0.94);
  border: 1px solid rgba(192, 132, 252, 0.28);
  border-radius: 22px;
  box-shadow: 0 0 42px rgba(168, 85, 247, 0.16);
  display: grid;
  gap: 7px;
  min-height: 196px;
  padding: 22px;
  place-items: center;
  text-align: center;
}

.qp-regime-core.bull {
  border-color: rgba(52, 211, 153, 0.34);
}

.qp-regime-core.bear {
  border-color: rgba(251, 113, 133, 0.34);
}

.qp-regime-core span,
.qp-regime-core small {
  color: rgba(248, 247, 255, 0.58);
  font-size: 12px;
  font-weight: 760;
}

.qp-regime-core strong {
  color: #ffffff;
  font-size: 34px;
  line-height: 1;
}

.qp-regime-core b {
  color: #c084fc;
  font-size: 15px;
}

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

.qp-market-metric {
  animation: qpFadeLift 520ms ease-out var(--delay) both;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  display: grid;
  gap: 8px;
  min-height: 92px;
  padding: 13px;
}

.qp-market-metric strong {
  color: #ffffff;
  font-size: 20px;
}

.qp-market-metric.good strong {
  color: #34d399;
}

.qp-market-metric.warn strong {
  color: #f59e0b;
}

.qp-market-metric.bad strong {
  color: #fb7185;
}

.qp-market-signals {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0 18px;
  position: relative;
  z-index: 2;
}

.qp-market-signals div {
  animation: qpTradeEnter 620ms ease-out var(--delay) both;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 16px;
  display: grid;
  gap: 7px;
  min-height: 112px;
  padding: 13px;
}

.qp-market-signals strong {
  color: #ffffff;
  font-size: 18px;
}

.qp-market-signals p {
  color: rgba(248, 247, 255, 0.58);
  font-size: 12px;
  line-height: 1.6;
  margin: 0;
}

.qp-debate-motion {
  align-items: center;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) 190px minmax(0, 1fr);
  padding: 18px;
}

.qp-debate-side {
  animation: qpSlideIn 620ms ease-out both;
}

.qp-debate-side.bull {
  --from: -24px;
  animation-delay: 150ms;
}

.qp-debate-side.bear {
  --from: 24px;
  animation-delay: 420ms;
}

.qp-debate-motion .metric,
.qp-evolution-motion .metric,
.qp-ml-steps .metric {
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

.qp-debate-verdict {
  animation: qpCoreInCenter 680ms ease-out 920ms both;
  background: rgba(24, 20, 36, 0.9);
  border: 1px solid rgba(192, 132, 252, 0.28);
  border-radius: 20px;
  box-shadow: 0 0 38px rgba(168, 85, 247, 0.16);
  display: grid;
  gap: 8px;
  min-height: 154px;
  place-items: center;
  padding: 18px;
  text-align: center;
}

.qp-debate-verdict strong {
  color: #ffffff;
  font-size: 22px;
}

.qp-evolution-motion {
  align-items: center;
  display: grid;
  gap: 18px;
  grid-template-columns: 170px minmax(0, 1fr) 190px;
  padding: 18px;
}

.qp-evolution-base,
.qp-evolution-winner,
.qp-evolution-candidates .metric {
  animation: qpFadeLift 600ms ease-out var(--delay, 160ms) both;
}

.qp-evolution-candidates {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  position: relative;
}

.qp-evolution-candidates::before {
  animation: qpLineGrow 900ms ease-out 440ms forwards;
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.08), rgba(168, 85, 247, 0.72), rgba(52, 211, 153, 0.42));
  content: "";
  height: 2px;
  left: -18px;
  position: absolute;
  right: -18px;
  top: 50%;
  transform: scaleX(0);
  transform-origin: left;
  z-index: 0;
}

.qp-evolution-candidates .metric,
.qp-evolution-base,
.qp-evolution-winner {
  position: relative;
  z-index: 1;
}

.qp-evolution-motion .winner {
  border-color: rgba(52, 211, 153, 0.34);
  box-shadow: 0 0 34px rgba(52, 211, 153, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.qp-ml-scan-motion {
  align-items: center;
  display: grid;
  gap: 18px;
  grid-template-columns: 1.05fr 0.95fr;
  padding: 18px;
}

.qp-ml-matrix {
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(6, 1fr);
  min-height: 210px;
  overflow: hidden;
  padding: 18px;
  position: relative;
}

.qp-ml-matrix::after {
  animation: qpScanDown 2500ms ease-in-out 420ms infinite;
  background: linear-gradient(180deg, transparent, rgba(34, 211, 238, 0.24), transparent);
  content: "";
  height: 62px;
  inset: -70px 0 auto;
  position: absolute;
}

.qp-ml-matrix span {
  animation: qpCellFlash 1100ms ease-out var(--delay) both;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 8px;
  min-height: 28px;
}

.qp-ml-steps {
  display: grid;
  gap: 10px;
}

.qp-ml-steps .metric {
  animation: qpSlideIn 560ms ease-out var(--delay) both;
}

.qp-rebalance-timeline {
  min-height: 280px;
  padding: 18px 24px;
}

.qp-timeline-line {
  background: rgba(255, 255, 255, 0.08);
  height: 2px;
  left: 28px;
  overflow: hidden;
  position: absolute;
  right: 28px;
  top: 160px;
}

.qp-timeline-line::after {
  animation: qpLineGrow 1700ms ease-out 260ms forwards;
  background: linear-gradient(90deg, #a855f7, #22d3ee, #34d399);
  content: "";
  inset: 0;
  position: absolute;
  transform: scaleX(0);
  transform-origin: left;
}

.qp-timeline-event {
  animation: qpEventPop 620ms ease-out var(--delay) both;
  left: var(--left);
  opacity: 0;
  position: absolute;
  top: 44px;
  transform: translate(-50%, 18px);
  width: 152px;
}

.qp-timeline-event::after {
  background: rgba(168, 85, 247, 0.52);
  content: "";
  height: 28px;
  left: 50%;
  position: absolute;
  top: 100%;
  width: 2px;
}

.qp-timeline-event .metric {
  background: rgba(255, 255, 255, 0.055);
  color: #ffffff;
}

.qp-final-lock {
  display: grid;
  min-height: 220px;
  place-items: center;
  padding: 24px;
}

.qp-lock-core {
  animation: qpCoreInCenter 720ms ease-out 180ms both, qpPulseSoft 1400ms ease-out 960ms both;
  background:
    radial-gradient(circle at 50% 0%, rgba(52, 211, 153, 0.16), transparent 46%),
    rgba(12, 12, 18, 0.92);
  border: 1px solid rgba(52, 211, 153, 0.32);
  border-radius: 24px;
  box-shadow: 0 0 44px rgba(52, 211, 153, 0.12);
  display: grid;
  gap: 10px;
  max-width: 560px;
  padding: 24px;
  text-align: center;
  width: 100%;
}

.qp-lock-core strong {
  color: #34d399;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.12;
}

@keyframes qpCoreIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.74);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    filter: blur(0);
  }
}

@keyframes qpShock {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2);
  }
  18% {
    opacity: 0.8;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2.5);
  }
}

@keyframes qpPulse {
  from {
    box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.44), 0 24px 80px rgba(124, 58, 237, 0.34);
  }
  to {
    box-shadow: 0 0 0 30px rgba(168, 85, 247, 0), 0 24px 80px rgba(124, 58, 237, 0.34);
  }
}

@keyframes qpPulseSoft {
  from {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.32), 0 0 44px rgba(52, 211, 153, 0.12);
  }
  to {
    box-shadow: 0 0 0 28px rgba(52, 211, 153, 0), 0 0 44px rgba(52, 211, 153, 0.12);
  }
}

@keyframes qpBurstOut {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.32);
    filter: blur(10px);
  }
  64% {
    opacity: 1;
    transform: translate(calc(-50% + var(--x) * 1.04), calc(-50% + var(--y) * 1.04)) scale(1.04);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1);
    filter: blur(0);
  }
}

@keyframes qpFunnelIn {
  to {
    opacity: 1;
    transform: scaleX(1) translateY(0);
  }
}

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

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

@keyframes qpScan {
  to {
    transform: translateX(100%);
  }
}

@keyframes qpSlideIn {
  from {
    opacity: 0;
    transform: translateX(var(--from, 18px));
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes qpCoreInCenter {
  from {
    opacity: 0;
    transform: scale(0.86);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}

@keyframes qpLineGrow {
  to {
    transform: scaleX(1);
  }
}

@keyframes qpScanDown {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  20%, 82% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(280px);
  }
}

@keyframes qpCellFlash {
  0% {
    opacity: 0;
    transform: scale(0.72);
  }
  44% {
    opacity: 1;
    background: rgba(34, 211, 238, 0.24);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes qpEventPop {
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes qpTradeEnter {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  70% {
    opacity: 1;
    transform: translateY(-2px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes qpStageSweep {
  from {
    opacity: 0;
    transform: translateY(16px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes qpBarFill {
  to {
    transform: scaleX(1);
  }
}

@keyframes qpRiskSweep {
  0%, 28% {
    opacity: 0;
    transform: translateX(-100%);
  }
  42%, 74% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(100%);
  }
}

@keyframes qpRiskSpark {
  0%, 100% {
    opacity: 0.68;
    filter: blur(0);
    transform: translateX(-50%) scaleX(0.82);
  }
  50% {
    opacity: 1;
    filter: blur(0.4px);
    transform: translateX(-50%) scaleX(1.08);
  }
}

@keyframes qpRiskPanelConfirm {
  0% {
    box-shadow:
      0 26px 80px rgba(0, 0, 0, 0.32),
      0 0 0 1px rgba(168, 85, 247, 0.07),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }
  38% {
    box-shadow:
      0 30px 92px rgba(0, 0, 0, 0.36),
      0 0 0 1px rgba(216, 180, 254, 0.34),
      0 0 46px rgba(168, 85, 247, 0.22),
      inset 0 1px 0 rgba(255, 255, 255, 0.16);
  }
  100% {
    box-shadow:
      0 26px 80px rgba(0, 0, 0, 0.32),
      0 0 0 1px rgba(168, 85, 247, 0.07),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }
}

@keyframes qpRiskGlowPop {
  0% {
    opacity: 0;
    transform: scale(0.68);
  }
  62% {
    opacity: 0.95;
    transform: scale(1.08);
  }
  100% {
    opacity: 0.72;
    transform: scale(1);
  }
}

@keyframes qpRiskPulse {
  from {
    opacity: 0.88;
    transform: scale(0.96);
  }
  to {
    opacity: 0;
    transform: scale(1.04);
  }
}

@keyframes qpControlRail {
  0% {
    transform: translateX(-80%);
  }
  100% {
    transform: translateX(240%);
  }
}

@keyframes qpAgentRail {
  0%,
  16% {
    transform: translateX(-76%);
  }
  74%,
  100% {
    transform: translateX(240%);
  }
}

@keyframes qpAgentScan {
  0%,
  22% {
    transform: translateY(-20%);
  }
  66%,
  100% {
    transform: translateY(158%);
  }
}

@keyframes qpAgentNodeIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes qpStatusBlink {
  0%,
  100% {
    opacity: 0.56;
    transform: scale(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(1.18);
  }
}

@keyframes qpBoardSweep {
  0%,
  42% {
    transform: translateX(-105%);
  }
  72%,
  100% {
    transform: translateX(105%);
  }
}

@keyframes qpRadarSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes qpSignalFill {
  0%,
  100% {
    opacity: 0.58;
    transform: translateX(-4%) scaleX(0.78);
    transform-origin: left;
  }
  50% {
    opacity: 1;
    transform: translateX(0) scaleX(1);
    transform-origin: left;
  }
}

@media (max-width: 920px) {
  .qp-strategy-burst {
    min-height: 640px;
  }

  .qp-motion-metric {
    width: 142px;
  }

  .qp-motion-metric.metric-one {
    --x: -86px !important;
    --y: -190px !important;
  }

  .qp-motion-metric.metric-two {
    --x: 86px !important;
    --y: -190px !important;
  }

  .qp-motion-metric.metric-three {
    --x: -86px !important;
    --y: 178px !important;
  }

  .qp-motion-metric.metric-four {
    --x: 86px !important;
    --y: 178px !important;
  }

  .qp-motion-metric.metric-five {
    --x: 0px !important;
    --y: 250px !important;
  }

  .live-motion-flow,
  .qp-debate-motion,
  .qp-evolution-motion,
  .qp-ml-scan-motion,
  .risk-preference-track,
  .prompt-builder-grid,
  .qp-hold-flow,
  .qp-hold-summary,
  .qp-market-stages,
  .qp-market-center,
  .qp-market-metrics,
  .qp-market-signals {
    grid-template-columns: 1fr;
  }

  .live-motion-flow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .qp-evolution-candidates {
    grid-template-columns: 1fr;
  }

  .qp-evolution-candidates::before {
    display: none;
  }

  .qp-rebalance-timeline {
    display: grid;
    gap: 10px;
    min-height: auto;
  }

  .qp-timeline-line {
    display: none;
  }

  .qp-timeline-event {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    width: 100%;
  }

  .qp-timeline-event::after {
    display: none;
  }

  .qp-funnel-row {
    width: 100%;
  }

  .qp-motion-section-head {
    flex-direction: column;
  }

  .qp-motion-section-head em {
    justify-self: start;
  }

  .qp-weight-row {
    grid-template-columns: minmax(76px, 0.8fr) minmax(92px, 1.1fr) 54px;
  }

  .qp-market-center {
    gap: 12px;
  }

  .risk-preference-head,
  .prompt-builder-head,
  .prompt-builder-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .strategy-entry-stack {
    gap: 14px;
  }

  .prompt-builder-actions > div {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  html:not(.qp-demo-motion) .qp-motion-card *,
  html:not(.qp-demo-motion) .strategy-entry-stack > *,
  html:not(.qp-demo-motion) .live-motion-node {
    animation: none !important;
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
  }

  html:not(.qp-demo-motion) .risk-preference-panel.preference-switched {
    animation: none !important;
  }

  html:not(.qp-demo-motion) .qp-motion-shock,
  html:not(.qp-demo-motion) .qp-motion-card::before,
  html:not(.qp-demo-motion) .live-motion-node.active::after,
  html:not(.qp-demo-motion) .qp-ml-matrix::after,
  html:not(.qp-demo-motion) .risk-preference-panel::after,
  html:not(.qp-demo-motion) .risk-preference-energy span,
  html:not(.qp-demo-motion) .risk-pref-card:has(input:checked)::before,
  html:not(.qp-demo-motion) .risk-pref-card:has(input:checked)::after,
  html:not(.qp-demo-motion) .qp-flow-line::after,
  html:not(.qp-demo-motion) .qp-market-stage::after,
  html:not(.qp-demo-motion) .qp-timeline-line::after,
  html:not(.qp-demo-motion) .qp-timeline-event::after {
    display: none !important;
  }
}

/* High-contrast dark surface patch: keep the dark-purple style, but make controls and generated results readable. */
.builder-chip,
.builder-clear-btn,
.quick-row .chip,
.chip,
.intensity-row label,
.strategy-card-actions button,
.strategy-editor button,
.compare-toggle,
.library-filter,
.rebalance-range button,
.rebalance-open-btn,
.rebalance-close-btn,
.rebalance-drawer button:not(.rebalance-drawer-backdrop),
.save-actions button:not(.primary) {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.075)),
    rgba(42, 35, 58, 0.86);
  border-color: rgba(216, 180, 254, 0.28);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.28);
}

.builder-chip:hover,
.builder-clear-btn:hover,
.quick-row .chip:hover,
.chip:hover,
.intensity-row label:hover,
.strategy-card-actions button:hover,
.strategy-editor button:hover,
.compare-toggle:hover,
.library-filter:hover,
.rebalance-range button:hover,
.rebalance-open-btn:hover,
.rebalance-close-btn:hover,
.rebalance-drawer button:not(.rebalance-drawer-backdrop):hover,
.save-actions button:not(.primary):hover {
  background:
    linear-gradient(135deg, rgba(168, 85, 247, 0.34), rgba(34, 211, 238, 0.1)),
    rgba(65, 46, 91, 0.94);
  border-color: rgba(216, 180, 254, 0.56);
  box-shadow:
    0 16px 38px rgba(168, 85, 247, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.builder-clear-btn {
  border-color: rgba(251, 113, 133, 0.28);
  color: rgba(255, 228, 230, 0.9);
}

.builder-clear-btn:hover {
  background:
    linear-gradient(135deg, rgba(251, 113, 133, 0.28), rgba(168, 85, 247, 0.12)),
    rgba(62, 31, 45, 0.92);
  border-color: rgba(251, 113, 133, 0.58);
  color: #ffffff;
}

.input-toolbar .primary,
.primary,
.builder-generate-btn,
.journey-btn {
  background:
    linear-gradient(135deg, #e879f9 0%, #a855f7 46%, #6d28d9 100%);
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow:
    0 18px 48px rgba(168, 85, 247, 0.48),
    0 0 0 1px rgba(216, 180, 254, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.36);
  color: #ffffff;
  text-shadow: 0 1px 0 rgba(40, 0, 80, 0.34);
}

.input-toolbar .primary:hover,
.primary:hover,
.builder-generate-btn:hover,
.journey-btn:hover {
  filter: saturate(1.08) brightness(1.06);
  box-shadow:
    0 22px 58px rgba(168, 85, 247, 0.58),
    0 0 0 1px rgba(216, 180, 254, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.prompt-builder-grid span,
.input-toolbar span,
.intensity-row > span,
.prompt-builder-actions > span,
.risk-preference-head span,
.risk-pref-card span,
.qp-motion-section-head span,
.qp-hold-slot-title span,
.qp-market-stage span,
.qp-market-metric span,
.qp-market-signals span {
  color: rgba(248, 247, 255, 0.76);
}

.prompt-builder-grid input,
.input-surface textarea,
.strategy-editor input,
.strategy-editor textarea,
textarea {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.07)),
    rgba(8, 8, 13, 0.62);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.96);
}

.prompt-builder-grid input::placeholder,
.input-surface textarea::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, 0.48);
}

.step-content,
.live-status,
.selected-result,
.metrics-strip div,
.allocation-summary div,
.market-grid div,
.market-audit-grid,
.market-audit-grid div,
.risk-lines div,
.score-line,
.committee-score,
.independent-experts article,
.debate > div,
.judge,
.llm-review,
.signal-block,
.strategy-brief div,
.rag-review-card,
.rag-raw-list > article,
.rag-raw-evidence,
.discussion-log,
.candidate-card,
.candidate-card.passed,
.gate-checks li,
.candidate-compare div,
.selected-compare,
.selected-chart-block,
.ml-enhancement-card,
.ml-metrics-grid div,
.ml-chart-block,
.ml-debate-block,
.qp-motion-card,
.qp-trade-card,
.qp-hold-slot,
.library-stats div,
.library-compare-metrics div,
.library-metrics div,
.strategy-compare,
.strategy-card,
.strategy-editor,
.forecast-panel p {
  background:
    radial-gradient(circle at 92% 0%, rgba(168, 85, 247, 0.14), transparent 30%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.052)),
    rgba(12, 12, 18, 0.9);
  border-color: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.9);
}

.step-content h2,
.step-content h3,
.step-content .kicker,
.live-status strong,
.chart-title,
.metrics-strip strong,
.allocation-summary strong,
.market-analysis strong,
.market-audit-grid strong,
.market-grid strong,
.risk-lines strong,
.score-line em,
.committee-score strong,
.independent-experts strong,
.debate h3,
.judge h3,
.strategy-brief p,
.rag-evidence strong,
.rag-review-head h3,
.rag-evidence p,
.candidate-lines strong,
.candidate-hypothesis,
.candidate-compare strong,
.selected-result h3,
.review-list > strong,
.library-stats strong,
.library-compare-metrics strong,
.library-metrics strong,
.strategy-card-main h3,
.library-expert-strip strong,
.ml-metrics-grid strong,
.qp-motion-section-head strong,
.qp-trade-card strong,
.qp-burst-core strong,
.qp-motion-metric strong,
.signal-block strong {
  color: #ffffff;
}

.step-content p,
.live-status p,
.market-view p,
.sector-note p,
.debate li span,
.signal-block li,
.signal-block p,
.selected-result p,
.selection-reason,
.strategy-card-main p,
.library-expert-strip p,
.candidate-change,
.candidate-lines small,
.gate-checks span,
.review-list li,
.rag-meta,
.rag-raw-evidence summary,
.rag-objections li,
.expert-comment p,
.expert-comment li,
.ml-debate-block > span,
.qp-motion-section-head p,
.qp-trade-card p,
.qp-motion-metric span,
.qp-motion-metric small,
.qp-burst-core span,
.qp-burst-core small {
  color: rgba(248, 247, 255, 0.74);
}

.metrics-strip span,
.allocation-summary span,
.market-analysis span,
.market-audit-grid span,
.risk-lines span,
.score-line small,
.committee-score span,
.committee-score small,
.independent-experts span,
.independent-experts li,
.debate span,
.judge span,
.llm-review > span,
.signal-block span,
.strategy-brief span,
.rag-review-head span,
.rag-factor-tags span,
.rag-citations span,
.candidate-lines span,
.candidate-compare span,
.library-stats span,
.library-compare-metrics span,
.library-compare-metrics small,
.library-metrics span,
.strategy-card small,
.strategy-card-main span,
.library-holdings span,
.library-expert-strip span,
.ml-metrics-grid span,
.qp-trade-card > span {
  color: rgba(248, 247, 255, 0.68);
}

.rag-factor-tags span,
.rag-citations span,
.expert-evidence span,
.candidate-tags span,
.library-holdings span,
.qp-hold-slot-title b,
.live-motion-node {
  background: rgba(168, 85, 247, 0.18);
  border-color: rgba(216, 180, 254, 0.3);
  color: rgba(255, 255, 255, 0.86);
}

.rag-coverage-summary {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
  padding: 7px 11px;
  border-radius: 999px;
  color: rgba(236, 229, 255, 0.9);
  background: rgba(151, 95, 255, 0.15);
  border: 1px solid rgba(187, 141, 255, 0.26);
}

.rag-factor-coverage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.rag-factor-coverage {
  padding: 11px 12px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 94% 0%, rgba(168, 85, 247, 0.12), transparent 32%),
    rgba(14, 14, 22, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.rag-factor-coverage.direct,
.rag-factor-coverage.family,
.rag-factor-coverage.market_fit {
  border-color: rgba(118, 231, 196, 0.25);
}

.rag-factor-coverage.proxy,
.rag-factor-coverage.risk,
.rag-factor-coverage.methodology {
  border-color: rgba(187, 141, 255, 0.26);
}

.rag-factor-coverage.weak,
.rag-factor-coverage.insufficient {
  border-color: rgba(255, 190, 125, 0.3);
}

.rag-factor-coverage div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.rag-factor-coverage strong {
  color: rgba(255, 255, 255, 0.94);
  font-size: 0.95rem;
}

.rag-factor-coverage span {
  flex: 0 0 auto;
  color: rgba(213, 194, 255, 0.88);
  font-size: 0.78rem;
}

.rag-factor-coverage p {
  margin: 0;
  color: rgba(224, 218, 238, 0.8);
  font-size: 0.84rem;
  line-height: 1.55;
}

.candidate-pass,
.library-pass,
.gate-checks strong,
.qp-trade-card.buy strong em {
  color: #6ee7b7;
}

.candidate-fail,
.library-review,
.gate-checks .failed strong {
  color: #fda4af;
}

.selected-result {
  border-left-color: #c084fc;
  box-shadow:
    0 20px 64px rgba(0, 0, 0, 0.24),
    inset 4px 0 0 rgba(192, 132, 252, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.flow .empty-state {
  border-radius: 0;
  min-height: 240px;
  padding: 64px clamp(28px, 4vw, 64px);
}

.flow .empty-state h2,
.flow .empty-state p {
  max-width: 900px;
}

/* Final readability pass for optimization and expert-review result blocks. */
.optimization-summary-panel {
  background:
    radial-gradient(circle at 92% 0%, rgba(168, 85, 247, 0.16), transparent 32%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.052)),
    rgba(10, 10, 16, 0.92);
  border: 1px solid rgba(216, 180, 254, 0.16);
  border-radius: 24px;
  box-shadow:
    0 22px 72px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 14px;
  padding: 18px;
}

.optimization-summary-head {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.optimization-summary-head div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.optimization-summary-head span,
.optimization-summary-grid span {
  color: rgba(248, 247, 255, 0.68);
  font-size: 12px;
  font-weight: 760;
}

.optimization-summary-head strong {
  color: #fff;
  font-size: clamp(18px, 1.8vw, 24px);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

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

.optimization-summary-grid article {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.045)),
    rgba(7, 7, 12, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  display: grid;
  gap: 7px;
  min-height: 96px;
  padding: 13px;
}

.optimization-summary-grid strong {
  color: #fff;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1;
}

.optimization-summary-grid small,
.optimization-summary-panel p {
  color: rgba(248, 247, 255, 0.72);
  font-size: 12px;
  line-height: 1.55;
}

.optimization-summary-panel p {
  margin: 0;
}

.flow-details,
.candidate-detail-drawer {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  margin-top: 16px;
  overflow: hidden;
}

.flow-details summary,
.candidate-detail-drawer summary {
  color: rgba(250, 247, 255, 0.88);
  cursor: pointer;
  font-size: 13px;
  font-weight: 760;
  list-style: none;
  padding: 13px 15px;
}

.flow-details summary::-webkit-details-marker,
.candidate-detail-drawer summary::-webkit-details-marker {
  display: none;
}

.flow-details summary::after,
.candidate-detail-drawer summary::after {
  content: "展开";
  color: rgba(194, 151, 255, 0.86);
  float: right;
  font-size: 12px;
}

.flow-details[open] summary::after,
.candidate-detail-drawer[open] summary::after {
  content: "收起";
}

.flow-details-body {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 14px;
  padding: 15px;
}

.compact-details {
  margin-top: 10px;
}

.compact-details .flow-details-body {
  padding: 12px;
}

.candidate-detail-copy {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(235, 230, 248, 0.68);
  display: grid;
  font-size: 12px;
  gap: 8px;
  line-height: 1.55;
  padding: 12px 14px 0;
}

.candidate-detail-copy p {
  margin: 0;
}

.recovery-panel,
.followup-panel {
  background:
    linear-gradient(145deg, rgba(32, 27, 45, 0.9), rgba(54, 35, 80, 0.56)),
    rgba(18, 18, 24, 0.76);
  border: 1px solid rgba(194, 151, 255, 0.18);
  border-radius: 18px;
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
}

.recovery-panel strong,
.followup-panel strong {
  color: rgba(255, 255, 255, 0.94);
  font-size: 15px;
}

.recovery-panel p,
.followup-panel p {
  color: rgba(231, 222, 250, 0.62);
  margin: 0;
}

.recovery-panel div,
.followup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.followup-panel > div:first-child {
  display: grid;
  gap: 4px;
}

.followup-panel span {
  color: rgba(194, 151, 255, 0.86);
  font-size: 12px;
  font-weight: 760;
}

.followup-panel textarea {
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.92);
  min-height: 92px;
  padding: 12px 13px;
  resize: vertical;
}

.interactive-chart {
  background: rgba(10, 10, 14, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  display: grid;
  gap: 10px;
  padding: 14px;
}

.interactive-chart .chart-title-action {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.interactive-chart .chart-title-action div {
  display: grid;
  gap: 3px;
}

.interactive-chart .chart-title-action strong {
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
}

.interactive-chart .chart-title-action small {
  color: rgba(229, 221, 246, 0.52);
  font-size: 12px;
  line-height: 1.45;
}

.chart-window-actions,
.chart-series-toggles {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chart-window-actions button {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: rgba(246, 241, 255, 0.78);
  cursor: pointer;
  font-size: 12px;
  font-weight: 720;
  padding: 7px 11px;
}

.chart-window-actions button.active,
.chart-window-actions button:hover {
  background: rgba(180, 132, 255, 0.16);
  border-color: rgba(194, 151, 255, 0.34);
  color: rgba(255, 255, 255, 0.94);
}

.chart-series-toggles label {
  align-items: center;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 999px;
  color: rgba(233, 225, 250, 0.72);
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 690;
  gap: 7px;
  padding: 7px 10px;
}

.chart-series-toggles input {
  accent-color: #b78cff;
  height: 13px;
  margin: 0;
  width: 13px;
}

.chart-series-toggles span {
  background: var(--line-color, #b78cff);
  border-radius: 999px;
  display: inline-block;
  height: 3px;
  opacity: 0.86;
  width: 18px;
}

.chart-range-slider {
  accent-color: #b78cff;
  width: 100%;
}

.chart-range-slider:disabled {
  opacity: 0.28;
}

.candidate-detail-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
}

.candidate-detail-grid div {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  display: grid;
  gap: 3px;
  padding: 10px;
}

.candidate-detail-grid span {
  color: rgba(229, 221, 246, 0.52);
  font-size: 11px;
}

.candidate-detail-grid strong {
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
}

.holding-weight-chart-shell > .chart-title-action {
  margin-bottom: 10px;
}

@media (max-width: 980px) {
  .flow-layout {
    grid-template-columns: 1fr;
  }

  .flow-nav {
    position: static;
  }

  .flow-nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .candidate-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .flow-nav-list,
  .candidate-detail-grid {
    grid-template-columns: 1fr;
  }

  .interactive-chart .chart-title-action {
    display: grid;
  }
}

.candidate-lines {
  gap: 14px;
}

.candidate-card,
.candidate-card.passed,
.baseline-line.candidate-card {
  border-radius: 22px;
}

.candidate-head {
  align-items: flex-start;
}

.candidate-head > div {
  min-width: 0;
}

.candidate-head small,
.candidate-change,
.gate-checks span {
  line-height: 1.55;
}

.candidate-tags span,
.gate-checks li,
.candidate-compare div {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.078), rgba(255, 255, 255, 0.036)),
    rgba(6, 6, 10, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.11);
}

.candidate-compare {
  grid-template-columns: repeat(4, minmax(132px, 1fr));
}

.candidate-compare div {
  border-radius: 16px;
  min-height: 104px;
  padding: 13px;
}

.candidate-compare small {
  overflow-wrap: anywhere;
}

.independent-experts article,
.independent-experts article.review,
.independent-experts article.passed {
  background:
    radial-gradient(circle at 90% 0%, rgba(168, 85, 247, 0.17), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.045)),
    rgba(10, 10, 16, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 22px;
  box-shadow:
    0 20px 64px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
}

.independent-experts article.review {
  border-color: rgba(251, 113, 133, 0.22);
}

.independent-experts article.passed {
  border-color: rgba(52, 211, 153, 0.2);
}

.independent-experts article > div:first-child {
  gap: 14px;
}

.independent-experts span {
  color: rgba(248, 247, 255, 0.72);
}

.independent-experts strong {
  color: #fff;
}

.independent-experts p {
  color: rgba(248, 247, 255, 0.82);
  line-height: 1.62;
}

.independent-experts li {
  color: rgba(248, 247, 255, 0.74);
}

.independent-experts .expert-evidence span {
  background: rgba(168, 85, 247, 0.22);
  border: 1px solid rgba(216, 180, 254, 0.34);
  color: rgba(255, 255, 255, 0.9);
}

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

@media (max-width: 760px) {
  .optimization-summary-head,
  .candidate-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .optimization-summary-grid,
  .candidate-compare,
  .gate-checks,
  .independent-experts {
    grid-template-columns: 1fr;
  }
}

.strategy-brief {
  align-items: stretch;
  gap: 12px;
  margin-top: 14px;
}

.strategy-brief div {
  align-content: start;
  border-radius: 20px;
  gap: 9px;
  min-height: 0;
  padding: 18px 20px;
}

.strategy-brief span {
  color: rgba(248, 247, 255, 0.76);
  font-weight: 760;
}

.strategy-brief p {
  color: rgba(248, 247, 255, 0.84);
  font-size: 14px;
  line-height: 1.62;
}

/* Visual consistency pass: one rounded glass language across the demo. */
body,
button,
input,
select,
textarea {
  font-family: var(--font-ui);
}

.brand strong,
.hero-copy h1,
.composer-copy h1,
.library-hero-copy h1 {
  font-family: var(--font-serif);
}

.topbar,
.method-panel,
.cache-maintenance,
.composer-grid,
.risk-preference-panel,
.prompt-builder,
.input-surface,
.library-section,
.library-hero,
.library-controlbar,
.strategy-compare-shell,
.flow-shell,
.step-content,
.selected-result,
.optimization-summary-panel,
.followup-panel,
.recovery-panel,
.interactive-chart,
.market-regime-card,
.chart-panel {
  background: var(--qp-glass-surface);
  border: 1px solid var(--qp-glass-border);
  border-radius: var(--qp-card-radius);
  box-shadow: var(--qp-glass-shadow);
  overflow: hidden;
}

.method-grid article,
.risk-pref-card,
.prompt-builder-grid input,
.input-surface textarea,
.intensity-row,
.intensity-row label,
.metrics-strip div,
.allocation-summary div,
.market-grid div,
.market-audit-grid,
.market-audit-grid div,
.risk-lines div,
.score-line,
.committee-score,
.independent-experts article,
.debate > div,
.judge,
.llm-review,
.portfolio-table,
.regime-line,
.holding-line,
.expert-comment,
.candidate-summary,
.gate-check,
.position-review-line > *,
.pm-votes > *,
.factor-row,
.evidence-card,
.comparison-card,
.timeline-card,
.strategy-card,
.strategy-editor,
.strategy-brief div,
.optimization-summary-grid > *,
.candidate-card,
.gate-checks li,
.rag-review-card,
.rag-factor-card,
.qp-motion-card,
.qp-hold-slot,
.qp-market-stage,
.qp-market-metric,
.qp-market-signal,
.flow .empty-state {
  border-radius: var(--qp-inner-radius);
}

.flow-nav {
  border-radius: 0;
  box-shadow: none;
}

.method-grid article,
.flow .empty-state {
  border-radius: var(--qp-inner-radius);
}

.flow-step.error .step-content {
  background:
    radial-gradient(circle at 0% 0%, rgba(251, 113, 133, 0.18), transparent 34%),
    var(--qp-glass-surface);
  border-color: rgba(251, 113, 133, 0.28);
}

.recovery-panel {
  background:
    radial-gradient(circle at 90% 0%, rgba(168, 85, 247, 0.2), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.058)),
    rgba(18, 18, 24, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 28px;
  box-shadow:
    0 20px 56px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  padding: 22px;
}

.recovery-panel .primary,
.recovery-panel .secondary {
  border-radius: 999px;
  min-height: 46px;
  padding: 0 24px;
}

.recovery-panel .secondary {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.07)),
    rgba(42, 35, 58, 0.86);
  border: 1px solid rgba(216, 180, 254, 0.28);
  color: rgba(255, 255, 255, 0.88);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.recovery-panel .secondary:hover {
  background:
    linear-gradient(135deg, rgba(168, 85, 247, 0.28), rgba(255, 255, 255, 0.08)),
    rgba(65, 46, 91, 0.92);
  border-color: rgba(216, 180, 254, 0.52);
  color: #ffffff;
}

::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.38);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(192, 132, 252, 0.85), rgba(124, 58, 237, 0.62));
  border: 2px solid rgba(0, 0, 0, 0.38);
  border-radius: 999px;
}

* {
  scrollbar-color: rgba(168, 85, 247, 0.75) rgba(0, 0, 0, 0.35);
  scrollbar-width: thin;
}
