:root {
  --bg: #07100d;
  --panel: #0e1a16;
  --panel2: #13231d;
  --line: #244034;
  --text: #f3f8f5;
  --muted: #94aa9f;
  --brand: #6ee7a8;
  --brand2: #27c879;
  --amber: #f5bf62;
  --red: #ff7b7b;
  --blue: #68a9ff;
  --shadow: 0 24px 70px rgba(0,0,0,.28);
}
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); font-family: Inter, system-ui, -apple-system, sans-serif; overflow-x: clip; width: 100%; max-width: 100vw; }
body { margin: 0; background: radial-gradient(circle at 85% -10%, rgba(39,200,121,.16), transparent 32%), var(--bg); min-height: 100vh; overflow-x: clip; width: 100%; max-width: 100vw; }
a { color: inherit; }

/* LAYOUT SHELL */
.qr-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; width: 100%; max-width: 100vw; overflow-x: clip; box-sizing: border-box; }
.qr-side { padding: 22px 14px; border-right: 1px solid rgba(159, 176, 195, 0.16); background: linear-gradient(180deg, rgba(8, 14, 24, 0.98) 0%, rgba(5, 9, 16, 0.99) 100%); position: -webkit-sticky; position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow-y: auto; box-shadow: 4px 0 25px rgba(0,0,0,0.35); z-index: 99; }
.qr-brand { font-size: 20px; font-weight: 900; letter-spacing: -.5px; padding: 4px 8px 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.qr-brand span { color: var(--brand); }
.qr-side-close { display: none; }
.qr-nav { display: flex; flex-direction: column; gap: 3px; }
.qr-nav-label { color: #7b93ab; text-transform: uppercase; letter-spacing: 1.4px; font-size: 10px; font-weight: 800; margin: 16px 10px 6px; display: flex; align-items: center; gap: 6px; }
.qr-nav-label::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, 0.08); }
.qr-nav-home {
  background: rgba(40, 167, 255, 0.08) !important;
  border: 1px solid rgba(40, 167, 255, 0.22) !important;
  color: #e0f2fe !important;
  font-weight: 750 !important;
  margin-bottom: 8px !important;
}
.qr-nav-home:hover {
  background: linear-gradient(90deg, rgba(40, 167, 255, 0.22) 0%, rgba(32, 214, 163, 0.16) 100%) !important;
  border-color: rgba(56, 189, 248, 0.6) !important;
  box-shadow: 0 4px 18px rgba(40, 167, 255, 0.28) !important;
  color: #fff !important;
  transform: translateX(4px) !important;
}
.qr-nav-home.active {
  background: linear-gradient(90deg, rgba(32, 214, 163, 0.18) 0%, rgba(40, 167, 255, 0.1) 100%) !important;
  border-color: rgba(32, 214, 163, 0.45) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 20px rgba(32, 214, 163, 0.2), inset 0 0 16px rgba(32, 214, 163, 0.1) !important;
}
.qr-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  border-radius: 9px;
  text-decoration: none;
  color: #9fb0c3;
  font-weight: 600;
  font-size: 13.5px;
  margin: 2px 0;
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
.qr-nav a:hover {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(40, 167, 255, 0.14) 0%, rgba(32, 214, 163, 0.09) 100%);
  border-color: rgba(56, 189, 248, 0.38);
  transform: translateX(4px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3), inset 0 0 14px rgba(40, 167, 255, 0.08);
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
}
.qr-nav a.active {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(32, 214, 163, 0.16) 0%, rgba(40, 167, 255, 0.08) 100%);
  border: 1px solid rgba(32, 214, 163, 0.38);
  font-weight: 750;
  box-shadow: 0 4px 20px rgba(32, 214, 163, 0.16), inset 0 0 16px rgba(32, 214, 163, 0.08);
}
.qr-nav a.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14%;
  bottom: 14%;
  width: 3.5px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, #20d6a3, #28a7ff);
  box-shadow: 0 0 12px rgba(32, 214, 163, 0.9);
}
.qr-nav a span {
  font-size: 15px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
  transition: transform 0.22s ease;
}
.qr-nav a:hover span {
  transform: scale(1.15);
}
.qr-main { min-width: 0; width: 100%; max-width: 100%; overflow-x: clip; display: flex; flex-direction: column; box-sizing: border-box; }

