:root {
  --ink: #17191c;
  --muted: #71767f;
  --line: #e8e7e3;
  --paper: #f7f7f5;
  --white: #fff;
  --violet: #6c63e8;
  --violet-soft: #f0eefc;
  --green: #318255;
  --red: #b9574d;
}

* { box-sizing: border-box; }
html, body { width: 100%; max-width: 100%; min-height: 100%; margin: 0; overflow-x: hidden; }
body {
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

/* A stored session hint selects the authenticated loader before deferred JS runs. */
html.has-session-hint body.public-view {
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
}
html.has-session-hint [data-public-site],
html.has-session-hint [data-public-skip] { display: none !important; }
html.has-session-hint [data-app-shell] { display: grid !important; }

/* Logged-out product site — restores the original blue-and-glass landing design. */
body.public-view {
  overflow: auto;
  background: linear-gradient(135deg, #60a5fa 0%, #93c5fd 50%, #3b82f6 100%);
  color: #1a1a1a;
}

.public-site {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  min-height: 100vh;
  padding: 0 20px;
  font-family: Arial, Helvetica, sans-serif;
}

.public-header,
.public-site main,
.public-footer {
  width: min(100%, 1120px);
  margin-inline: auto;
}

.public-header { padding: 32px 0; }
.public-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.public-brand {
  display: inline-flex;
  grid-column: 2;
  align-items: center;
  gap: 16px;
  color: #fff;
  text-decoration: none;
}
.public-brand img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 8px 22px rgba(22, 74, 160, .2);
}
.public-brand strong {
  font-size: 32px;
  letter-spacing: -.04em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, .2);
}
.public-nav-links {
  display: flex;
  grid-column: 3;
  justify-content: flex-end;
}
.public-nav-links > a { display: none; }
.public-sign-in {
  padding: 11px 19px;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 50px;
  background: rgba(255,255,255,.16);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background .2s ease, transform .2s ease;
}
.public-sign-in:hover { background: rgba(255,255,255,.28); transform: translateY(-1px); }

.public-site main {
  padding: 52px 44px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 24px;
  background: rgba(255,255,255,.95);
  box-shadow: 0 20px 40px rgba(0,0,0,.15);
  backdrop-filter: blur(10px);
}

