:root {
  --blue: #e41c23; --blue-dark: #b5121b; --blue-soft: #fdeced; --page: #f5f5f5; --tab: #eeeeee;
  --text: #1a1a1a; --muted: #666666; --label: #6b6b6b; --line: #e1e1e1; --red: #e41c23; --red-soft: #fff3f2;
  --green: #16804a; --yellow: #815909; --radius: 8px;
  font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif; color: var(--text); background: var(--page); font-size: 15px;
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m2 2 4 4 4-4' fill='none' stroke='%235e727f' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; padding-right: 29px !important; }
button { color: inherit; }
a { color: var(--blue-dark); }
button:disabled { cursor: default; opacity: .5; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #e41c23; outline-offset: 3px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline-offset: 1px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -60px; left: 20px; z-index: 20; background: white; padding: 10px; }
.skip-link:focus { top: 8px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 36px; font-weight: 700; margin-bottom: 0; letter-spacing: -.3px; line-height: 1.2; }
h2 { font-size: 25px; font-weight: 400; line-height: 1.25; margin-bottom: 6px; }
h3 { font-size: 25px; font-weight: 700; line-height: 1.25; margin-bottom: 22px; }
.site-header { height: 74px; background: white; padding: 0 max(32px, calc((100vw - 1260px)/2)); display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 0; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; font-size: 15px; font-weight: 800; line-height: 1.08; letter-spacing: .2px; }
.brand svg { width: 42px; height: 42px; }
.brand small { display: block; font-size: 9px; font-weight: 400; letter-spacing: .4px; margin-top: 4px; padding-top: 3px; border-top: 1px solid var(--text); color: var(--text); }
.account-controls { display: flex; align-items: center; gap: 15px; }
.account-controls select { font-size: 13px; border: 1px solid #4d4d4d; border-radius: 999px; padding: 4px 25px 4px 14px; background-color: white; max-width: 175px; }
.simulation-badge { font-size: 12px; color: var(--text); background: white; border: 1px solid #4d4d4d; padding: 3px 14px; border-radius: 999px; }
.user-avatar { width: 30px; height: 30px; display: grid; place-items: center; background: white; border: 1px solid #4d4d4d; color: var(--text); border-radius: 50%; font-size: 13px; }
.nav-wrap { background: white; }
.main-nav { max-width: 1260px; margin: auto; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); height: 58px; }
.nav-links, .nav-actions { display: flex; align-items: center; gap: 22px; }
.nav-actions { gap: 10px; }
.nav-link { border: 0; background: transparent; align-self: stretch; padding: 16px 9px 13px; border-bottom: 3px solid transparent; font-size: 15px; font-weight: 600; }
.nav-link:hover { color: var(--blue); }
.nav-link.active { color: var(--blue); border-bottom-color: var(--blue); }
main { max-width: 1260px; margin: auto; padding-bottom: 24px; }
.page-heading { display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; margin: 24px 0 18px; gap: 12px 24px; }
.eyebrow { font-size: 10px; font-weight: 600; letter-spacing: 1.2px; color: var(--muted); margin-bottom: 5px; }
.date-stamp { display: inline-flex; align-items: center; gap: 10px; margin: 0; padding: 7px 14px 7px 11px; background: white; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; line-height: 1.35; color: var(--text); }
.date-stamp svg { width: 24px; height: 24px; color: var(--blue); flex-shrink: 0; }
.date-stamp strong { display: block; font-weight: 600; }
.date-stamp small { display: block; font-size: 10px; color: var(--muted); }
.surface { background: white; border: 1px solid #ebebeb; border-radius: var(--radius); }
.account-summary { display: grid; grid-template-columns: 1.25fr 1fr 1fr 1fr; padding: 20px 23px; margin-bottom: 23px; }
.account-summary > div { display: flex; flex-direction: column; align-items: start; padding: 0 26px; border-left: 1px solid var(--line); }
.account-summary > div:first-child { padding-left: 0; border-left: 0; }
.account-summary strong { font-size: 22px; font-weight: 400; margin: 3px 0; font-variant-numeric: tabular-nums; }
.account-summary .account-identity strong { font-size: 18px; }
.small-label { display: block; color: var(--muted); font-size: 11px; line-height: 1.5; }
.account-summary .small-label, .quote-lead .small-label { color: var(--label); }
.muted { color: var(--muted); font-size: 12px; }
.button { border: 1px solid transparent; border-radius: 999px; padding: 7px 26px; min-height: 36px; font-size: 14px; line-height: 1.4; font-weight: 600; white-space: nowrap; transition: background-color .15s; }
.button.blue { background: var(--blue); color: white; }
.button.blue:hover:not(:disabled) { background: var(--blue-dark); }
.button.red { background: var(--red); color: white; }
.button.red:hover:not(:disabled) { background: #b5121b; }
.button.secondary { color: var(--text); background: white; border-color: #4d4d4d; }
.button.secondary:hover:not(:disabled) { background: #f5f5f5; }
.button.compact { min-height: 26px; padding: 1px 16px; font-size: 13px; font-weight: 400; }
.button.compact.blue { font-weight: 600; }
.blue-outline { border-color: var(--blue); color: var(--blue-dark); background: white; }
.blue-outline:hover:not(:disabled) { background: var(--blue-soft); }
.red-outline { border-color: var(--red); color: #b5121b; background: white; }
.red-outline:hover:not(:disabled) { background: var(--red-soft); }
.text-button { background: transparent; color: var(--blue); border: none; font-size: 12px; padding: 1px 0; text-align: left; }
.text-button:hover { text-decoration: underline; }
.market-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 15px; }
.search-control { display: flex; align-items: center; gap: 10px; border: 1px solid #d6d6d6; background: white; border-radius: 5px; padding: 6px 12px; width: 400px; flex-shrink: 0; }
.search-control span { font-size: 25px; color: #7a7a7a; line-height: 1; }
.search-control input { border: 0; background: transparent; outline: none; width: 100%; font-size: 13px; padding: 4px 0; }
.search-control:focus-within { outline: 2px solid var(--blue); }
.scenario-control { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.scenario-control label { font-size: 12px; color: var(--muted); }
.scenario-control select { border: 1px solid #d6d6d6; background-color: white; border-radius: 5px; padding: 8px 10px; font-size: 12px; max-width: 270px; }
.quote-card { padding: 26px 24px 16px; }
.quote-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.asset-title { display: flex; align-items: start; gap: 13px; }
.asset-title h2 { font-size: 30px; font-weight: 400; letter-spacing: -.2px; }
.market-badge { margin-top: 4px; font-size: 10px; padding: 3px 5px; border: 1px solid var(--line); border-radius: 3px; color: #707070; }
.trade-actions { display: flex; gap: 9px; padding-top: 4px; }
.trade-actions .button { font-weight: 700; padding: 6px 24px; }
.quote-lead { display: grid; grid-template-columns: max-content max-content max-content 1fr; gap: 0; padding: 16px 0 22px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.quote-lead > div { padding: 0 26px 0 21px; border-left: 1px solid var(--line); }
.quote-lead > div:first-child { padding-left: 0; border: 0; }
.quote-lead strong { display: block; font-size: 24px; font-weight: 400; margin-top: 2px; font-variant-numeric: tabular-nums; }
.quote-lead .last-price strong { font-size: 28px; line-height: 1.25; }
.quote-lead .quote-time strong { font-size: 15px; margin: 6px 0 4px; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.quote-tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--line); margin-top: 4px; }
.quote-tabs button { flex: 1; background: var(--tab); border: 1px solid var(--tab); border-bottom: none; padding: 11px 20px; font-size: 14px; font-weight: 600; border-radius: 6px 6px 0 0; }
.quote-tabs button:hover { background: #e2e2e2; }
.quote-tabs button[aria-selected="true"] { background: white; color: var(--blue); font-weight: 400; border-color: var(--line); position: relative; bottom: -1px; }
[role="tabpanel"] { padding: 30px 0 24px; border-bottom: 1px solid var(--line); }
.key-layout { display: grid; grid-template-columns: minmax(0,1fr) 330px; gap: 0 44px; padding-bottom: 28px; }
.key-layout h3 { margin-bottom: 18px; }
.quote-information { display: grid; grid-template-columns: repeat(4,1fr); }
#position-information { grid-template-columns: 1fr 1fr; }
.info-group { border-left: 1px solid var(--line); padding: 0 18px; min-width: 0; }
.info-group:first-child { border: 0; padding-left: 0; }
.info-pair { margin-bottom: 15px; }
.info-pair:last-child { margin-bottom: 0; }
.info-pair strong { display: block; font-size: 18px; font-weight: 400; margin-top: 0; font-variant-numeric: tabular-nums; }
.summary-layout { display: grid; grid-template-columns: 300px minmax(0,1fr); gap: 0 36px; }
.chart-section { min-width: 0; border-left: 1px solid var(--line); padding-left: 36px; }
.performance .muted { display: block; margin: 14px 0 0; font-size: 11px; }
.performance-row { display: grid; grid-template-columns: 78px 76px 1fr; align-items: center; gap: 8px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.performance-row strong { font-weight: 400; font-variant-numeric: tabular-nums; }
.performance-bar { display: block; height: 12px; }
.performance-bar i { display: block; height: 100%; min-width: 3px; }
.performance-bar i.up { background: var(--green); }
.performance-bar i.down { background: var(--red); }
.chart-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 15px; }
.chart-heading h3 { margin-bottom: 15px; }
.review-panel > h3, .scenario-assessment h3 { font-size: 20px; margin-bottom: 14px; }
.review-heading h2 { font-weight: 600; }
#price-chart { min-height: 200px; }
.price-svg { display: block; width: 100%; height: 220px; }
.price-svg text { font-family: inherit; font-size: 11px; fill: #737373; }
.source-note { font-size: 10px; color: #737373; margin: 18px 0 0; }
.table-scroll { max-width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { color: var(--text); font-weight: 600; font-size: 12px; background: var(--blue-soft); }
th, td { padding: 12px 13px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
th:first-child, td:first-child { text-align: left; }
td { white-space: nowrap; }
td .text-button { font-size: 13px; }
.holdings-card { padding: 25px; }
.section-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.profile-details { padding-top: 22px; font-size: 13px; }
summary { cursor: pointer; color: var(--blue-dark); }
#profile-details { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 15px; }
.page-footer { display: flex; justify-content: space-between; gap: 20px; color: #737373; font-size: 10px; padding: 22px 2px; }
.empty-state { background: #f7f7f7; padding: 28px; text-align: center; color: var(--muted); font-size: 13px; border-radius: 5px; }
.error-banner { background: #fff2ef; border-left: 3px solid var(--red); padding: 15px 20px; display: flex; justify-content: space-between; margin: 15px 0; gap: 16px; }
/* One trade ticket, with a separate, non-obscuring invitation on a red result. */
dialog { border: 0; background: transparent; padding: 0; color: var(--text); max-width: calc(100vw - 48px); max-height: calc(100dvh - 48px); width: 900px; overflow: auto; }
dialog::backdrop { background: rgba(255,255,255,.74); backdrop-filter: blur(1px); }
dialog:has(.dialog-layout.with-invitation) { width: 1190px; }
.dialog-layout { display: grid; grid-template-columns: minmax(0,1fr); align-items: start; gap: 18px; padding: 4px; }
.dialog-layout.with-invitation { grid-template-columns: minmax(0,1fr) 252px; }
.trade-ticket { background: white; border: 1px solid #cfcfcf; border-radius: 8px; box-shadow: 0 10px 34px rgba(0,0,0,.16); padding: 22px 28px 0; min-width: 0; }
.ticket-heading { display: flex; justify-content: space-between; align-items: start; margin-bottom: 18px; }
.ticket-heading h2 { font-size: 34px; font-weight: 300; line-height: 1.15; color: var(--blue); margin: 0; }
.ticket-heading .eyebrow { font-size: 9px; }
.icon-button { background: none; border: none; border-radius: 50%; width: 34px; height: 34px; padding: 0; font-size: 27px; line-height: 1; color: #6b6b6b; display: grid; place-items: center; }
.icon-button:hover { background: var(--blue-soft); }
.ticket-account { display: grid; grid-template-columns: 1fr auto; gap: 25px; padding-bottom: 20px; }
.ticket-account strong { display: block; font-size: 17px; font-weight: 600; margin: 2px 0 1px; }
.ticket-account > div:last-child { min-width: 150px; }
.ticket-tabs { display: flex; align-items: end; justify-content: space-between; padding-right: 4px; gap: 10px; }
.ticket-tabs > .muted { padding-bottom: 9px; }
.side-switch { display: flex; gap: 3px; }
.side-switch button { min-width: 128px; background: var(--tab); border: 0; border-radius: 6px 6px 0 0; padding: 11px 24px; font-size: 14px; font-weight: 600; }
.side-switch button:hover { background: #e2e2e2; }
.side-switch button[aria-pressed="true"] { background: white; color: var(--blue); font-weight: 400; box-shadow: 0 -3px 8px rgba(0,0,0,.08); }
.side-switch button#side-sell[aria-pressed="true"] { color: var(--red); }
.ticket-columns { position: relative; display: grid; grid-template-columns: 1.1fr .85fr; gap: 24px; padding: 26px 24px 22px; margin-bottom: 22px; min-height: 292px; background: white; border-radius: 0 6px 6px 6px; box-shadow: 0 3px 14px rgba(0,0,0,.12); }
#trade-form { padding-right: 2px; }
#trade-form label, #reason-form > label { display: block; font-size: 12px; margin: 0 0 7px; }
#trade-form input, textarea { border: 1px solid #d6d6d6; border-radius: 5px; padding: 10px 12px; width: 100%; background: #fff; color: var(--text); }
#trade-form input { height: 42px; }
#trade-form input[type="search"] { font-size: 14px; }
.field-description { font-size: 11px; color: var(--muted); margin: 6px 0 20px; min-height: 17px; }
.currency-tag { color: #707070; font-size: 10px; border: 1px solid #dedede; padding: 1px 4px; margin-left: 5px; border-radius: 3px; }
.amount-control { display: flex; align-items: center; border: 1px solid #d6d6d6; border-radius: 5px; width: 230px; max-width: 100%; }
.amount-control > span { color: var(--muted); padding-left: 13px; }
.amount-control input { border: none !important; background: transparent !important; }
.amount-control:focus-within { outline: 2px solid var(--blue); }
.read-only-field { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border: 1px solid #e4e4e4; border-radius: 5px; font-size: 12px; background: #fbfbfb; }
.read-only-field .muted { font-size: 10px; }
.ticket-quote { border-left: 1px solid var(--line); padding-left: 22px; }
.ticket-price { display: block; font-size: 24px; font-weight: 700; margin-top: 3px; }
.ticket-quote > p { font-size: 12px; }
.ticket-quote dl { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; font-size: 12px; margin: 22px 0; }
.ticket-quote dt { font-size: 10px; color: var(--muted); }
.ticket-quote dd { margin: 3px 0 0; }
.historical-label { display: inline-block; border: 1px solid var(--line); background: white; padding: 7px 11px; border-radius: 6px; font-size: 10px !important; color: #6b6b6b; }
.ticket-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 0 0 22px; }
.ticket-footer .button.secondary { min-height: 26px; padding: 1px 16px; font-size: 13px; font-weight: 400; }
.ticket-footer #submit-trade { min-height: 42px; padding: 9px 52px; font-size: 15px; }
.ticket-status { font-size: 13px; border-left: 3px solid var(--blue); background: #f5f5f5; padding: 12px 15px; margin-bottom: 16px; }
.ticket-status strong { display: block; margin-bottom: 3px; }
.ticket-status.green { background: #eef8f2; border-color: var(--green); }
.ticket-status.yellow { background: #fff8e7; border-color: var(--yellow); }
.ticket-status.red { background: var(--red-soft); border-color: var(--red); }
.inline-error { font-size: 12px; color: #a21d2c; background: #fff4f3; border-radius: 4px; padding: 10px 12px; }
.agent-invitation { position: relative; background: white; border: 1px solid #f0c4c6; border-radius: 10px; padding: 13px 18px 18px; margin-top: 115px; box-shadow: 0 7px 24px rgba(0,0,0,.10); text-align: center; }
.agent-invitation:before { content: ''; position: absolute; left: -7px; top: 40px; width: 12px; height: 12px; transform: rotate(45deg); border-left: 1px solid #f0c4c6; border-bottom: 1px solid #f0c4c6; background: white; }
.invite-close { position: absolute; right: 4px; top: 4px; width: 29px; height: 29px; font-size: 22px; }
.advisor { display: block; width: 92px; height: 88px; margin: -4px auto 7px; }
.agent-invitation h3 { font-size: 19px; margin-bottom: 9px; }
.agent-invitation p { font-size: 12px; line-height: 1.65; margin-bottom: 16px; }
.agent-invitation .small-label { font-size: 10px; margin-top: 10px; }
.waving-hand { transform-origin: 106px 98px; animation: wave 3.8s ease-in-out infinite; }
@keyframes wave { 0%,55%,100% { transform: rotate(0); } 62%,78% { transform: rotate(10deg); } 70%,86% { transform: rotate(-6deg); } }
/* A single review panel moves with the ticket, or into the page when it closes. */
.review-panel { padding: 24px; margin-top: 22px; }
#ticket-review-slot .review-panel { border: none; border-top: 1px solid var(--line); border-radius: 0; margin-top: 0; padding: 24px 0; }
.review-heading { display: flex; justify-content: space-between; align-items: start; gap: 15px; }
.review-heading h2 { font-size: 22px; margin: 5px 0 8px; }
.review-kicker { color: #9f2636; font-size: 10px; letter-spacing: .9px; }
.rule-summary { font-size: 14px; margin: 16px 0; }
.review-spectrum { background: #f8f8f8; border: 1px solid #e6e6e6; border-radius: 5px; padding: 15px 18px; margin: 21px 0; }
.spectrum-axis { display: flex; justify-content: space-between; font-size: 9px; color: var(--muted); border-bottom: 2px solid #d0d0d0; padding-bottom: 8px; gap: 8px; }
.spectrum-position { display: grid; grid-template-columns: 45px 1fr; align-items: center; gap: 10px; font-size: 11px; margin-top: 10px; }
.position-track { position: relative; height: 6px; background: #e6e6e6; border-radius: 4px; margin: 5px 0; }
.position-dot { position: absolute; top: -3px; width: 12px; height: 12px; border-radius: 50%; background: #4d4d4d; transform: translateX(-50%); }
.position-dot.after { background: #b72e3a; }
.spectrum-membership { font-size: 11px; margin: 12px 0 0; }
#reason-form textarea { resize: vertical; font-size: 13px; min-height: 79px; }
.conversation-footer { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-top: 10px; }
.conversation-footer .muted { font-size: 10px; }
.conversation-message { background: #f4f4f4; border-radius: 5px; padding: 12px 16px; font-size: 13px; margin-top: 18px; }
.conversation-message .small-label { margin-bottom: 4px; }
.conversation-message p:last-child { margin-bottom: 0; }
.backend-unavailable { border-left: 2px solid #bdbdbd; background: #f8f8f8; padding: 12px 15px; font-size: 12px; margin-top: 12px; }
.agent-answer { margin-top: 18px; font-size: 13px; }
.agent-answer h3 { font-size: 18px; margin-bottom: 10px; }
.agent-answer details { margin: 13px 0; }
.agent-answer ul { padding-left: 19px; }
.alternative { display: flex; justify-content: space-between; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); padding: 12px 0; }
.risk-acknowledgement { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 23px; }
.checkbox-label { display: flex; gap: 10px; align-items: start; font-size: 12px; }
.checkbox-label input { width: 16px; height: 16px; accent-color: var(--blue); margin: 1px 0 0; flex-shrink: 0; }
.risk-buttons { display: flex; justify-content: space-between; gap: 12px; margin-top: 17px; }
.terminal-note { background: #f5f5f5; padding: 14px 16px; font-size: 13px; margin-top: 20px; }
@media (max-width: 1330px) {
  main, .main-nav { margin-left: 32px; margin-right: 32px; }
}
@media (max-width: 960px) {
  .account-summary > div { padding: 0 16px; }
  .account-summary strong { font-size: 18px; }
  .quote-heading h2 { font-size: 22px; }
  .quote-lead { grid-template-columns: 1fr 1.35fr 1fr; }
  .key-layout { grid-template-columns: 1fr; gap: 26px 0; }
  .summary-layout { grid-template-columns: 1fr; gap: 26px 0; }
  .chart-section { border-left: 0; padding-left: 0; }
  .quote-time { grid-column: 1/-1; margin-top: 16px; padding-left: 0 !important; border: none !important; }
  .quote-lead .quote-time strong { display: inline; margin-left: 7px; }
  .quote-time .small-label, .quote-time .muted { display: inline; }
  .quote-time .muted { margin-left: 15px; }
  dialog:has(.dialog-layout.with-invitation) { width: 900px; }
  .dialog-layout.with-invitation { grid-template-columns: minmax(0,1fr); }
  .agent-invitation { margin-top: 0; text-align: left; padding: 18px 20px 18px 108px; min-height: 150px; }
  .agent-invitation:before { display: none; }
  .agent-invitation .advisor { position: absolute; left: 8px; top: 23px; }
  .agent-invitation p { margin-bottom: 9px; max-width: 460px; }
  .agent-invitation .button { margin-right: 10px; }
  .agent-invitation .small-label { display: inline; }
}
@media (max-width: 650px) {
  :root { font-size: 14px; }
  .site-header { height: 66px; padding: 0 16px; gap: 10px; }
  .brand { font-size: 14px; letter-spacing: .2px; gap: 5px; }
  .brand svg { width: 32px; height: 32px; }
  .brand small { font-size: 7px; letter-spacing: 1px; }
  .account-controls { gap: 7px; }
  .account-controls select { font-size: 11px; padding: 6px 8px; max-width: 95px; }
  .simulation-badge { padding: 3px 5px; font-size: 9px; }
  .user-avatar { display: none; }
  main, .main-nav { margin-left: 16px; margin-right: 16px; }
  .main-nav { height: 52px; }
  .nav-links { gap: 10px; }
  .nav-link { font-size: 13px; padding: 14px 3px 12px; }
  .nav-actions { gap: 5px; }
  .button.compact { padding-left: 11px; padding-right: 11px; font-size: 12px; }
  .page-heading { margin: 18px 0 14px; }
  h1 { font-size: 28px; }
  .date-stamp { font-size: 11px; }
  .account-summary { grid-template-columns: 1fr 1fr; gap: 18px 0; padding: 17px; }
  .account-summary > div { padding: 0 12px; }
  .account-summary > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .account-summary strong { font-size: 17px; }
  .account-summary .account-identity strong { font-size: 16px; }
  .market-toolbar { display: block; }
  .search-control { width: 100%; }
  .scenario-control { margin-top: 10px; justify-content: space-between; }
  .scenario-control select { max-width: 65%; }
  .quote-card { padding: 19px 16px 14px; }
  .quote-heading { display: block; }
  .asset-title { gap: 8px; }
  .asset-title h2 { font-size: 22px; }
  .trade-actions { justify-content: flex-end; padding-top: 6px; }
  .trade-actions .button { padding: 6px 23px; min-height: 33px; }
  .quote-lead { grid-template-columns: 1fr 1fr; gap: 16px 0; padding-top: 15px; }
  .quote-lead strong { font-size: 18px; }
  .quote-lead .last-price strong { font-size: 28px; }
  .quote-lead > div:nth-child(3) { padding-left: 0; border: 0; }
  .quote-lead .quote-time { grid-column: auto; margin-top: 0; border-left: 1px solid var(--line) !important; padding-left: 18px !important; }
  .quote-time .small-label, .quote-time strong, .quote-time .muted { display: block !important; margin-left: 0 !important; }
  .quote-lead .quote-time strong { font-size: 12px; margin: 3px 0; }
  .quote-time .muted { font-size: 9px; }
  .quote-tabs button { font-size: 11px; padding: 10px 5px; }
  h3 { font-size: 20px; }
  .quote-information { grid-template-columns: 1fr 1fr; gap: 20px 0; }
  .info-group { padding: 0 12px; }
  .info-group:nth-child(odd) { border-left: 0; padding-left: 0; }
  .info-pair strong { font-size: 14px; }
  .chart-heading { display: block; margin-bottom: 10px; }
  .chart-heading h3 { margin-bottom: 4px; }
  .chart-heading .muted { font-size: 10px; }
  .price-svg { height: 180px; }
  .holdings-card { padding: 19px 15px; }
  .section-heading { display: block; }
  #profile-details { grid-template-columns: 1fr; }
  .page-footer { display: block; font-size: 9px; }
  .page-footer span { display: block; margin-bottom: 4px; }
  dialog { max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); width: 100%; }
  .dialog-layout { padding: 2px; gap: 10px; }
  .trade-ticket { padding: 19px 18px 0; }
  .ticket-heading { margin-bottom: 16px; }
  .ticket-heading h2 { font-size: 25px; }
  .ticket-account { gap: 15px; grid-template-columns: 1fr auto; }
  .ticket-account > div:last-child { min-width: 0; }
  .ticket-account strong { font-size: 14px; }
  .ticket-tabs { padding-right: 2px; }
  .ticket-tabs .muted { font-size: 9px; text-align: right; }
  .side-switch button { padding: 10px 16px; min-width: 76px; }
  .ticket-columns { grid-template-columns: 1fr; gap: 6px; padding: 18px 16px 10px; }
  .ticket-quote { border-left: 0; border-top: 1px solid var(--line); padding: 16px 0 0; }
  .ticket-quote dl { margin: 12px 0; grid-template-columns: 1fr 1fr; }
  .ticket-price { font-size: 22px; }
  .ticket-footer #submit-trade { padding: 8px 34px; font-size: 14px; }
  .agent-invitation { padding-left: 88px; }
  .agent-invitation .advisor { width: 75px; height: 75px; left: 5px; }
  .review-panel { padding: 19px 16px; }
  .review-heading h2 { font-size: 19px; }
  .review-heading .button { padding: 5px 10px; font-size: 11px; }
  .review-kicker { font-size: 9px; }
  .review-spectrum { padding: 13px 10px; }
  .spectrum-axis { font-size: 8px; gap: 4px; }
  .conversation-footer { align-items: end; }
  .conversation-footer .muted { max-width: 160px; }
  .conversation-footer .button { padding: 8px 15px; }
  .risk-buttons { flex-wrap: wrap; }
  .risk-buttons .button { font-size: 12px; padding: 8px 15px; }
  .alternative { display: block; }
  .alternative .button { margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) { *, *:before, *:after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
/* Persisted conversation and conditional assessments share the brokerage surfaces. */
#conversation-result {display:grid;gap:12px;margin:16px 0;max-height:460px;overflow-y:auto;overflow-wrap:anywhere}
#conversation-result p {white-space:pre-wrap}
#conversation-result .conversation-message {margin-left:clamp(0px,4vw,48px);background:#f3f3f3;border-radius:12px;padding:14px 18px}
#conversation-result .agent-answer {margin-right:clamp(0px,4vw,48px);border:1px solid var(--line);border-radius:12px;padding:14px 18px}
.conversation-retry {display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin:8px 0}
.scenario-assessment {border:1px solid #e0e0e0;border-radius:12px;background:#f7f7f7;padding:16px;margin:16px 0;overflow-x:auto}
.scenario-assessment h3 {margin-top:0}
#reason {min-height:76px}

/* ---------------------------------------------------------------- asset picker */
.picker { position: fixed; z-index: 50; font-size: 13px; line-height: 1.35; text-align: left; color: var(--text); background: white; border: 1px solid #d6d6d6; border-radius: 8px; box-shadow: 0 14px 38px rgba(0,0,0,.14); display: flex; flex-direction: column; overflow: hidden; }
.picker[hidden] { display: none; }
.picker-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 8px; border-bottom: 1px solid var(--line); background: #fafafa; }
.picker-chips { display: flex; gap: 6px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.picker-chips .chip { white-space: nowrap; border: 1px solid #d6d6d6; background: white; color: var(--text); border-radius: 999px; padding: 4px 11px; font-size: 12px; cursor: pointer; }
.picker-chips .chip[aria-pressed=true] { background: var(--blue); border-color: var(--blue); color: white; }
.picker-chips .chip:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.picker-close { display: none; }
.picker-results { overflow-y: auto; flex: 1; padding: 4px 0; overscroll-behavior: contain; }
.picker-section { margin: 0; padding: 10px 16px 4px; font-size: 10px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase; color: var(--muted); }
.picker-option { display: grid; grid-template-columns: 38px minmax(0,1fr) 76px 112px; gap: 12px; align-items: center; padding: 9px 16px; cursor: pointer; border-left: 3px solid transparent; }
.picker-option[aria-selected=true] { background: var(--blue-soft); border-left-color: var(--blue); }
.asset-badge { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; letter-spacing: .3px; background: #fdeced; color: var(--blue-dark); flex-shrink: 0; }
.asset-badge.small { width: 26px; height: 26px; font-size: 10px; }
.asset-badge.g-us { background: #efefef; color: #333333; }
.asset-badge.g-funds { background: #e8f5ef; color: #22654a; }
.asset-badge.g-bonds { background: #f0f0f0; color: #4d4d4d; }
.asset-badge.g-gold { background: #fbf3e2; color: #7a5a12; }
.asset-badge.g-crypto { background: #f4edfb; color: #5f3d8f; }
.picker-main { min-width: 0; }
.picker-title { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-meta { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-meta strong { color: var(--text); font-weight: 600; }
.market-chip { border: 1px solid #d6d6d6; border-radius: 3px; padding: 0 5px; font-size: 10px; color: var(--muted); }
.picker mark { background: #fff1b8; color: inherit; border-radius: 2px; padding: 0 1px; }
.picker-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.tag { font-size: 11px; border-radius: 999px; padding: 1px 8px; line-height: 1.6; }
.tag.own { background: var(--blue-soft); color: var(--blue-dark); font-weight: 600; }
.tag.warn { background: var(--red-soft); color: var(--red); }
.tag.info { background: #fdf6e3; color: var(--yellow); }
.tag.history { background: transparent; color: var(--muted); padding-left: 0; border-radius: 0; }
.spark { width: 72px; height: 24px; }
.spark path { fill: none; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.spark path.up { stroke: var(--green); }
.spark path.down { stroke: var(--red); }
.picker-price { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-variant-numeric: tabular-nums; }
.picker-price strong { font-size: 13px; color: var(--text); white-space: nowrap; }
.pill { font-size: 11px; border-radius: 999px; padding: 0 7px; font-weight: 600; white-space: nowrap; }
.pill.up { background: #e8f4ee; color: var(--green); }
.pill.down { background: var(--red-soft); color: var(--red); }
.picker-empty { padding: 26px 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.picker-empty strong { color: var(--text); font-size: 14px; }
.picker-foot { margin: 0; padding: 8px 16px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); background: #fafafa; }
.scenario-cards { display: flex; gap: 8px; flex-wrap: wrap; }
.scenario-card { display: flex; align-items: center; gap: 8px; border: 1px solid #d6d6d6; background: white; border-radius: 8px; padding: 6px 12px 6px 7px; cursor: pointer; text-align: left; color: var(--text); }
.scenario-card:hover { border-color: var(--blue); background: var(--blue-soft); }
.scenario-card:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.scenario-card strong { display: block; font-size: 12px; }
.scenario-card small { display: block; font-size: 11px; color: var(--muted); }
.picker.sheet { border-radius: 14px 14px 0 0; bottom: 0; }
.picker.sheet .picker-close { display: inline-block; font-size: 13px; }
@media (max-width: 700px) {
  .picker-option { grid-template-columns: 34px minmax(0,1fr) 92px; }
  .picker-option .spark { display: none; }
  .scenario-control { justify-content: flex-start; }
}
@media (prefers-reduced-motion: no-preference) { .picker:not([hidden]) { animation: picker-in .12s ease-out; } }
@keyframes picker-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- spectrum, explained */
.spectrum-title { margin: 0 0 4px; font-size: 15px; }
.spectrum-intro { margin: 0 0 6px; font-size: 13px; color: var(--text); max-width: 780px; }
.spectrum-line { position: relative; height: 128px; margin: 8px 56px 0; }
.spectrum-line:before { content: ''; position: absolute; left: 0; right: 0; top: 74px; height: 4px; border-radius: 2px; background: linear-gradient(90deg,#f6c9cb,#e41c23 60%,#b5121b); }
.spectrum-step { position: absolute; top: 69px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; width: 110px; text-align: center; font-size: 11px; color: var(--muted); }
.spectrum-step i { width: 14px; height: 14px; border-radius: 50%; background: white; border: 2px solid #b3b3b3; margin-bottom: 6px; }
.spectrum-step.aim i { width: 18px; height: 18px; margin-top: -2px; background: var(--text); border-color: var(--text); box-shadow: 0 0 0 4px #ececec; }
.spectrum-step.aim span { color: var(--text); font-weight: 700; }
.spectrum-step small { font-size: 10px; color: var(--text); }
.spectrum-move { position: absolute; top: 72px; height: 8px; border-radius: 4px; background: rgba(183,46,58,.22); }
.spectrum-pin { position: absolute; top: 30px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; z-index: 2; pointer-events: none; }
.spectrum-pin.high { top: 0; }
.pin-label { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.pin-stem { width: 2px; flex: none; }
.spectrum-pin .pin-stem { height: 20px; }
.spectrum-pin.high .pin-stem { height: 50px; }
.pin-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid white; margin-top: -1px; }
.spectrum-pin.before .pin-label { background: #ebebeb; color: #4d4d4d; }
.spectrum-pin.before .pin-stem, .spectrum-pin.before .pin-dot { background: #4d4d4d; }
.spectrum-pin.after .pin-label { background: #b72e3a; color: white; }
.spectrum-pin.after .pin-stem, .spectrum-pin.after .pin-dot { background: #b72e3a; }
.spectrum-pin.same .pin-label { background: #4d4d4d; color: white; }
.spectrum-pin.same .pin-stem, .spectrum-pin.same .pin-dot { background: #4d4d4d; }
.spectrum-ends { display: flex; justify-content: space-between; margin: 0 20px 4px; font-size: 11px; color: var(--muted); }
.spectrum-reading { margin: 8px 0 6px 18px; padding: 0; font-size: 13px; }
.spectrum-reading li { margin: 2px 0; }
.spectrum-reading li.strong { font-weight: 600; }
.spectrum-note { font-size: 12px; background: white; border: 1px solid #e6e6e6; border-radius: 5px; padding: 9px 12px; margin: 8px 0; color: var(--text); }
.spectrum-details { font-size: 12px; margin-top: 6px; }
.spectrum-details summary { cursor: pointer; color: var(--blue-dark); }
.spectrum-details p { margin: 6px 0 0; }
@media (max-width: 700px) { .spectrum-line { margin: 8px 26px 0; } .spectrum-step { width: 64px; font-size: 9px; } .spectrum-ends { margin: 0 4px 4px; } }

/* amount field: one focus ring around the whole control, "$" as a clean prefix */
.amount-control { overflow: hidden; background: white; }
.amount-control > span { align-self: stretch; display: flex; align-items: center; padding: 0 11px 0 13px; background: #f5f5f5; border-right: 1px solid #d6d6d6; }
.amount-control input:focus, .amount-control input:focus-visible { outline: none !important; box-shadow: none !important; }
.amount-control:focus-within { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(228,28,35,.22); }

.mix-change { margin: 6px 0 2px; }
.mix-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.mix-chip { display: flex; align-items: baseline; gap: 6px; background: white; border: 1px solid #e6e6e6; border-radius: 6px; padding: 5px 10px; font-size: 12px; color: var(--muted); }
.mix-chip strong { color: var(--text); font-size: 12px; }
.mix-chip em { font-style: normal; font-weight: 700; border-radius: 999px; padding: 0 6px; }
.mix-chip.up { border-color: #b9dccb; } .mix-chip.up em { background: #e8f4ee; color: var(--green); }
.mix-chip.down { border-color: #efc6c9; } .mix-chip.down em { background: var(--red-soft); color: var(--red); }

/* ---------------------------------------------------------------- red & white brand
   Red is the brand and the primary action (Achat). Vente uses charcoal so the two
   order sides stay distinct; red alerts and negative values keep their own red. */
body { border-top: 4px solid var(--blue); }
.site-header, .nav-wrap { background: white; }
.brand span { padding-left: 12px; border-left: 4px solid var(--blue); }
.brand small { border-top-color: var(--blue); }
.nav-link.active { color: var(--text); border-bottom-color: var(--blue); }
.nav-link:hover { color: var(--blue); }
.text-button, summary, .spectrum-details summary { color: var(--blue-dark); }
.button.red { background: #1a1a1a; }
.button.red:hover:not(:disabled) { background: #3a3a3a; }
.red-outline { border-color: #1a1a1a; color: #1a1a1a; }
.red-outline:hover:not(:disabled) { background: #f0f0f0; }
.quote-tabs button[aria-selected="true"], .side-switch button[aria-pressed="true"] { color: var(--blue); box-shadow: inset 0 3px var(--blue); }
.side-switch button#side-sell[aria-pressed="true"] { color: #1a1a1a; box-shadow: inset 0 3px #1a1a1a; }
.date-stamp svg { color: var(--blue); }
.account-summary .small-label, .quote-lead .small-label { color: var(--label); }
.picker-option[aria-selected=true] { background: #fdeced; border-left-color: var(--blue); }
.tag.own { background: #fdeced; color: var(--blue-dark); }
.ticket-status { border-left-color: #4d4d4d; }
.agent-invitation .advisor circle:first-child { fill: #fdeced; }
.lang-toggle { border: 0; background: none; padding: 4px 2px; font-size: 13px; color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.lang-toggle:hover { color: var(--blue); }

/* Visual red review: deterministic figures from the rule engine, drawn before any model text. */
.review-visuals {display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:14px;margin:16px 0 8px}
.viz-card {border:1px solid var(--line);border-radius:10px;padding:14px 16px 12px;background:#fff;min-width:0}
.viz-card.red {border-color:#e3b4b9;background:var(--red-soft)}
.viz-card.yellow {border-color:#e6d4a4;background:#fffaf0}
.viz-card.wide {grid-column:1/-1}
.viz-card .small-label {letter-spacing:.4px;text-transform:uppercase;font-size:10px}
.viz-headline {font-size:14px;font-weight:600;line-height:1.35;margin:4px 0 10px}
.viz-big {display:flex;align-items:baseline;gap:10px;margin:2px 0 8px}
.viz-big strong {font-size:36px;font-weight:600;line-height:1;color:var(--red);letter-spacing:-1px}
.viz-big span {font-size:12px;color:var(--muted)}
.viz-card svg {width:100%;height:auto;display:block;overflow:visible}
.viz-card svg text {font-family:Arial,Helvetica,sans-serif}
.viz-label {font-size:11px;fill:var(--text)}
.viz-value {font-size:11px;fill:var(--muted)}
.viz-value.out {fill:var(--red);font-weight:700}
.viz-track {fill:#e9f0f4}
.viz-band {fill:#cfe6d8}
.viz-after {fill:#3a6ea5}
.viz-after.out {fill:var(--red)}
.viz-before {stroke:#20313d;stroke-width:2}
.viz-cap {stroke:var(--red);stroke-width:2;stroke-dasharray:3 2}
.viz-cap-label {font-size:10px;fill:var(--red);font-weight:700}
.viz-loss {fill:var(--red)}
.viz-keep {fill:#9bbad0}
.viz-recovery {fill:#d9a2a7}
.viz-recovery.open {fill:url(#viz-hatch)}
.viz-goal {stroke:var(--yellow);stroke-width:2}
.viz-goal-label {font-size:10px;fill:var(--yellow);font-weight:700}
.viz-axis {stroke:#b9c7d0;stroke-width:1}
.viz-tick {font-size:9px;fill:var(--muted)}
.viz-cover-before {fill:#c9d7e0}
.viz-cover-after {fill:#3a6ea5}
.viz-cover-after.out {fill:var(--red)}
.viz-legend {display:flex;flex-wrap:wrap;gap:4px 14px;font-size:11px;color:var(--muted);margin-top:8px}
.viz-legend i {display:inline-block;width:10px;height:10px;border-radius:2px;margin-right:5px;vertical-align:-1px}
.viz-note {font-size:11px;color:var(--muted);margin:8px 0 0;line-height:1.45}
.exact-numbers {margin:6px 0 16px;font-size:13px}
.exact-numbers summary {cursor:pointer;color:var(--blue-dark);font-size:12px}
.exact-numbers[open] summary {margin-bottom:8px}
@media (max-width:640px){.review-visuals{grid-template-columns:1fr}.viz-big strong{font-size:30px}}
.viz-goal-dot {fill:var(--yellow)}
.viz-goal-number {font-size:8px;fill:#fff;font-weight:700}
.viz-needs {margin:6px 0 0;padding-left:18px;font-size:11px;color:var(--yellow);line-height:1.5}
.viz-needs li::marker {font-weight:700}
.hist-before {fill:none;stroke:#20313d;stroke-width:2}
.hist-after {fill:none;stroke:#3a6ea5;stroke-width:2.5}
.hist-after.out {stroke:var(--red)}
.hist-gap {stroke:#815909;stroke-width:2;stroke-dasharray:3 2}
.hist-range-before {fill:#c9d7e0}
.hist-range-after {fill:#9fc0dd}
.hist-range-after.out {fill:#e6a7ad}
.hist-median {fill:#20313d}

/* visual review: simpler cards, extra detail behind an (i) button, no oversized chart text */
.viz-head {display:flex;align-items:center;justify-content:space-between;gap:10px}
.viz-info {display:inline-flex;align-items:center;gap:6px;border:1px solid var(--line);background:#fff;border-radius:999px;padding:3px 10px 3px 4px;font-size:11px;color:var(--text);cursor:pointer;flex-shrink:0}
.viz-info:hover {border-color:var(--red)}
.viz-info:focus-visible {outline:2px solid var(--red);outline-offset:2px}
.viz-info-icon {width:16px;height:16px;border-radius:50%;display:grid;place-items:center;background:var(--text);color:#fff;font:italic 700 11px Georgia,serif}
.viz-info[aria-expanded=true] .viz-info-icon {background:var(--red)}
.viz-more {border-top:1px dashed var(--line);margin-top:10px;padding-top:8px}
.viz-more[hidden] {display:none}
.viz-plain {font-size:13px;margin:8px 0 0;color:var(--text)}
.viz-note.strong {color:var(--text);font-weight:600}
.viz-card.wide svg {max-width:540px}
.viz-card svg {max-height:260px}

/* compact tiles; a tile opens to full width when its charts are shown */
.review-visuals {grid-template-columns:repeat(auto-fit,minmax(260px,1fr))}
.viz-card.expanded {grid-column:1/-1}
.viz-card .viz-headline {margin-bottom:6px}
.viz-card .viz-big {margin:4px 0 2px}
.viz-card .viz-big strong {font-size:30px}
.viz-list {margin:6px 0 0;padding-left:18px;font-size:13px}
.viz-list li {margin:2px 0}
.viz-card.expanded svg {max-width:540px}
.review-spectrum .viz-head .spectrum-title {margin:0}
.review-spectrum .spectrum-reading {margin-top:8px}

/* compact red-review header: status pill + trade on one line, the reason as the only headline */
.review-heading {align-items:center;gap:12px}
.review-head-text {min-width:0}
.review-meta-row {display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.review-kicker {display:inline-block;background:var(--red-soft);color:#9f2636;border:1px solid #efc6c9;border-radius:999px;padding:2px 10px;font-size:11px;font-weight:700;letter-spacing:.2px;text-transform:none}
.review-kicker::before {content:"";display:inline-block;width:7px;height:7px;border-radius:50%;background:#c4283a;margin-right:6px;vertical-align:1px}
#pending-trade-summary {margin:0;font-size:12px}
.review-heading .rule-summary {font-size:15px;font-weight:600;margin:6px 0 0;line-height:1.35;color:var(--text)}
.review-panel .exact-numbers {margin:6px 0 12px}