/* HEADER - GUARANTEED UNBREAKABLE STICKY HEADER ON BOTH DESKTOP & MOBILE */
.qr-top { height: 64px; min-height: 64px; width: 100%; max-width: 100%; padding: 0 24px; border-bottom: 1px solid rgba(159, 176, 195, 0.16); display: flex; align-items: center; justify-content: space-between; background: rgba(6, 12, 20, 0.94); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); position: -webkit-sticky; position: sticky; top: 0; z-index: 1000; gap: 12px; box-sizing: border-box; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45); }
.qr-top h1 { font-size: 18px; margin: 0; font-weight: 800; }
.qr-top-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.qr-top-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* MAIN CONTENT */
.qr-content { max-width: 1360px; width: 100%; margin: 0 auto; padding: 32px 28px 60px; box-sizing: border-box; overflow-x: clip; }

@media (min-width: 1600px) {
  .qr-content { max-width: min(94%, 2200px); padding: 36px 40px 80px; }
  .grid { grid-template-columns: repeat(auto-fit, minmax(460px, 1fr)); gap: 24px; }
}

@media (min-width: 2200px) {
  .qr-content { max-width: min(96%, 3000px); padding: 42px 54px 100px; }
  .grid { grid-template-columns: repeat(auto-fit, minmax(520px, 1fr)); gap: 28px; }
  .qr-shell { grid-template-columns: 300px minmax(0, 1fr); }
}
.eyebrow { color: var(--brand); text-transform: uppercase; letter-spacing: 2px; font-size: 11px; font-weight: 900; }
.hero h2 { font-size: clamp(28px, 4.5vw, 54px); line-height: 1.08; letter-spacing: -1.5px; margin: 10px 0 14px; max-width: 820px; }
.hero p { max-width: 710px; color: var(--muted); line-height: 1.65; font-size: 15px; margin: 0; }
.notice { margin: 20px 0; padding: 14px 18px; border: 1px solid rgba(245,191,98,.32); background: rgba(245,191,98,.07); border-radius: 12px; color: #e8d3aa; font-size: 13px; line-height: 1.55; }

/* CARDS GRID */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 28px; }
.portfolio-card { display: flex; flex-direction: column; padding: 22px; background: linear-gradient(145deg, var(--panel), #0a1511); border: 1px solid var(--line); border-radius: 18px; text-decoration: none; transition: .2s; min-height: 280px; }
.portfolio-card:hover { transform: translateY(-3px); border-color: #3c755d; box-shadow: var(--shadow); }
.card-top { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.category, .status-pill, .risk { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.category { background: rgba(104,169,255,.1); color: #9bc5ff; }
.risk { background: rgba(245,191,98,.1); color: #f7ce86; }
.status-pill { background: rgba(110,231,168,.1); color: var(--brand); }

/* RISK GAUGE WITH 3-SEGMENT METER */
.risk-gauge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  letter-spacing: 0.2px;
  box-sizing: border-box;
}
.risk-meter {
  display: inline-flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 12px;
}
.risk-bar {
  width: 3.5px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.16);
  transition: all 0.2s ease;
}
.risk-bar.bar-1 { height: 6px; }
.risk-bar.bar-2 { height: 9px; }
.risk-bar.bar-3 { height: 12px; }

/* Low Risk */
.risk-gauge-low {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.32);
}
.risk-gauge-low .risk-bar.bar-1 {
  background: #34d399;
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.7);
}

/* Moderate / Medium Risk */
.risk-gauge-moderate, .risk-gauge-medium {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.32);
}
.risk-gauge-moderate .risk-bar.bar-1,
.risk-gauge-moderate .risk-bar.bar-2,
.risk-gauge-medium .risk-bar.bar-1,
.risk-gauge-medium .risk-bar.bar-2 {
  background: #fbbf24;
  box-shadow: 0 0 6px rgba(251, 191, 36, 0.7);
}

/* High / Very High Risk */
.risk-gauge-high, .risk-gauge-very-high {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.32);
}
.risk-gauge-high .risk-bar.bar-1,
.risk-gauge-high .risk-bar.bar-2,
.risk-gauge-high .risk-bar.bar-3,
.risk-gauge-very-high .risk-bar.bar-1,
.risk-gauge-very-high .risk-bar.bar-2,
.risk-gauge-very-high .risk-bar.bar-3 {
  background: #f87171;
  box-shadow: 0 0 6px rgba(248, 113, 113, 0.7);
}
.portfolio-card h3 { font-size: 21px; letter-spacing: -.5px; margin: 16px 0 6px; }
.portfolio-card p { color: var(--muted); font-size: 13.5px; line-height: 1.55; margin: 0; }
.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); color: var(--brand); font-size: 13px; font-weight: 800; }