.public-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, .82fr);
  align-items: center;
  gap: 48px;
  padding-bottom: 56px;
}
.public-hero-copy { text-align: left; }
.public-eyebrow {
  margin: 0 0 12px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.public-hero h1,
.public-section-heading h2,
.plans-panel h2,
.public-boundary h2 {
  margin: 0;
  color: #1e3a8a;
  font-weight: 700;
  letter-spacing: -.045em;
}
.public-hero h1 {
  font-size: clamp(42px, 5vw, 64px);
  line-height: 1.02;
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.public-lede {
  max-width: 650px;
  margin: 22px 0 0;
  color: #5d6470;
  font-size: 19px;
  line-height: 1.7;
}
.public-actions { display: flex; align-items: center; gap: 12px; margin-top: 30px; }
.public-primary,
.public-secondary {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.public-primary {
  gap: 10px;
  border: 0;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  box-shadow: 0 8px 16px rgba(37,99,235,.3);
  transition: transform .2s ease, box-shadow .2s ease;
}
.public-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(37,99,235,.4); }
.public-secondary { border: 1px solid #cdddf6; background: #fff; color: #1e3a8a; }
.public-assurance { margin: 17px 0 0; color: #7b818b; font-size: 12px; line-height: 1.6; }

.public-preview {
  overflow: hidden;
  padding: 15px;
  border: 1px solid rgba(37,99,235,.16);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(30,58,138,.12);
}
.preview-bar { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid #edf1f7; }
.preview-bar > div { display: flex; align-items: center; gap: 7px; }
.preview-bar img { width: 24px; height: 24px; border-radius: 7px; }
.preview-bar strong { color: #1f2d4b; font-size: 11px; }
.preview-bar > span { color: #8a93a2; font-size: 8px; }
.preview-question { max-width: 84%; margin: 15px 0 13px auto; padding: 10px 12px; border-radius: 13px 13px 3px 13px; background: #eff5ff; color: #3b4a64; font-size: 9px; line-height: 1.45; }
.preview-run { padding: 13px; border-radius: 14px; background: #f8faff; }
.preview-run-title { display: flex; align-items: center; gap: 7px; color: #35415a; font-size: 9px; }
.preview-run-title > span { display: grid; width: 18px; height: 18px; place-items: center; border-radius: 50%; background: #e8f6ed; color: #278251; }
.preview-run-title small { margin-left: auto; color: #99a0ab; }
.preview-run ol { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.preview-run li { display: flex; align-items: center; gap: 9px; }
.preview-run li > span { display: grid; width: 20px; height: 20px; flex: 0 0 20px; place-items: center; border: 1px solid #c9d8f3; border-radius: 50%; color: #3b6fc2; font-size: 7px; }
.preview-run li div { display: flex; flex-direction: column; gap: 2px; }
.preview-run li small { color: #6991d2; font-size: 6px; font-weight: 800; letter-spacing: .08em; }
.preview-run li strong { color: #505a6d; font-size: 8px; }
.preview-answer { margin-top: 12px; color: #39445b; font-size: 9px; }
.preview-answer p { margin: 5px 0 9px; color: #737c8b; line-height: 1.5; }
.preview-answer div { display: flex; gap: 5px; }
.preview-answer span { padding: 4px 7px; border-radius: 20px; background: #eaf2ff; color: #386ab9; font-size: 7px; }

.public-section { padding: 58px 0 0; border-top: 1px solid #e8edf4; }
.public-section + .public-section { margin-top: 58px; }
.public-section-heading { max-width: 690px; margin: 0 auto 30px; text-align: center; }
.public-section-heading h2,
.plans-panel h2,
.public-boundary h2 { font-size: clamp(30px, 4vw, 42px); line-height: 1.1; }
.public-section-heading > p:last-child { margin: 15px auto 0; color: #6b7280; font-size: 16px; line-height: 1.65; }
.capability-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.capability-grid article,
.flow-grid article {
  padding: 24px;
  border: 1px solid rgba(37,99,235,.12);
  border-radius: 16px;
  background: rgba(37,99,235,.06);
  transition: transform .2s ease, box-shadow .2s ease;
}
.capability-grid article:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(30,58,138,.1); }
.capability-grid article > span { color: #3b82f6; font-size: 12px; font-weight: 800; }
.capability-grid h3 { margin: 13px 0 7px; color: #1e3a8a; font-size: 18px; }
.capability-grid p,
.flow-grid p { margin: 0; color: #666; font-size: 14px; line-height: 1.65; }

.public-flow { border-top: 0; }
.flow-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.flow-grid article { position: relative; background: #fff; }
.flow-grid article:not(:last-child)::after { position: absolute; top: 50%; right: -13px; z-index: 2; color: #6ea1ed; content: "→"; }
.flow-grid strong { display: block; margin-bottom: 8px; color: #1e3a8a; font-size: 18px; }

.plans-panel,
.public-boundary {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  align-items: center;
  gap: 40px;
  padding: 34px;
  border: 1px solid rgba(37,99,235,.14);
  border-radius: 18px;
  background: rgba(37,99,235,.06);
}
.plans-panel > p,
.public-boundary > p { margin: 0; color: #5d6470; font-size: 15px; line-height: 1.75; }
.public-boundary { margin-bottom: 0; }
.public-boundary h2 { font-size: clamp(27px, 3vw, 36px); }

.public-footer { padding: 32px 0; color: rgba(255,255,255,.82); text-align: center; }
.public-footer-main { display: flex; align-items: center; justify-content: center; }
.public-footer .public-brand { display: none; }
.public-footer-main > div { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; }
.public-footer a,
.public-footer button { padding: 0; border: 0; background: transparent; color: rgba(255,255,255,.88); font-size: 13px; text-decoration: none; cursor: pointer; }
.public-footer a:hover,
.public-footer button:hover { color: #fff; text-decoration: underline; }
.public-footer > p { margin: 14px 0 0; font-size: 13px; line-height: 1.5; opacity: .85; }

@media (max-width: 860px) {
  .public-hero { grid-template-columns: 1fr; }
  .public-hero-copy { text-align: center; }
  .public-lede { margin-inline: auto; }
  .public-actions { justify-content: center; }
  .capability-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .public-site { padding: 0 16px; }
  .public-header { padding: 22px 0; }
  .public-nav { grid-template-columns: 1fr auto; }
  .public-brand { grid-column: 1; gap: 10px; justify-self: start; }
  .public-brand img { width: 44px; height: 44px; border-radius: 11px; }
  .public-brand strong { font-size: 24px; }
  .public-nav-links { grid-column: 2; }
  .public-sign-in { padding: 9px 15px; }
  .public-site main { padding: 36px 20px; border-radius: 20px; }
  .public-hero { gap: 34px; padding-bottom: 42px; }
  .public-hero h1 { font-size: 42px; }
  .public-lede { font-size: 17px; }
  .public-actions { flex-direction: column; }
  .public-primary, .public-secondary { width: 100%; }
  .public-assurance { text-align: center; }
  .capability-grid, .flow-grid { grid-template-columns: 1fr; }
  .flow-grid article:not(:last-child)::after { display: none; }
  .plans-panel, .public-boundary { grid-template-columns: 1fr; gap: 18px; padding: 25px; text-align: center; }
  .public-section { padding-top: 46px; }
  .public-section + .public-section { margin-top: 46px; }
  .public-footer-main > div { flex-direction: column; gap: 9px; }
  .public-footer > p { max-width: 320px; margin-inline: auto; }
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #222;
  color: #fff;
  font-size: 11px;
  text-decoration: none;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

/* The shell intentionally mirrors Jonty's focused Agent workspace. */
.v3-shell {
  --chat-body-font-size: 15px;
  --chat-body-line-height: 24px;
  --chat-list-font-size: 13px;
  --chat-meta-font-size: 11px;
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  overflow: hidden;
  background: #f7f7f5;
}
.v3-workspace { width: 100%; min-width: 0; margin: 0; }
.v3-topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: grid;
  height: 66px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid #e3e1dd;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(16px);
}
.v3-menu {
  display: none;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 10px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.v3-menu span { width: 19px; height: 1.5px; display: block; margin: 2.5px 0; border-radius: 2px; background: #34312d; }
.chat-history-sidebar {
  z-index: 45;
  min-width: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 10px 9px 9px;
  border-right: 1px solid #e3e1dd;
  background: #f1f0ed;
}
.chat-history-heading { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 3px 7px 7px; }
.chat-history-heading > a { display: flex; min-width: 0; align-items: center; gap: 9px; color: #282622; text-decoration: none; }
.chat-history-heading img { width: 27px; height: 27px; flex: 0 0 27px; border-radius: 8px; }
.chat-history-heading strong { overflow: hidden; font-size: 13px; letter-spacing: -.2px; text-overflow: ellipsis; white-space: nowrap; }
.chat-history-heading > button { display: none; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; border: 0; border-radius: 50%; background: transparent; color: #5f5b55; font-size: 20px; cursor: pointer; }
.chat-history-new,
.chat-history-search { width: 100%; min-width: 0; display: flex; align-items: center; gap: 9px; border-radius: 9px; }
.chat-history-new { min-height: 39px; padding: 0 10px; border: 0; background: #e3e1dd; color: #34312d; font-size: var(--chat-list-font-size); font-weight: 700; text-align: left; cursor: pointer; }
.chat-history-new span { font-size: 17px; font-weight: 400; }
.chat-history-search { margin-top: 5px; padding: 8px 10px; color: #77716a; }
.chat-history-search input { min-width: 0; flex: 1; padding: 0; border: 0; outline: 0; background: transparent; color: #393631; font-size: 12px; line-height: 18px; }
.chat-history-list { min-height: 0; flex: 1; overflow-y: auto; padding: 10px 2px; }
.chat-history-group + .chat-history-group { margin-top: 15px; }
.chat-history-group > h2 { margin: 0; padding: 0 8px 5px; color: #8a867f; font-size: var(--chat-meta-font-size); line-height: 15px; font-weight: 700; }
.chat-history-item { width: 100%; min-width: 0; min-height: 39px; display: block; overflow: hidden; padding: 8px; border: 0; border-radius: 8px; background: transparent; color: #494640; font-size: var(--chat-list-font-size); line-height: 18px; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.chat-history-item:hover { background: #e8e6e1; }
.chat-history-item.active { background: #dedbd5; color: #272521; font-weight: 700; }
.chat-history-empty { padding: 16px 9px; color: #8a867f; font-size: 9px; }
.chat-history-account { position: relative; min-width: 0; border-top: 1px solid #dedbd5; }
.chat-history-profile { width: 100%; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 9px 7px 3px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.chat-history-profile > span { width: 29px; height: 29px; flex: 0 0 29px; display: grid; place-items: center; border-radius: 50%; background: #343238; color: #fff; font-size: 8px; font-weight: 700; }
.chat-history-profile p { min-width: 0; margin: 0; }
.chat-history-profile b { margin-left: auto; color: #8a867f; font-size: 9px; }
.chat-history-profile strong,
.chat-history-profile small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-history-profile strong { color: #3d3a35; font-size: 9px; }
.chat-history-profile small { margin-top: 2px; color: #89847c; font-size: 7px; }
.chat-history-backdrop { display: none; }
.v3-brand {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1f1e1b;
}
.v3-brand > img {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  border-radius: 8px;
  object-fit: cover;
}
.v3-brand strong { font-size: 17px; letter-spacing: -.3px; }
.account-slot {
  position: relative;
  display: flex;
  justify-content: flex-end;
}
.v4-account {
  display: flex;
  max-width: 250px;
  align-items: center;
  gap: 9px;
  padding: 5px 8px 5px 5px;
  border: 1px solid #e0ddd7;
  border-radius: 10px;
  background: #fff;
  color: #393631;
  text-align: left;
  cursor: pointer;
}
.v4-account > span {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 8px;
  background: #242327;
  color: #fff;
  font-size: 9px;
  font-weight: 750;
}
.v4-account p {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
  margin: 0;
}
.v4-account strong { font-size: 10px; }
.v4-account small {
  overflow: hidden;
  max-width: 155px;
  color: #8a867f;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.v4-account b { color: #928e87; font-size: 9px; }
.account-menu {
  position: absolute;
  z-index: 50;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  overflow: hidden;
  padding: 8px;
  border: 1px solid #e1ded8;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 38px rgba(35,35,30,.12);
}
.account-menu > div { padding: 7px 8px 10px; border-bottom: 1px solid #efede9; }
.account-menu strong, .account-menu small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu strong { color: #34312d; font-size: 10px; }
.account-menu small { margin-top: 4px; color: #8a867f; font-size: 8px; }
.account-menu button {
  width: 100%;
  margin-top: 6px;
  padding: 9px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #4f4a44;
  font-size: 9px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.account-menu button:hover { background: #f4f2ee; }
.account-menu button strong,
.account-menu button small { display: block; }
.account-menu button small { margin-top: 2px; color: #858078; font-size: 8px; font-weight: 500; }
.sidebar-account-menu { top: auto; right: 0; bottom: calc(100% + 8px); left: 0; width: auto; }

.broker-layer {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}
.broker-layer[hidden] { display: none; }
.broker-backdrop { position: absolute; inset: 0; border: 0; background: rgba(20,20,20,.48); backdrop-filter: blur(3px); }
.broker-dialog {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  max-height: min(780px, calc(100dvh - 40px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #dedbd7;
  border-radius: 22px;
  background: #fff;
  color: #2e2b2b;
  box-shadow: 0 24px 80px rgba(28,25,23,.24);
}
.broker-dialog > header { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 12px; align-items: start; padding: 20px 22px 17px; border-bottom: 1px solid #ebe8e4; }
.broker-dialog > header > button { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 10px; background: transparent; color: #4c4845; font-size: 20px; cursor: pointer; }
.broker-dialog > header > button:hover { background: #f3f1ef; }
.broker-dialog > header > div { min-width: 0; }
.broker-dialog h2 { margin: 0; font-size: 21px; line-height: 29px; letter-spacing: -.02em; }
.broker-dialog header p { margin: 3px 0 0; color: #77716c; font-size: 13px; line-height: 19px; }
.broker-body { overflow: auto; padding: 20px 22px 24px; overscroll-behavior: contain; }
.broker-loading { min-height: 240px; display: grid; place-items: center; color: #716b67; font-size: 14px; }
.broker-error { display: flex; gap: 9px; margin-bottom: 15px; padding: 11px 13px; border: 1px solid #f1c8c3; border-radius: 12px; background: #fff5f3; color: #9f332a; font-size: 13px; line-height: 18px; }
.broker-section + .broker-section { margin-top: 24px; }
.broker-section > h3 { margin: 0 0 10px; color: #6f6964; font-size: 12px; line-height: 18px; letter-spacing: .055em; text-transform: uppercase; }
.broker-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.broker-choice { min-width: 0; min-height: 76px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 11px; align-items: center; padding: 12px; border: 1px solid #e3e0dc; border-radius: 15px; background: #fff; color: #363230; text-align: left; cursor: pointer; }
.broker-choice:hover:not(:disabled) { border-color: #bdb6f7; background: #faf9ff; }
.broker-choice:disabled { opacity: .68; cursor: default; }
.broker-choice-copy { min-width: 0; }
.broker-choice strong,
.broker-choice small { display: block; }
.broker-choice strong { font-size: 14px; line-height: 20px; }
.broker-choice small { margin-top: 2px; color: #817b76; font-size: 11px; line-height: 16px; }
.broker-choice em { color: #8d8782; font-size: 10px; font-style: normal; font-weight: 700; text-transform: uppercase; }
.broker-logo { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; background: #302d2d; color: #fff; font-size: 15px; font-weight: 750; }
.broker-logo.dhan { background: #e44558; }
.broker-logo.zerodha { background: #3978d4; }
.broker-logo.groww { background: #15a682; }
.broker-logo.upstox { background: #7244d3; }
.broker-logo.angel-one { background: #3b74e7; }
.broker-connected-card { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 11px; align-items: center; padding: 13px; border: 1px solid #e2dfdb; border-radius: 15px; background: #fdfcfa; }
.broker-connected-card + .broker-connected-card { margin-top: 9px; }
.broker-connected-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: #eaf6ef; color: #247749; font-size: 17px; }
.broker-connected-icon.expired,
.broker-connected-icon.invalid { background: #fff1dd; color: #9c5c00; }
.broker-connected-copy { min-width: 0; }
.broker-connected-copy strong,
.broker-connected-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.broker-connected-copy strong { font-size: 14px; line-height: 20px; }
.broker-connected-copy small { margin-top: 1px; color: #7d7772; font-size: 12px; line-height: 17px; }
.broker-connected-copy b { display: inline-flex; margin-top: 5px; color: #247749; font-size: 11px; line-height: 16px; }
.broker-connected-copy b.expired,
.broker-connected-copy b.invalid { color: #9c5c00; }
.broker-actions { display: flex; gap: 5px; align-items: center; }
.broker-actions button { min-height: 32px; padding: 0 9px; border: 1px solid #dedbd7; border-radius: 9px; background: #fff; color: #4d4946; font-size: 11px; font-weight: 650; cursor: pointer; }
.broker-actions button:last-child { color: #aa473e; }
.broker-actions button:disabled { opacity: .55; cursor: default; }
.broker-safety,
.broker-credential-intro { display: flex; gap: 10px; margin-top: 19px; padding: 13px 14px; border-radius: 13px; background: #f3f7f4; color: #41604c; }
.broker-safety strong,
.broker-safety small,
.broker-credential-intro strong,
.broker-credential-intro small { display: block; }
.broker-safety strong,
.broker-credential-intro strong { margin-bottom: 2px; font-size: 12px; line-height: 17px; }
.broker-safety small,
.broker-credential-intro small { font-size: 11px; line-height: 17px; }
.broker-methods { display: grid; gap: 11px; }
.broker-method { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 15px; border: 1px solid #e0ddd9; border-radius: 15px; background: #fff; color: #393533; text-align: left; cursor: pointer; }
.broker-method:hover:not(:disabled) { border-color: #bcb4fa; background: #faf9ff; }
.broker-method:disabled { opacity: .68; cursor: default; }
.broker-method > i { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: #f0edff; color: #5b4dcc; font-size: 18px; font-style: normal; }
.broker-method strong,
.broker-method small { display: block; }
.broker-method strong { font-size: 14px; line-height: 20px; }
.broker-method small { margin-top: 3px; color: #7b7570; font-size: 12px; line-height: 18px; }
.broker-method em { color: #7f7974; font-size: 10px; font-style: normal; font-weight: 700; text-transform: uppercase; }
.broker-token-note { margin: 4px 1px 0; color: #7b6542; font-size: 12px; line-height: 18px; }
.broker-form { display: grid; gap: 15px; }
.broker-form .broker-credential-intro { margin: 0 0 1px; }
.broker-form > label { display: grid; gap: 6px; }
.broker-form > label > span { font-size: 12px; line-height: 17px; font-weight: 700; }
.broker-form > label > input { width: 100%; height: 44px; box-sizing: border-box; padding: 0 12px; border: 1px solid #d9d5d1; border-radius: 11px; outline: 0; background: #fff; color: #312e2c; font: inherit; font-size: 14px; }
.broker-form > label > input:focus { border-color: #7d6be3; box-shadow: 0 0 0 3px rgba(125,107,227,.12); }
.broker-form > label > small { color: #817b76; font-size: 11px; line-height: 16px; }
.broker-static-ip { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 13px 14px; border: 1px solid #ddd8ff; border-radius: 13px; background: #f8f7ff; }
.broker-static-ip strong,
.broker-static-ip small { display: block; }
.broker-static-ip strong { font-size: 12px; line-height: 18px; }
.broker-static-ip small { margin-top: 3px; color: #716b67; font-size: 11px; line-height: 16px; }
.broker-static-ip button { min-height: 36px; display: inline-flex; gap: 7px; align-items: center; padding: 0 10px; border: 1px solid #cfc8fa; border-radius: 9px; background: #fff; color: #5145a9; cursor: pointer; }
.broker-static-ip code { font-size: 12px; }
.broker-help { width: fit-content; display: inline-flex; gap: 6px; align-items: center; color: #574ab4; font-size: 12px; font-weight: 700; text-decoration: none; }
.broker-submit { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; background: #2f2b31; color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; }
.broker-submit:disabled { opacity: .62; cursor: default; }

.v3-agent {
  display: flex;
  width: min(1040px, 100%);
  height: calc(100vh - 66px);
  margin: 0 auto;
  flex-direction: column;
  overflow: hidden;
  padding: 14px 24px;
}
.v3-chat {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e2dfda;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(45,41,34,.04);
}
.v4-chat {
  position: relative;
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}
.v3-shell.is-restoring .account-slot,
.v3-shell.is-restoring .v3-composer-wrap { visibility: hidden; }
.v8-chat-loader {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  background: #fff;
  color: #8c8780;
}
.v8-chat-loader > span {
  width: 25px;
  height: 25px;
  border: 2px solid #e7e3f4;
  border-top-color: #7569c4;
  border-radius: 50%;
  animation: conversation-loader .8s linear infinite;
}
.v8-chat-loader > p { margin: 0; font-size: 9px; }
@keyframes conversation-loader { to { transform: rotate(360deg); } }

.v3-chat-stream {
  display: grid;
  min-height: 0;
  flex: 1;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 24px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 28px 30px;
  scroll-behavior: smooth;
}
.v3-message {
  display: flex;
  max-width: 900px;
  align-self: start;
  align-items: flex-start;
  gap: 11px;
  font-size: var(--chat-body-font-size);
  line-height: var(--chat-body-line-height);
}
.v3-message > .agent-mark {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 9px;
  object-fit: cover;
}
.v3-message > div { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.v3-message strong { color: #292722; font-size: inherit; }
.v3-message p { margin: 8px 0 0; color: #4f4c47; font-size: inherit; line-height: inherit; }
.v3-message.user {
  max-width: 610px;
  justify-self: end;
  align-items: center;
  flex-direction: row;
}
.v3-message.user > div {
  display: flex;
  min-height: 28px;
  align-items: center;
  padding: 5px 10px;
  border-radius: 13px 13px 3px 13px;
  background: #f0eefc;
}
.v3-message.user > div p { margin: 0; color: #393544; line-height: 1.5; white-space: pre-wrap; }
.v3-message.user > .user-mark {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border-radius: 50%;
  background: #343238;
  color: #fff;
  font-size: 8px;
  font-weight: 700;
}
.v3-message.compact { margin-top: -7px; }

.v7-agent-turn-body { display: grid; width: min(900px,100%); min-width: 0; gap: 13px; }
.v7-run-activity { width: min(760px,calc(100% - 39px)); margin: -8px 0 0 39px; color: #68636e; }
.v7-run-activity details { padding: 12px 14px; border: 1px solid #e1dde8; border-radius: 13px; background: #fbfaff; }
.v7-run-activity summary { display: flex; cursor: pointer; align-items: center; gap: 9px; list-style: none; font-size: 14px; }
.v7-run-activity summary::-webkit-details-marker { display: none; }
.v7-run-activity summary > i { width: 7px; height: 7px; border: 2px solid #8175cc; border-radius: 50%; }
.v7-run-activity.running summary > i { border-top-color: transparent; animation: conversation-loader .8s linear infinite; }
.v7-run-activity summary > span { color: #47424d; font-weight: 700; }
.v7-run-activity summary > small { margin-left: auto; color: #8d8793; font-size: 12px; }
.v7-run-timeline { display: grid; gap: 0; margin: 16px 0 2px; padding: 0; list-style: none; }
.v7-run-timeline li { position: relative; display: grid; gap: 2px; padding: 0 0 15px 26px; }
.v7-run-timeline li::before { position: absolute; z-index: 1; top: 5px; left: 0; width: 9px; height: 9px; border: 1px solid #b8b0d9; border-radius: 50%; background: #fff; content: ""; }
.v7-run-timeline li:not(:last-child)::after { position: absolute; top: 15px; bottom: 0; left: 5px; width: 1px; background: #ded9e9; content: ""; }
.v7-run-timeline li.completed::before { border-color: #776bc1; background: #776bc1; }
.v7-run-timeline li.running::before { border-top-color: transparent; animation: conversation-loader .8s linear infinite; }
.v7-run-timeline small { color: #8d8694; font-size: 10px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
.v7-run-timeline strong { color: #48424e; font-size: 13px; line-height: 1.45; }
.v7-run-timeline p { margin: 1px 0 0; color: #77717d; font-size: 12px; line-height: 1.5; }
.v7-run-usage { margin: 2px 0 0 26px !important; color: #928b98 !important; font-size: 10px !important; }
.v7-agent-answer { display: grid; width: 100%; min-width: 0; max-width: 100%; gap: 9px; overflow-wrap: anywhere; }
.v7-agent-answer > p, .v7-answer-point p { margin: 0; }
.v7-agent-answer strong { color: #34312d; font-weight: 720; }
.v7-agent-answer a { color: #6257b4; text-decoration-color: #cfc9ee; text-underline-offset: 2px; }
.v7-agent-answer a:hover { text-decoration-color: #6257b4; }
.stock-page-link {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 3px 9px;
  border: 1px solid #d7d0ed;
  border-radius: 999px;
  background: #f7f5fd;
  color: #5d519f;
  font: inherit;
  font-size: .72em;
  font-weight: 700;
  line-height: 1.45;
  vertical-align: .12em;
  white-space: nowrap;
  cursor: pointer;
}
.stock-page-link::after { margin-left: 4px; content: "›"; font-size: 1.2em; line-height: 1; }
.stock-page-link:hover { border-color: #bdb3dc; background: #efebfa; }
.v7-agent-answer h2, .v7-agent-answer h3 {
  margin: 25px 0 5px;
  color: #292722;
  font-size: 19px;
  line-height: 1.4;
  letter-spacing: -.015em;
}
.v7-agent-answer h2 { padding-top: 20px; border-top: 1px solid #ebe7e1; }
.v7-agent-answer h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.v7-agent-answer h3 { margin-top: 20px; font-size: 17px; }
.v7-agent-answer blockquote {
  margin: 2px 0;
  padding-left: 11px;
  border-left: 2px solid #cfc9ee;
  color: #5d5863;
  font-size: 15px;
  line-height: 1.68;
}
.v7-agent-answer code {
  padding: 1px 4px;
  border-radius: 4px;
  background: #f3f1ed;
  color: #4f4958;
  font-family: ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size: .86em;
}
.v7-agent-answer hr { width: 100%; margin: 5px 0; border: 0; border-top: 1px solid #ebe7e1; }
.v7-answer-list {
  display: grid;
  gap: 9px;
  margin: 2px 0 12px;
  padding: 0 0 0 24px;
  color: #4f4c47;
  font-size: var(--chat-body-font-size);
  line-height: var(--chat-body-line-height);
}
.v7-answer-list li { padding-left: 4px; }
.v7-answer-list li::marker { color: #8074d2; font-weight: 750; }
.v7-agent-answer h3 + .v7-answer-list {
  margin-top: 3px;
  padding: 13px 16px 13px 36px;
  border: 1px solid #e5e0ee;
  border-radius: 12px;
  background: #fbfaff;
}
.v7-agent-answer em { color: #615d57; }
.v7-answer-table-wrap { width: 100%; margin: 5px 0 13px; overflow-x: auto; }
.v7-answer-table-wrap table { width: 100%; min-width: 560px; border-collapse: collapse; color: #4f4c47; font-size: 14px; line-height: 1.5; }
.v7-answer-table-wrap th, .v7-answer-table-wrap td { padding: 9px 10px; border: 1px solid #e5e0da; text-align: left; vertical-align: top; }
.v7-answer-table-wrap th { background: #f7f5f1; color: #34312d; font-weight: 720; }
.v7-box-table table { min-width: 720px; table-layout: fixed; }
.v7-box-table td { width: 50%; border-top: 0; border-bottom: 0; }
.v7-box-table tr:first-child td { border-top: 1px solid #e5e0da; }
.v7-box-table tr:last-child td { border-bottom: 1px solid #e5e0da; }
.v7-box-table .v7-box-summary { width: auto; background: #f7f5f1; color: #34312d; font-weight: 720; }
.v7-agent-answer pre {
  width: 100%;
  max-width: 100%;
  margin: 5px 0 13px;
  padding: 13px;
  overflow-x: auto;
  border-radius: 10px;
  background: #28262d;
  color: #f7f5fa;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre;
}
.v7-agent-answer pre code { padding: 0; background: transparent; color: inherit; }
.v7-answer-point { display: flex; align-items: flex-start; gap: 9px; }
.v7-answer-point > i {
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  margin-top: 8px;
  border-radius: 50%;
  background: #8b7fe0;
}
.v7-answer-point.numbered > i {
  display: grid;
  width: 20px;
  height: 20px;
  flex-basis: 20px;
  place-items: center;
  margin-top: 1px;
  border-radius: 7px;
  background: #f0eefb;
  color: #675bb6;
  font-size: 8px;
  font-style: normal;
  font-weight: 750;
}
.research-details-trigger {
  width: min(560px,100%);
  display: grid;
  grid-template-columns: 38px minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 7px;
  padding: 10px 12px;
  border: 1px solid #ded9e8;
  border-radius: 13px;
  background: #fbfaff;
  color: #4a4550;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.research-details-trigger:hover { border-color: #c8c1dc; background: #f7f5fd; }
.research-details-trigger > span:nth-child(2) { min-width: 0; }
.research-details-trigger strong, .research-details-trigger small { display: block; }
.research-details-trigger strong { font-size: 13px; line-height: 18px; }
.research-details-trigger small { display: -webkit-box; margin-top: 1px; overflow: hidden; color: #8a8490; font-size: 10px; line-height: 14px; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.research-details-trigger-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 10px; background: #ece8f8; color: #665a9f; font-size: 18px; }
.research-details-arrow { color: #857da0; font-size: 22px; line-height: 1; }

.v8-agent-waiting {
  display: flex;
  min-height: 20px;
  align-items: center;
  gap: 4px;
}
.v8-agent-waiting i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #9187cc;
  animation: response-dot 1.1s ease-in-out infinite;
}
.v8-agent-waiting i:nth-child(2) { animation-delay: .14s; }
.v8-agent-waiting i:nth-child(3) { animation-delay: .28s; }
@keyframes response-dot { 0%,65%,100% { opacity: .28; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }

.agent-artifact, .portfolio-review {
  display: flex;
  width: min(640px,calc(100% - 42px));
  margin-left: 39px;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid #ded9ed;
  border-radius: 13px;
  background: linear-gradient(145deg,#f8f6ff,#fff);
}
.artifact-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border-radius: 10px;
  background: #ece8fc;
  color: #6659b5;
  font-size: 15px;
}
.agent-artifact > p, .portfolio-review > div { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 3px; margin: 0; }
.agent-artifact small, .portfolio-review small { color: #918a9c; font-size: 7px; font-weight: 750; letter-spacing: .07em; }
.agent-artifact strong, .portfolio-review strong { overflow: hidden; color: #393442; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.agent-artifact span, .portfolio-review span { color: #77707e; font-size: 8px; }
.agent-artifact > button, .portfolio-review button {
  padding: 7px 9px;
  border: 1px solid #d8d2e9;
  border-radius: 8px;
  background: #fff;
  color: #5d53a4;
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
}
.agent-artifact > button:hover, .portfolio-review button:hover { background: #f3f0fd; }
.portfolio-review { display: block; background: #fffdf8; border-color: #e8ddc8; }
.portfolio-review > header { display: flex; align-items: center; gap: 11px; }
.portfolio-table { margin-top: 12px; overflow-x: auto; border: 1px solid #eee7dc; border-radius: 9px; }
.portfolio-row { display: grid; min-width: 520px; grid-template-columns: 1.2fr .75fr 1fr 1fr 28px; gap: 7px; align-items: center; padding: 7px 9px; border-bottom: 1px solid #f1ebe2; }
.portfolio-row:last-child { border-bottom: 0; }
.portfolio-row.header { background: #f8f5ef; color: #918a80; font-size: 7px; font-weight: 700; }
.portfolio-row input { width: 100%; min-width: 0; padding: 5px 6px; border: 1px solid #e2dcd2; border-radius: 6px; color: #403b35; font-size: 8px; outline: 0; }
.portfolio-row input:focus { border-color: #aaa1dc; box-shadow: 0 0 0 2px rgba(108,99,232,.08); }
.portfolio-row button { display: grid; width: 24px; height: 24px; place-items: center; padding: 0; color: #9c6b63; }
.portfolio-warning { margin: 9px 0 0; color: #8b6d3d; font-size: 8px; line-height: 1.5; }
.portfolio-actions { display: flex; justify-content: flex-end; margin-top: 11px; }
.portfolio-actions button { min-width: 120px; padding: 9px 12px; border: 0; background: #29262e; color: #fff; }

.v3-composer-wrap {
  position: sticky;
  z-index: 5;
  bottom: 0;
  flex: 0 0 auto;
  padding: 12px 18px 14px;
  border-top: 1px solid #ebe8e3;
  background: rgba(255,255,255,.96);
}
.v3-composer {
  display: flex;
  min-height: 104px;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  padding: 12px 11px 9px;
  border: 1px solid #dcd8d1;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(45,41,34,.07);
}
.v3-composer textarea {
  width: 100%;
  min-height: 50px;
  max-height: 211px;
  overflow-y: hidden;
  resize: none;
  padding: 3px 5px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #292825;
  font-size: var(--chat-body-font-size);
  line-height: var(--chat-body-line-height);
}
.v3-composer textarea::placeholder { color: #aaa59e; }
.v5-composer-controls { display: flex; width: 100%; min-height: 34px; align-items: center; gap: 8px; }
.v4-upload-button {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #5e5b56;
  cursor: pointer;
}
.v4-upload-button:hover { background: #f0efec; }
.v4-upload-button input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.v4-upload-button > span { font-size: 18px; line-height: 1; }
.v5-composer-note { color: #a19c95; font-size: 7px; }
.v5-composer-spacer { flex: 1; }
.v3-composer button.send {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  margin: 0 3px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #292825;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.v3-composer button.send:disabled { background: #d3d1cc; cursor: default; }
.v4-uploaded-files { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; padding: 0 5px; }
.v4-uploaded-files > span {
  display: flex;
  max-width: 260px;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border: 1px solid #ddd9d2;
  border-radius: 7px;
  background: #f8f7f4;
  color: #625e57;
  font-size: 8px;
}
.v4-uploaded-files i { color: #6c63e8; font-style: normal; }
.v4-uploaded-files button { display: grid; width: 15px; height: 15px; place-items: center; margin-left: 2px; padding: 0; border: 0; border-radius: 50%; background: #e8e5df; color: #77716a; cursor: pointer; }

.auth-layer, .research-details-layer {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(30,28,25,.32);
  backdrop-filter: blur(5px);
}
.auth-card {
  position: relative;
  width: min(410px,100%);
  padding: 35px 32px 27px;
  border: 1px solid #e4e0d9;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(40,35,30,.18);
  text-align: center;
}
.auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #77716a;
  font-size: 17px;
  cursor: pointer;
}
.auth-close:hover { background: #f1efeb; }
.auth-mark { display: block; width: 42px; height: 42px; margin: 0 auto 20px; border-radius: 13px; object-fit: cover; }
.auth-entry > small, .auth-code > small { color: #8b8494; font-size: 8px; font-weight: 750; letter-spacing: .12em; }
.auth-card h1 { margin: 9px 0 8px; color: #2d2a27; font-size: 22px; letter-spacing: -.5px; }
.auth-entry > p:first-of-type, .auth-code > p:first-of-type { max-width: 320px; margin: 0 auto 21px; color: #77716a; font-size: 10px; line-height: 1.55; }
.auth-code > p:first-of-type strong { color: #4b4851; }
.google-button { display: flex; min-height: 44px; justify-content: center; }
.auth-rule { display: flex; align-items: center; gap: 10px; margin: 15px 0; color: #99958f; font-size: 8px; }
.auth-rule::before, .auth-rule::after { height: 1px; flex: 1; background: #ebe8e3; content: ""; }
.auth-email-form { text-align: left; }
.auth-email-form label, .auth-code-form label { display: block; margin-bottom: 7px; color: #62676d; font-size: 8px; font-weight: 650; text-align: left; }
.auth-email-form > div { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; }
.auth-email-form input, .auth-code-form input {
  width: 100%;
  height: 43px;
  padding: 0 12px;
  border: 1px solid #dcd9e3;
  border-radius: 9px;
  outline: 0;
  background: #fff;
  color: #34313b;
  font-size: 10px;
}
.auth-email-form input:focus, .auth-code-form input:focus { border-color: #8d82dd; box-shadow: 0 0 0 3px #f0eefc; }
.auth-email-form button, .auth-code-form button {
  height: 43px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: #252329;
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
}
.auth-email-form button:disabled, .auth-code-form button:disabled { background: #c8c8c3; cursor: default; }
.auth-status { min-height: 16px; margin: 9px auto 0 !important; color: #8b8580 !important; font-size: 8px !important; line-height: 1.45; }
.auth-terms { margin: 9px auto 0 !important; color: #aaa49d !important; font-size: 7px !important; line-height: 1.5 !important; }
.auth-terms a { color: #6b61b4; }
.auth-sent-icon { display: inline-grid; width: 34px; height: 34px; margin: 0 auto 14px; place-items: center; border-radius: 11px; background: #eeebff; color: #6657c6; font-size: 14px; font-weight: 800; }
.auth-code-form input { height: 48px; padding-left: 18px; font-size: 16px; font-weight: 700; letter-spacing: .45em; text-align: center; }
.auth-code-form button { width: 100%; margin-top: 9px; }
.auth-code-actions { display: flex; justify-content: center; gap: 17px; margin-top: 16px; }
.auth-code-actions button { padding: 0; border: 0; background: transparent; color: #6657c6; font-size: 8px; font-weight: 700; cursor: pointer; }
.auth-code-actions button:disabled { color: #aaa5bc; cursor: default; }
.auth-cancel { margin-top: 9px; padding: 7px 10px; border: 0; background: transparent; color: #928d86; font-size: 8px; cursor: pointer; }

.research-details-sheet {
  display: flex;
  width: min(760px,100%);
  max-height: min(760px,calc(100vh - 40px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e2ded8;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(40,35,30,.18);
}

.stock-page-layer {
  position: fixed;
  z-index: 140;
  inset: 0;
  overflow: hidden;
  background: #f6f5f2;
}
.stock-page-layer[hidden] { display: none; }
.stock-page-sheet { width: min(1100px,100%); height: 100dvh; display: flex; margin: 0 auto; flex-direction: column; overflow: hidden; background: #fff; box-shadow: 0 0 50px rgba(30,28,25,.08); }
.stock-page-header { flex: 0 0 auto; display: grid; grid-template-columns: 42px minmax(0,1fr) 42px; align-items: center; gap: 11px; padding: 12px 18px; border-bottom: 1px solid #e7e3dd; background: rgba(255,255,255,.96); }
.stock-page-header > button { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 11px; background: transparent; color: #393632; font-size: 22px; cursor: pointer; }
.stock-page-header > button:hover { background: #f1efeb; }
.stock-page-header small, .stock-page-header h2 { display: block; }
.stock-page-header small { color: #8d8790; font-size: 9px; font-weight: 750; letter-spacing: .1em; }
.stock-page-header h2 { margin: 2px 0 0; overflow: hidden; color: #2f2c29; font-size: 17px; line-height: 22px; text-overflow: ellipsis; white-space: nowrap; }
.stock-page-content { min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 26px 30px 42px; }
.stock-page-state { min-height: 65dvh; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 13px; color: #77716c; text-align: center; }
.stock-page-state > span { width: 28px; height: 28px; display: grid; place-items: center; border: 2px solid #e1ddee; border-top-color: #6f63b6; border-radius: 50%; color: #9a4138; animation: conversation-loader .8s linear infinite; }
.stock-page-state.error > span { border: 0; background: #fff1ef; animation: none; }
.stock-page-state p { max-width: 440px; margin: 0; font-size: 14px; line-height: 21px; }
.stock-page-state button { padding: 9px 13px; border: 0; border-radius: 10px; background: #29262d; color: #fff; font-size: 12px; font-weight: 700; cursor: pointer; }
.stock-page-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 2px 24px; }
.stock-page-identity { min-width: 0; display: flex; align-items: center; gap: 13px; }
.stock-page-identity > span { width: 48px; height: 48px; flex: 0 0 48px; display: grid; place-items: center; border-radius: 15px; background: linear-gradient(145deg,#ece8fb,#f8f6ff); color: #5d50a0; font-size: 19px; font-weight: 800; }
.stock-page-identity h1 { margin: 0; color: #2a2825; font-size: 25px; line-height: 32px; letter-spacing: -.02em; }
.stock-page-identity p { margin: 3px 0 0; color: #847e77; font-size: 12px; line-height: 18px; }
.stock-page-quote { flex: 0 0 auto; text-align: right; }
.stock-page-quote strong, .stock-page-quote small { display: block; }
.stock-page-quote strong { color: #2e2b28; font-size: 22px; line-height: 29px; }
.stock-page-quote small { margin-top: 3px; color: #7f7973; font-size: 11px; line-height: 16px; }
.stock-page-quote small.positive { color: #28744b; }
.stock-page-quote small.negative { color: #a3483e; }
.stock-page-chart { height: 320px; overflow: hidden; border: 1px solid #e5e1da; border-radius: 17px; background: #fff; }
.stock-page-chart.stored { height: auto; padding: 16px 17px 10px; }
.stock-page-chart.stored > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 2px 8px; }
.stock-page-chart.stored > header strong, .stock-page-chart.stored > header small { display: block; }
.stock-page-chart.stored > header strong { color: #302d29; font-size: 14px; line-height: 20px; }
.stock-page-chart.stored > header small { margin-top: 2px; color: #817b74; font-size: 10px; line-height: 15px; text-transform: capitalize; }
.stock-page-chart.stored > header > div:last-child { display: flex; align-items: center; gap: 12px; color: #817b74; font-size: 10px; white-space: nowrap; }
.stock-page-chart.stored > header a { color: #5e52a5; font-weight: 700; text-decoration: none; }
.stock-page-chart.stored > header a:hover { text-decoration: underline; text-underline-offset: 2px; }
.stock-page-chart.stored svg { display: block; width: 100%; height: 278px; }
.stock-page-chart iframe { width: 100%; height: 100%; border: 0; }
.stock-page-chart .tradingview-widget-container, .stock-page-chart .tradingview-widget-container__widget { width: 100%; height: 100%; }
.stock-page-grid { display: grid; grid-template-columns: minmax(260px,.72fr) minmax(0,1.28fr); gap: 15px; margin-top: 15px; align-items: start; }
.stock-page-card { padding: 19px; border: 1px solid #e5e1da; border-radius: 16px; background: #fff; }
.stock-page-card h2 { margin: 0 0 14px; color: #302d29; font-size: 16px; line-height: 22px; }
.stock-page-card ul, .stock-page-card ol { margin: 0; padding: 0; list-style: none; }
.stock-page-card ul { display: grid; gap: 10px; }
.stock-page-card ul li { position: relative; padding-left: 15px; color: #5d5852; font-size: 13px; line-height: 20px; }
.stock-page-card ul li::before { position: absolute; top: 8px; left: 0; width: 5px; height: 5px; border-radius: 50%; background: #8275cf; content: ""; }
.stock-page-timeline ol { display: grid; gap: 0; }
.stock-page-timeline li { display: grid; grid-template-columns: 84px minmax(0,1fr); gap: 3px 12px; padding: 12px 0; border-top: 1px solid #eeeae4; }
.stock-page-timeline li:first-child { padding-top: 0; border-top: 0; }
.stock-page-timeline time { color: #928b84; font-size: 10px; line-height: 17px; }
.stock-page-timeline a { color: #423b70; font-size: 13px; font-weight: 650; line-height: 18px; text-decoration: none; }
.stock-page-timeline a:hover { text-decoration: underline; text-underline-offset: 2px; }
.stock-page-timeline li p { grid-column: 2; margin: 2px 0 0; color: #77716b; font-size: 11px; line-height: 17px; }
.stock-page-empty { margin: 0; color: #7b756e; font-size: 12px; line-height: 18px; }
.stock-page-research { margin-top: 15px; padding: 21px; border: 1px solid #e5e1da; border-radius: 16px; background: #fbfaf8; }
.stock-page-research > header { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.stock-page-research > header h2 { margin: 0; color: #302d29; font-size: 18px; line-height: 24px; }
.stock-page-research > header small { color: #8c857d; font-size: 10px; }
.stock-page-research-sections { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.stock-page-research-section { min-width: 0; padding: 17px; border: 1px solid #e7e2dc; border-radius: 14px; background: #fff; }
.stock-page-research-section h3 { margin: 0; color: #302d29; font-size: 15px; line-height: 21px; }
.stock-page-research-section > p { margin: 5px 0 0; color: #7a746d; font-size: 10px; line-height: 16px; }
.stock-page-research-section dl { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; margin: 13px 0 0; }
.stock-page-research-section dl > div { min-width: 0; padding: 9px 10px; border-radius: 10px; background: #f5f3ef; }
.stock-page-research-section dt { overflow: hidden; color: #8a847c; font-size: 8px; font-weight: 700; line-height: 12px; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.stock-page-research-section dd { margin: 3px 0 0; overflow-wrap: anywhere; color: #3d3935; font-size: 12px; font-weight: 700; line-height: 17px; }
.stock-page-research-section dl > div[data-tone="positive"] dd { color: #28744b; }
.stock-page-research-section dl > div[data-tone="negative"] dd { color: #a3483e; }
.stock-page-research-section ul { display: grid; gap: 0; margin: 13px 0 0; padding: 0; list-style: none; }
.stock-page-research-section li { position: relative; padding: 9px 0 9px 12px; border-top: 1px solid #eeeae4; }
.stock-page-research-section li::before { position: absolute; top: 16px; left: 0; width: 4px; height: 4px; border-radius: 50%; background: #8275cf; content: ""; }
.stock-page-research-section li > strong, .stock-page-research-section li > a { color: #494445; font-size: 11px; font-weight: 700; line-height: 16px; text-decoration: none; }
.stock-page-research-section li > a:hover { color: #5e52a5; text-decoration: underline; text-underline-offset: 2px; }
.stock-page-research-section li p { margin: 2px 0 0; color: #77716b; font-size: 10px; line-height: 16px; }
.stock-page-research-section li time { display: block; margin-top: 3px; color: #99918a; font-size: 8px; line-height: 12px; }
.stock-page-chat { display: grid; grid-template-columns: minmax(180px,.48fr) minmax(300px,1fr); align-items: center; gap: 22px; margin-top: 15px; padding: 20px 21px; border: 1px solid #ded8ee; border-radius: 16px; background: linear-gradient(135deg,#f7f5ff,#fff); }
.stock-page-chat h2 { margin: 0; color: #302d35; font-size: 17px; line-height: 23px; }
.stock-page-chat p { margin: 5px 0 0; color: #777080; font-size: 10px; line-height: 16px; }
.stock-page-chat form { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 9px; }
.stock-page-chat textarea { min-width: 0; min-height: 66px; max-height: 160px; resize: vertical; padding: 12px 13px; border: 1px solid #dcd6e9; border-radius: 12px; outline: none; background: #fff; color: #39353d; font: inherit; font-size: 12px; line-height: 18px; }
.stock-page-chat textarea:focus { border-color: #8d82dd; box-shadow: 0 0 0 3px #efedfb; }
.stock-page-chat button { min-height: 42px; padding: 0 15px; border: 0; border-radius: 11px; background: #29262d; color: #fff; font-size: 11px; font-weight: 750; cursor: pointer; }
.stock-page-chat button:disabled { background: #aaa5ad; cursor: default; }
.research-details-handle { display: none; }
.research-details-sheet > header { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid #ebe8e3; }
.research-details-sheet > header small { color: #82788e; font-size: 9px; font-weight: 750; letter-spacing: .1em; }
.research-details-sheet > header h2 { margin: 5px 0 0; color: #322e35; font-size: 20px; }
.research-details-sheet > header p { display: -webkit-box; max-width: 620px; margin: 4px 0 0; overflow: hidden; color: #77716a; font-size: 11px; line-height: 15px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.research-details-sheet > header button { display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 9px; background: transparent; color: #77716a; font-size: 19px; cursor: pointer; }
.research-details-sheet > header button:hover { background: #f1efeb; }
.research-details-content { overflow-y: auto; overscroll-behavior: contain; padding: 0 22px 24px; color: #504b46; }
.research-details-section { padding: 22px 0; border-top: 1px solid #eeeae5; }
.research-details-section:first-child { border-top: 0; }
.research-details-heading { display: grid; grid-template-columns: 28px minmax(0,1fr); align-items: start; gap: 10px; }
.research-details-heading > span { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 9px; background: #efecf8; color: #62579b; font-size: 10px; font-weight: 750; }
.research-details-heading small { display: block; color: #8d8792; font-size: 8px; font-weight: 750; letter-spacing: .07em; line-height: 11px; }
.research-details-heading h3 { margin: 2px 0 0; color: #302d33; font-size: 16px; line-height: 22px; }
.research-details-timeline { display: grid; gap: 0; margin: 17px 0 0 13px; padding: 0; list-style: none; }
.research-details-timeline li { position: relative; display: grid; grid-template-columns: 20px minmax(0,1fr); gap: 9px; padding: 0 0 17px; }
.research-details-timeline li:not(:last-child)::after { position: absolute; top: 19px; bottom: 0; left: 8px; width: 1px; background: #dfdbe3; content: ""; }
.research-details-timeline li > i { z-index: 1; display: grid; width: 17px; height: 17px; place-items: center; border-radius: 50%; background: #eeeaf8; color: #675a9f; font-size: 9px; font-style: normal; }
.research-details-timeline li > div { min-width: 0; }
.research-details-timeline small, .research-details-timeline strong { display: block; }
.research-details-timeline small { color: #8a8490; font-size: 9px; font-weight: 700; letter-spacing: .05em; line-height: 12px; text-transform: uppercase; }
.research-details-timeline strong { margin-top: 2px; color: #3d3940; font-size: 13px; line-height: 18px; }
.research-details-timeline p { margin: 2px 0 0; color: #77717a; font-size: 11px; line-height: 16px; }
.research-details-usage { margin: -4px 0 0 42px; color: #948e98; font-size: 9px; line-height: 13px; }
.research-detail-artifact { margin-top: 15px; padding: 16px; border: 1px solid #e5e1e8; border-radius: 14px; background: #fcfbfd; }
.research-detail-artifact > header { display: flex; align-items: flex-start; gap: 10px; }
.research-detail-artifact > header > span { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 9px; background: #eeeaf8; color: #665a9f; }
.research-detail-artifact > header small { display: block; color: #918a97; font-size: 8px; line-height: 11px; text-transform: uppercase; }
.research-detail-artifact > header h4 { margin: 2px 0 0; color: #302d33; font-size: 14px; line-height: 19px; }
.research-detail-artifact .artifact-summary { margin-top: 15px; }
.artifact-summary { margin: 0 0 18px; padding: 15px; border-radius: 12px; background: #f7f5ff; color: #45404b; font-size: 11px; line-height: 1.65; }
.artifact-metrics { display: grid; grid-template-columns: repeat(auto-fit,minmax(130px,1fr)); gap: 8px; margin-bottom: 20px; }
.artifact-metrics div { padding: 11px; border: 1px solid #e9e5df; border-radius: 10px; }
.artifact-metrics small, .artifact-metrics strong { display: block; }
.artifact-metrics small { color: #98918a; font-size: 7px; }
.artifact-metrics strong { margin-top: 5px; color: #37332e; font-size: 12px; }
.artifact-section { padding: 16px 0; border-top: 1px solid #eeeae5; }
.artifact-section h3, .artifact-section h5 { margin: 0 0 8px; color: #37332e; font-size: 12px; }
.artifact-section p, .artifact-section li { color: #5f5a54; font-size: 10px; line-height: 1.65; }
.artifact-section p { margin: 0; white-space: pre-wrap; }
.artifact-section ul { margin: 9px 0 0; padding-left: 18px; }
.research-details-sources ol { display: grid; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.research-details-sources a, .research-details-sources li > span { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 10px 11px; border: 1px solid #e7e3e9; border-radius: 10px; color: #46414c; text-decoration: none; }
.research-details-sources a:hover { border-color: #cbc5d7; background: #faf9fc; }
.research-details-sources strong { overflow: hidden; font-size: 11px; line-height: 15px; text-overflow: ellipsis; white-space: nowrap; }
.research-details-sources small { color: #918b95; font-size: 8px; line-height: 11px; }

.toast {
  position: fixed;
  z-index: 200;
  right: 22px;
  bottom: 22px;
  max-width: 320px;
  padding: 11px 14px;
  border-radius: 10px;
  background: #29262e;
  color: #fff;
  box-shadow: 0 12px 35px rgba(30,28,26,.2);
  font-size: 9px;
}

@media (max-width: 680px) {
  .v3-topbar { grid-template-columns: auto minmax(0, 1fr) auto; padding: 0 8px; }
  .v3-brand strong, .v4-account p, .v4-account b { display: none; }
  .v4-account { padding: 4px; border: 0; background: transparent; }
  .v4-account > span { width: 32px; height: 32px; flex-basis: 32px; }
  .account-menu { right: -2px; }
  .v3-agent { padding: 10px; }
  .v3-chat { border-radius: 13px; }
  .v3-chat-stream { gap: 20px; padding: 20px 14px; }
  .v3-message.user { max-width: 88%; }
  .agent-artifact, .portfolio-review { width: calc(100% - 39px); margin-left: 39px; }
  .v7-activity-list { padding-left: 21px; }
  .v7-activity-list::before { left: 31px; }
  .v3-composer-wrap { padding: 10px; }
  .v3-composer { min-height: 96px; }
  .v5-composer-note { display: none; }
  .auth-layer { align-items: end; padding: 10px; }
  .auth-card { max-height: calc(100vh - 20px); overflow-y: auto; padding-inline: 22px; }
  .auth-email-form > div { grid-template-columns: 1fr; }
  .auth-email-form button { width: 100%; }
  .research-details-layer { align-items: end; padding: 0; }
  .research-details-sheet { width: 100%; max-height: 88dvh; border-width: 1px 0 0; border-radius: 21px 21px 0 0; box-shadow: 0 -18px 50px rgba(30,28,34,.16); }
  .research-details-handle { display: block; width: 38px; height: 4px; margin: 8px auto 0; border-radius: 999px; background: #d8d4dc; }
  .research-details-sheet > header { padding: 10px 16px 13px; }
  .research-details-sheet > header h2 { font-size: 18px; }
  .research-details-content { padding: 0 16px calc(env(safe-area-inset-bottom) + 22px); }
  .research-details-trigger { width: 100%; }
  .broker-layer { align-items: end; padding: 0; }
  .broker-dialog { width: 100%; max-height: 92dvh; border-width: 1px 0 0; border-radius: 20px 20px 0 0; }
  .broker-dialog > header { padding: 17px 15px 14px; }
  .broker-body { padding: 16px 15px 22px; }
  .broker-grid { grid-template-columns: 1fr; }
  .broker-connected-card { grid-template-columns: auto minmax(0,1fr); }
  .broker-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .broker-static-ip { grid-template-columns: 1fr; }
  .broker-static-ip button { width: fit-content; }
  .stock-page-header { padding: calc(env(safe-area-inset-top) + 7px) 9px 9px; }
  .stock-page-content { padding: 18px 14px calc(env(safe-area-inset-bottom) + 28px); }
  .stock-page-hero { align-items: flex-start; gap: 15px; }
  .stock-page-identity > span { width: 42px; height: 42px; flex-basis: 42px; border-radius: 13px; font-size: 16px; }
  .stock-page-identity h1 { font-size: 19px; line-height: 25px; }
  .stock-page-identity p { font-size: 10px; line-height: 15px; }
  .stock-page-quote strong { font-size: 17px; line-height: 23px; }
  .stock-page-quote small { max-width: 135px; font-size: 9px; line-height: 13px; }
  .stock-page-chart { height: 270px; border-radius: 14px; }
  .stock-page-chart.stored { height: auto; padding: 13px 10px 7px; }
  .stock-page-chart.stored > header { align-items: flex-start; }
  .stock-page-chart.stored > header > div:last-child { align-items: flex-end; flex-direction: column; gap: 2px; }
  .stock-page-chart.stored svg { height: 228px; }
  .stock-page-grid { grid-template-columns: 1fr; }
  .stock-page-card { padding: 16px; border-radius: 14px; }
  .stock-page-timeline li { grid-template-columns: 72px minmax(0,1fr); }
  .stock-page-timeline li p { grid-column: 1 / -1; }
  .stock-page-research { padding: 16px; border-radius: 14px; }
  .stock-page-research > header { align-items: flex-start; flex-direction: column; gap: 3px; }
  .stock-page-research-sections { grid-template-columns: 1fr; }
  .stock-page-research-section { padding: 14px; }
  .stock-page-chat { grid-template-columns: 1fr; gap: 13px; padding: 17px 16px; border-radius: 14px; }
  .stock-page-chat form { grid-template-columns: 1fr; }
  .stock-page-chat button { justify-self: end; }
}

@media (max-width: 859px) {
  .v3-shell { grid-template-columns: minmax(0, 1fr); }
  .v3-menu { display: grid; }
  .chat-history-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, 330px);
    transform: translateX(-102%);
    transition: transform .22s ease;
  }
  .chat-history-sidebar.open { transform: translateX(0); }
  .chat-history-heading > button { display: grid; }
  .chat-history-backdrop {
    position: fixed;
    z-index: 44;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(0,0,0,.24);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
  }
  .chat-history-backdrop.open { display: block; opacity: 1; pointer-events: auto; }
}

@media (min-width: 860px) {
  .v3-topbar { display: none; }
  .v3-agent { height: 100vh; }
}

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