/* 5-COLUMN RETURNS STRIP */
.returns-strip-5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 16px 0 16px; text-align: center; }
.returns-strip-5 > div { background: rgba(110,231,168,.04); border: 1px solid var(--line); border-radius: 8px; padding: 8px 3px; min-width: 0; overflow: hidden; }
.returns-strip-5 span { display: block; font-size: 9.5px; color: var(--muted); text-transform: uppercase; font-weight: 800; }
.returns-strip-5 strong { display: block; margin-top: 3px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.positive { color: var(--brand) !important; }
.negative { color: var(--red) !important; }

/* PANELS & DETAILS */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.panel + .panel { margin-top: 16px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.85fr); gap: 20px; align-items: start; width: 100%; max-width: 100%; box-sizing: border-box; }
.detail-grid > section, .detail-grid > aside { min-width: 0; width: 100%; max-width: 100%; box-sizing: border-box; }
.detail-title { font-size: clamp(22px, 4.5vw, 36px); line-height: 1.15; letter-spacing: -1px; margin: 12px 0 8px; word-break: break-word; overflow-wrap: break-word; }
.detail-copy { color: var(--muted); line-height: 1.65; font-size: 14px; word-break: break-word; }
.metric-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 20px 0; width: 100%; box-sizing: border-box; }
.metric-box {
  background: linear-gradient(145deg, rgba(13, 23, 37, 0.85) 0%, rgba(7, 14, 25, 0.95) 100%);
  border: 1px solid rgba(56, 189, 248, 0.16);
  padding: 12px 14px;
  border-radius: 11px;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.metric-box:hover {
  border-color: rgba(56, 189, 248, 0.38);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}
.metric-box small {
  display: block;
  color: #8da4be;
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.metric-box b {
  display: block;
  margin-top: 3px;
  font-size: 15.5px;
  font-weight: 900;
  color: #f8fafc;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.metric-box b.positive {
  color: #34d399 !important;
  text-shadow: 0 0 10px rgba(52, 211, 153, 0.28);
}
.metric-box b.negative {
  color: #f87171 !important;
}
.constituent { display: grid; grid-template-columns: minmax(70px, 120px) 1fr 45px; gap: 10px; align-items: center; margin: 12px 0; width: 100%; box-sizing: border-box; }
.constituent b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 7px; background: #1a3027; border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand2), var(--brand)); border-radius: 999px; }
.constituent span { text-align: right; color: var(--muted); font-size: 11.5px; font-weight: 600; }

/* HOLDINGS TABLE & LIVE BADGES */
.holdings-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(8, 15, 26, 0.7);
}
.holdings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.holdings-table th {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #8da4be;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.holdings-table td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}
.holdings-table tr:last-child td {
  border-bottom: none;
}
.holdings-table tr:hover td {
  background: rgba(56, 189, 248, 0.03);
}
.badge-change {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.badge-change.badge-pos {
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-change.badge-neg {
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* FUTURE SCENARIOS & MILESTONES */
.scenario-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0 16px;
}
.scenario-tab {
  background: rgba(14, 24, 38, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  transition: all 0.2s ease;
  color: #94a3b8;
}
.scenario-tab:hover {
  background: rgba(18, 32, 51, 0.85);
  border-color: rgba(56, 189, 248, 0.3);
}
.scenario-tab.active {
  background: linear-gradient(145deg, rgba(14, 165, 233, 0.15) 0%, rgba(13, 23, 37, 0.95) 100%);
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.2);
  color: #fff;
}
.sc-tab-icon {
  font-size: 20px;
  flex-shrink: 0;
}
.sc-tab-title {
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.sc-tab-sub {
  font-size: 11px;
  color: #38bdf8;
  font-weight: 750;
  margin-top: 2px;
}
.rec-tag {
  font-size: 8.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(32, 214, 163, 0.15);
  color: #20d6a3;
  border: 1px solid rgba(32, 214, 163, 0.35);
  text-transform: uppercase;
  font-weight: 800;
}
.scenario-hero-box {
  background: linear-gradient(145deg, rgba(10, 20, 32, 0.9) 0%, rgba(6, 13, 22, 0.95) 100%);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}
.milestone-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}
.milestone-card {
  background: rgba(14, 24, 38, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 10px;
  transition: transform 0.18s, border-color 0.18s;
}
.milestone-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.3);
}
.milestone-card-highlight {
  background: rgba(32, 214, 163, 0.07);
  border-color: rgba(32, 214, 163, 0.35);
}
.milestone-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  color: #8da4be;
  margin-bottom: 6px;
}
.milestone-head small {
  color: #34d399;
  font-size: 10px;
  font-weight: 800;
}
.milestone-val {
  font-size: 15.5px;
  font-weight: 900;
  color: #f8fafc;
  letter-spacing: -0.3px;
  margin-bottom: 4px;
}
.milestone-foot {
  font-size: 10.5px;
  color: #64748b;
}
.milestone-foot span {
  color: #cbd5e1;
  font-weight: 700;
}
.risk-suitability-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  padding: 14px 16px;
}
@media (max-width: 768px) {
  .scenario-tabs {
    grid-template-columns: 1fr;
  }
  .milestone-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* DESKTOP STICKY SIDEBAR */
@media (min-width: 901px) {
  .sticky, aside.sticky {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 74px !important;
    max-height: calc(100vh - 86px) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    scrollbar-width: thin !important;
    scrollbar-color: rgba(40, 167, 255, 0.25) transparent !important;
  }
  aside.sticky::-webkit-scrollbar {
    width: 4px;
  }
  aside.sticky::-webkit-scrollbar-thumb {
    background: rgba(40, 167, 255, 0.25);
    border-radius: 4px;
  }
}
@media (max-width: 900px) {
  .sticky, aside.sticky {
    position: static !important;
    max-height: none !important;
    overflow-y: visible !important;
  }
}

/* TABS & SLIDERS */
.tabs { display: flex; gap: 8px; margin: 12px 0 16px; width: 100%; box-sizing: border-box; }
.tab { flex: 1; min-width: 0; padding: 10px 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 9px; font-weight: 800; font-size: 12px; cursor: pointer; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: 0.15s; }
.tab.active { background: var(--brand); color: #052012; border-color: var(--brand); }
.calc-slider { width: 100%; height: 6px; border-radius: 4px; background: #1a3027; outline: none; -webkit-appearance: none; appearance: none; margin: 8px 0 12px; box-sizing: border-box; }
.calc-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--brand); cursor: pointer; box-shadow: 0 0 10px rgba(110,231,168,0.5); }
.calc-slider::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--brand); cursor: pointer; border: none; box-shadow: 0 0 10px rgba(110,231,168,0.5); }
.wide { width: 100%; box-sizing: border-box; }
.result { display: none; margin-top: 14px; width: 100%; box-sizing: border-box; }
.result.show { display: block; }
.method { padding: 14px; border-radius: 12px; background: #09140f; border: 1px solid var(--line); font-size: 12px; color: var(--muted); line-height: 1.6; word-break: break-word; overflow-wrap: anywhere; box-sizing: border-box; }
.data-window { font-size: 11.5px; color: var(--muted); line-height: 1.5; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); word-break: break-word; overflow-wrap: anywhere; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.section-heading h2 { margin: 6px 0 0; }
.compact-metrics .metric-box b { font-size: 14px; }
.qr-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(159, 176, 195, 0.2);
  color: #c8d4e3;
  font-size: 12.5px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}
.qr-back-btn:hover {
  color: #ffffff;
  border-color: rgba(40, 167, 255, 0.5);
  background: linear-gradient(90deg, rgba(40, 167, 255, 0.16), rgba(32, 214, 163, 0.1));
  box-shadow: 0 0 14px rgba(40, 167, 255, 0.28);
  transform: translateY(-1px);
}
.qr-back-btn:active {
  transform: scale(0.96);
}
.qr-top-home-btn {
  background: rgba(40, 167, 255, 0.08);
  border-color: rgba(40, 167, 255, 0.28);
  color: #38bdf8;
}
.qr-top-home-btn:hover {
  color: #ffffff;
  border-color: rgba(56, 189, 248, 0.6);
  background: linear-gradient(90deg, rgba(40, 167, 255, 0.22), rgba(32, 214, 163, 0.15));
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.4);
}
.qr-top-home-label {
  display: inline;
}
.status-pill-body {
  display: none;
}

/* BUTTONS & INPUTS */
.btn { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 10px; padding: 10px 16px; font-weight: 800; font-size: 13px; cursor: pointer; text-decoration: none; transition: 0.15s; max-width: 100%; box-sizing: border-box; }
.btn-primary { background: var(--brand); color: #052012; }
.btn-primary:hover { opacity: 0.92; }
.btn-secondary { background: var(--panel2); border: 1px solid var(--line); color: var(--text); }
.btn-secondary:hover { background: rgba(255,255,255,0.06); }
.btn-danger { background: rgba(255,123,123,.12); color: var(--red); border: 1px solid rgba(255,123,123,.25); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.input { width: 100%; padding: 10px 12px; background: #07100d; border: 1px solid var(--line); border-radius: 9px; color: var(--text); font: inherit; outline: none; }
.input:focus { border-color: var(--brand2); }
.fine { color: var(--muted); font-size: 11px; line-height: 1.5; }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.summary-card { padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; min-width: 0; }
.summary-card span { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.summary-card strong { display: block; margin-top: 6px; font-size: 21px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.good { color: var(--brand); }
.bad { color: var(--red); }
.allocation-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.allocation-table th, .allocation-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: right; }
.allocation-table th:first-child, .allocation-table td:first-child { text-align: left; }
.allocation-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th, .admin-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table th { color: var(--muted); font-size: 10.5px; text-transform: uppercase; font-weight: 800; letter-spacing: 0.5px; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rebalance-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px 0 12px; padding: 12px 14px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; box-sizing: border-box; }
.user { font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.toast { position: fixed; right: 20px; bottom: 20px; max-width: 360px; padding: 12px 16px; border-radius: 10px; background: #18382b; color: #eafff4; border: 1px solid #347559; box-shadow: var(--shadow); display: none; z-index: 100; font-size: 13px; }
.toast.show { display: block; }
.back { color: var(--muted); text-decoration: none; font-weight: 750; font-size: 13px; }
.legal { font-size: 11.5px; line-height: 1.6; color: var(--muted); border-top: 1px solid var(--line); margin-top: 24px; padding-top: 16px; }

/* MODAL DIALOG (OVERVIEW) */
.qr-modal-backdrop { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); z-index: 10000; align-items: center; justify-content: center; padding: 14px; box-sizing: border-box; }
.qr-modal-backdrop.show { display: flex; }
.qr-modal-dialog { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; width: 100%; max-width: 640px; max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 25px 80px rgba(0, 0, 0, 0.9); overflow: hidden; animation: qrModalPop 0.2s ease-out; margin: auto; }
@keyframes qrModalPop { from { opacity: 0; transform: scale(0.96) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.qr-modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); background: rgba(9, 20, 15, 0.95); gap: 10px; }
.qr-modal-head h3 { margin: 0; font-size: 18px; letter-spacing: -0.3px; }
.qr-modal-close { background: rgba(255,255,255,0.06); border: 1px solid var(--line); color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; transition: 0.15s; flex-shrink: 0; }
.qr-modal-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.12); }
.qr-modal-body { padding: 18px 20px; overflow-y: auto; flex: 1 1 auto; }
.qr-modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: rgba(9, 20, 15, 0.95); }
.modal-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 20px; }

/* MOBILE HAMBURGER & OVERLAY */
.mobile-menu-btn { display: none; width: 36px; height: 36px; align-items: center; justify-content: center; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; color: var(--text); font-size: 1.2rem; cursor: pointer; padding: 0; flex-shrink: 0; }
.mobile-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); z-index: 10000; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.mobile-overlay.show { display: block; }

/* HEADER BRAND (MOBILE ONLY WHEN SIDEBAR IS HIDDEN) */
.qr-top-brand-mobile {
  display: none;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}
.qr-top-brand-mobile img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(110,231,168,0.3));
}
.qr-top-brand-mobile span {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
  display: inline-block;
}
@media (max-width: 900px) {
  .qr-top-brand-mobile {
    display: inline-flex !important;
  }
}
@media (max-width: 600px) {
  .qr-top-brand-mobile span {
    display: none !important;
  }
}

/* RESPONSIVE BREAKPOINTS */
@media (max-width: 900px) {
  .qr-shell { display: block; width: 100%; max-width: 100vw; overflow-x: clip; }
  .qr-side {
    display: flex !important;
    flex-direction: column !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: min(84vw, 300px) !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 100001 !important;
    background: rgba(6, 11, 20, 0.98) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border-right: 1px solid rgba(40, 167, 255, 0.25) !important;
    box-shadow: 10px 0 50px rgba(0, 0, 0, 0.95) !important;
    transform: translateX(-100%) !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    padding: 20px 16px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .qr-side.show { transform: translateX(0) !important; }
  .qr-side-close {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
  }
  .qr-side-close:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ff6b6b;
  }
  .mobile-menu-btn {
    display: inline-flex !important;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(159, 176, 195, 0.2);
    border-radius: 9px;
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: all 0.2s;
  }
  .mobile-menu-btn:hover {
    background: rgba(40, 167, 255, 0.15);
    border-color: rgba(40, 167, 255, 0.4);
  }
  .mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(2, 6, 12, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100000;
  }
  .mobile-overlay.show { display: block !important; }
  .grid, .detail-grid { grid-template-columns: minmax(0, 1fr) !important; width: 100% !important; max-width: 100% !important; }
  .detail-grid > section, .detail-grid > aside { min-width: 0 !important; width: 100% !important; max-width: 100% !important; }
  .sticky { position: static; }
}

@media (max-width: 768px) {
  .qr-top {
    padding: 0 14px !important;
    height: 60px !important;
    min-height: 60px !important;
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    background: rgba(6, 12, 20, 0.96) !important;
    backdrop-filter: blur(18px) !important;
    -webkit-backdrop-filter: blur(18px) !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5) !important;
  }
  .qr-top-left { gap: 8px !important; flex-wrap: nowrap !important; }
  .qr-top-home-label { display: none !important; }
  .qr-top-home-btn { padding: 6px 10px !important; min-width: 36px !important; justify-content: center !important; }
  .status-pill-header { display: none !important; }
  .status-pill-body { display: inline-flex !important; }
  .qr-top .user,
  .qr-top-user { display: none !important; }
  .qr-top-right:empty { display: none !important; }
  .qr-content { padding: 18px 12px 50px !important; width: 100% !important; max-width: 100vw !important; overflow-x: clip !important; }
  .hero h2 { font-size: 26px !important; letter-spacing: -0.8px !important; margin: 8px 0 10px !important; line-height: 1.15 !important; }
  .hero p { font-size: 13.5px !important; }
  .grid { gap: 14px !important; margin-top: 20px !important; }
  .summary-grid { grid-template-columns: 1fr !important; gap: 8px !important; }
  .metric-row { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; }
  .allocation-table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; width: 100%; }
}

@media (max-width: 520px) {
  .qr-top {
    padding: 0 12px !important;
    height: 56px !important;
    min-height: 56px !important;
    gap: 8px !important;
    width: 100% !important;
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    background: rgba(6, 12, 20, 0.98) !important;
    backdrop-filter: blur(18px) !important;
    -webkit-backdrop-filter: blur(18px) !important;
  }
  .qr-top-left { gap: 6px !important; flex-wrap: nowrap !important; }
  .qr-top-home-btn { padding: 5px 8px !important; min-width: 32px !important; }
  .qr-back-btn { padding: 5px 9px !important; font-size: 11.5px !important; }
  .qr-top h1 { font-size: 16px !important; max-width: none !important; white-space: nowrap !important; }
  .qr-top-calc-btn { display: none !important; }
  .portfolio-card { padding: 16px 14px !important; border-radius: 14px !important; min-height: auto !important; }
  .portfolio-card h3 { font-size: 18px !important; margin: 10px 0 4px !important; }
  .returns-strip-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 4px !important;
    margin: 12px 0 14px !important;
  }
  .returns-strip-5 > div {
    padding: 6px 2px !important;
    border-radius: 6px !important;
  }
  .returns-strip-5 span {
    font-size: 8.5px !important;
  }
  .returns-strip-5 strong {
    font-size: 11px !important;
    margin-top: 2px !important;
  }
  .panel { padding: 14px 12px !important; border-radius: 12px !important; width: 100% !important; }
  .tabs { flex-direction: column !important; gap: 6px !important; }
  .tab { width: 100% !important; white-space: normal !important; padding: 10px 8px !important; font-size: 11.5px !important; }
  .qr-modal-dialog { width: 95vw !important; max-height: 90vh !important; }
  .qr-modal-head { padding: 12px 14px !important; }
  .qr-modal-body { padding: 14px 14px !important; }
  .qr-modal-foot { padding: 12px 14px !important; flex-direction: column-reverse !important; gap: 8px !important; }
  .qr-modal-foot .btn { width: 100% !important; text-align: center !important; padding: 11px !important; }
  .modal-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 6px !important; }
  .constituent { grid-template-columns: minmax(60px, 90px) 1fr 38px !important; gap: 8px !important; }
  .metric-box { padding: 10px 8px !important; }
  .metric-box small { font-size: 9px !important; }
  .metric-box b { font-size: 13.5px !important; }
  .user,
  .qr-top-user { display: none !important; }
}