:root {
  --bx-bg: #f5f9f7;
  --bx-surface: #ffffff;
  --bx-surface-soft: #edf6f1;
  --bx-mint: #dceee5;
  --bx-mint-strong: #b7d9c8;
  --bx-teal: #4a8a72;
  --bx-teal-dark: #34705a;
  --bx-ink: #1e342c;
  --bx-muted: #64756e;
  --bx-border: #d5e2dc;
  --bx-gold: #c7972f;
  --bx-warn: #fff5dc;
  --bx-danger: #a8443f;
  --bx-shadow: 0 18px 52px rgba(37, 83, 68, .09);
}

* { box-sizing: border-box; }
body.exchange-app { margin: 0; min-height: 100vh; background: radial-gradient(circle at 85% 5%, #e5f2eb 0, transparent 30rem), var(--bx-bg); color: var(--bx-ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.bx-shell { min-height: 100vh; display: grid; grid-template-columns: 245px 1fr; }
.bx-sidebar { position: sticky; top: 0; height: 100vh; padding: 1.35rem 1rem; background: rgba(241, 248, 244, .96); border-right: 1px solid var(--bx-border); backdrop-filter: blur(18px); }
.bx-brand { display: flex; align-items: center; gap: .7rem; color: var(--bx-ink); text-decoration: none; padding: .35rem; }
.bx-brand img { width: 42px; height: 42px; border-radius: 12px; }
.bx-brand strong, .bx-brand small { display: block; }
.bx-brand small { margin-top: .15rem; color: var(--bx-muted); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
.bx-side-label { margin: 2rem .55rem .55rem; color: var(--bx-muted); font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.bx-nav { display: grid; gap: .3rem; }
.bx-nav button, .bx-nav a { display: flex; align-items: center; gap: .7rem; width: 100%; min-height: 41px; padding: .64rem .76rem; border: 0; border-radius: 12px; background: transparent; color: #49645a; font-size: .84rem; text-align: left; text-decoration: none; font-weight: 700; cursor: pointer; }
.bx-nav button span { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 8px; background: rgba(255,255,255,.72); color: var(--bx-teal); }
.bx-nav button:hover, .bx-nav button[aria-current="page"] { color: var(--bx-teal-dark); background: white; box-shadow: 0 8px 24px rgba(45, 103, 82, .08); }
.bx-nav button[aria-current="page"] span { background: var(--bx-mint); }
.bx-side-footer { position: absolute; left: 1rem; right: 1rem; bottom: 1.2rem; padding: .85rem; border: 1px solid var(--bx-border); border-radius: 14px; background: rgba(255,255,255,.75); color: var(--bx-muted); font-size: .75rem; line-height: 1.45; }
.bx-frame { min-width: 0; }
.bx-header { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; min-height: 74px; padding: .85rem clamp(1rem, 3vw, 2.6rem); border-bottom: 1px solid rgba(207,225,216,.9); background: rgba(250,253,251,.9); backdrop-filter: blur(18px); }
.bx-header h1 { margin: .08rem 0 0; font-size: clamp(1.25rem, 1.8vw, 1.55rem); letter-spacing: -.02em; }
.bx-eyebrow { margin: 0; color: var(--bx-teal); font-size: .68rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.bx-account { display: flex; align-items: center; gap: .55rem; }
.bx-account-meta { text-align: right; }
.bx-account-meta strong, .bx-account-meta span { display: block; }
.bx-account-meta span { color: var(--bx-muted); font-size: .73rem; }
.bx-avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--bx-mint); color: var(--bx-teal-dark); font-weight: 900; }
.bx-icon-button, .bx-logout { min-height: 38px; border: 1px solid var(--bx-border); border-radius: 10px; background: white; color: var(--bx-ink); font-weight: 800; cursor: pointer; }
.bx-icon-button { display: none; width: 40px; }
.bx-logout { padding: .55rem .8rem; }
.bx-main { width: min(1370px, 100%); margin: 0 auto; padding: 1.5rem clamp(1rem, 3vw, 2.6rem) 4rem; }
.bx-view[hidden] { display: none !important; }
.bx-view-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.15rem; }
.bx-view-heading h2 { margin: .25rem 0 0; font-size: clamp(1.45rem, 2.4vw, 2.05rem); letter-spacing: -.035em; }
.bx-view-heading > p { max-width: 45rem; margin: 0; color: var(--bx-muted); line-height: 1.55; }
.bx-card { border: 1px solid var(--bx-border); border-radius: 18px; background: rgba(255,255,255,.93); box-shadow: var(--bx-shadow); }
.bx-status-banner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; padding: 1rem 1.1rem; margin-bottom: 1rem; }
.bx-status-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--bx-mint); color: var(--bx-teal-dark); font-weight: 900; }
.bx-status-banner h3, .bx-status-banner p { margin: 0; }
.bx-status-banner p { margin-top: .2rem; color: var(--bx-muted); font-size: .88rem; }
.bx-pill { display: inline-flex; align-items: center; gap: .35rem; width: fit-content; padding: .38rem .62rem; border-radius: 999px; background: var(--bx-surface-soft); color: var(--bx-teal-dark); font-size: .7rem; font-weight: 900; text-transform: capitalize; }
.bx-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--bx-teal); }
.bx-pill[data-status="submitted"], .bx-pill[data-status="under_review"] { background: #eef3ff; color: #395d8c; }
.bx-pill[data-status="changes_requested"], .bx-pill[data-status="suspended"] { background: var(--bx-warn); color: #7b5c16; }
.bx-grid { display: grid; gap: 1rem; }
.bx-grid--overview { grid-template-columns: minmax(0, 1.45fr) minmax(270px, .75fr); }
.bx-card-body { padding: 1.15rem; }
.bx-card-heading { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: 1rem; }
.bx-card-heading h3 { margin: 0; font-size: 1rem; }
.bx-onboarding { display: grid; gap: .55rem; margin: 0; padding: 0; list-style: none; }
.bx-onboarding li { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: .7rem; padding: .68rem; border-radius: 12px; background: #f8fbf9; }
.bx-onboarding li > span:first-child { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: #edf2ef; color: var(--bx-muted); font-size: .78rem; font-weight: 900; }
.bx-onboarding li.complete > span:first-child { background: var(--bx-mint); color: var(--bx-teal-dark); }
.bx-onboarding strong, .bx-onboarding small { display: block; }
.bx-onboarding strong { font-size: .85rem; }
.bx-onboarding small { margin-top: .12rem; color: var(--bx-muted); font-size: .72rem; }
.bx-text-button { border: 0; background: transparent; color: var(--bx-teal-dark); font-size: .75rem; font-weight: 900; cursor: pointer; }
.bx-stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .65rem; }
.bx-stat { min-height: 100px; padding: .9rem; border: 1px solid var(--bx-border); border-radius: 14px; background: linear-gradient(145deg, #fff, #eff8f3); }
.bx-stat strong, .bx-stat span { display: block; }
.bx-stat strong { font-size: 1.45rem; letter-spacing: -.035em; }
.bx-stat span { margin-top: .2rem; color: var(--bx-muted); font-size: .74rem; }
.bx-action-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.bx-button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: .62rem .86rem; border: 1px solid var(--bx-teal-dark); border-radius: 11px; background: var(--bx-teal-dark); color: white; font-size: .82rem; text-decoration: none; font-weight: 850; cursor: pointer; }
.bx-button:hover { border-color: var(--bx-ink); background: var(--bx-ink); }
.bx-button--soft { border-color: var(--bx-border); background: var(--bx-surface-soft); color: var(--bx-teal-dark); }
.bx-button--soft:hover { background: var(--bx-mint); }
.bx-button--plain { border-color: var(--bx-border); background: white; color: var(--bx-ink); }
.bx-button:disabled { opacity: .5; cursor: not-allowed; }
.bx-form-card { padding: clamp(1rem, 2vw, 1.35rem); }
.bx-form-section + .bx-form-section { margin-top: 1.35rem; padding-top: 1.25rem; border-top: 1px solid var(--bx-border); }
.bx-form-section h3 { margin: 0 0 .25rem; font-size: 1rem; }
.bx-form-section > p { margin: 0 0 1rem; color: var(--bx-muted); font-size: .82rem; }
.bx-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.bx-form-grid label { display: grid; gap: .35rem; color: #37584b; font-size: .74rem; font-weight: 800; }
.bx-form-grid label.wide { grid-column: 1 / -1; }
.bx-form-grid input, .bx-form-grid select, .bx-form-grid textarea, .bx-search { width: 100%; border: 1px solid #c6dcd1; border-radius: 10px; background: white; color: var(--bx-ink); outline: none; }
.bx-form-grid input, .bx-form-grid select { min-height: 42px; padding: .65rem .75rem; }
.bx-form-grid textarea { min-height: 90px; padding: .72rem .75rem; resize: vertical; }
.bx-form-grid input:focus, .bx-form-grid select:focus, .bx-form-grid textarea:focus, .bx-search:focus { border-color: var(--bx-teal); box-shadow: 0 0 0 3px rgba(74,138,114,.14); }
.bx-progress { height: 8px; border-radius: 999px; background: #e3eee9; overflow: hidden; }
.bx-progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--bx-teal), #70b795); transition: width .25s ease; }
.bx-status { min-height: 1.2rem; margin: .65rem 0 0; color: var(--bx-muted); font-size: .78rem; }
.bx-status.error { color: var(--bx-danger); }
.bx-split { display: grid; grid-template-columns: minmax(290px, .72fr) minmax(0, 1.28fr); gap: 1rem; align-items: start; }
.bx-list { display: grid; gap: .65rem; }
.bx-list-empty { padding: 2rem 1rem; border: 1px dashed var(--bx-border); border-radius: 14px; color: var(--bx-muted); text-align: center; }
.bx-list-item { padding: .9rem; border: 1px solid var(--bx-border); border-radius: 14px; background: white; }
.bx-list-item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .7rem; }
.bx-list-item h4, .bx-list-item p { margin: 0; }
.bx-list-item h4 { font-size: .95rem; }
.bx-list-item p { margin-top: .3rem; color: var(--bx-muted); font-size: .78rem; line-height: 1.45; }
.bx-list-meta { display: flex; flex-wrap: wrap; gap: .35rem .8rem; margin-top: .7rem; color: #4c665c; font-size: .7rem; }
.bx-list-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .75rem; }
.bx-mini-button { min-height: 34px; padding: .48rem .68rem; border: 1px solid var(--bx-border); border-radius: 9px; background: var(--bx-surface-soft); color: var(--bx-teal-dark); font-size: .72rem; font-weight: 900; cursor: pointer; }
.bx-checks { display: grid; grid-template-columns: repeat(2, 1fr); gap: .55rem; margin-top: .8rem; }
.bx-check { display: flex; align-items: center; gap: .55rem; padding: .65rem; border-radius: 11px; background: #f6faf8; font-size: .74rem; }
.bx-check i { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: #e7eee9; font-style: normal; font-weight: 900; }
.bx-check[data-state="passed"] i { background: var(--bx-mint); color: var(--bx-teal-dark); }
.bx-lock { padding: 1rem; border: 1px solid #efdca8; border-radius: 14px; background: var(--bx-warn); color: #644f20; font-size: .82rem; line-height: 1.5; }
.bx-toolbar { display: flex; align-items: center; justify-content: space-between; gap: .7rem; margin-bottom: .8rem; }
.bx-search { min-height: 40px; max-width: 390px; padding: .6rem .75rem; }
.bx-tabs { display: flex; gap: .35rem; padding: .3rem; border: 1px solid var(--bx-border); border-radius: 12px; background: #edf7f2; }
.bx-tabs button { min-height: 34px; padding: .45rem .7rem; border: 0; border-radius: 8px; background: transparent; color: var(--bx-muted); font-size: .72rem; font-weight: 900; cursor: pointer; }
.bx-tabs button[aria-selected="true"] { background: white; color: var(--bx-teal-dark); box-shadow: 0 4px 12px rgba(29, 78, 60, .08); }
.bx-deal-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 570px; overflow: hidden; }
.bx-deal-list { padding: .75rem; border-right: 1px solid var(--bx-border); background: #f5faf7; }
.bx-deal-list button { width: 100%; padding: .8rem; border: 1px solid transparent; border-radius: 11px; background: transparent; color: var(--bx-ink); text-align: left; cursor: pointer; }
.bx-deal-list button:hover, .bx-deal-list button.active { border-color: var(--bx-border); background: white; }
.bx-deal-list button strong, .bx-deal-list button small { display: block; }
.bx-deal-list button small { margin-top: .2rem; color: var(--bx-muted); }
.bx-conversation { display: grid; grid-template-rows: auto 1fr auto; min-width: 0; }
.bx-conversation-head { padding: 1rem; border-bottom: 1px solid var(--bx-border); }
.bx-conversation-head h3, .bx-conversation-head p { margin: 0; }
.bx-conversation-head p { margin-top: .2rem; color: var(--bx-muted); font-size: .78rem; }
.bx-messages { display: flex; flex-direction: column; gap: .65rem; min-height: 300px; max-height: 520px; overflow-y: auto; padding: 1rem; }
.bx-message { align-self: flex-start; max-width: min(78%, 600px); padding: .7rem .82rem; border-radius: 14px 14px 14px 4px; background: #edf5f1; }
.bx-message.mine { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: var(--bx-mint); }
.bx-message p, .bx-message small { margin: 0; }
.bx-message p { font-size: .84rem; line-height: 1.45; }
.bx-message small { display: block; margin-top: .3rem; color: var(--bx-muted); font-size: .65rem; }
.bx-message-form { display: grid; grid-template-columns: 180px 1fr auto; gap: .55rem; padding: .8rem; border-top: 1px solid var(--bx-border); }
.bx-message-form select, .bx-message-form input { min-height: 40px; border: 1px solid var(--bx-border); border-radius: 10px; padding: .55rem .65rem; }
.bx-dialog { width: min(640px, calc(100% - 2rem)); border: 0; border-radius: 18px; padding: 0; color: var(--bx-ink); box-shadow: 0 30px 90px rgba(18,52,40,.25); }
.bx-dialog::backdrop { background: rgba(14, 41, 32, .42); backdrop-filter: blur(5px); }
.bx-dialog-head { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 1.15rem; border-bottom: 1px solid var(--bx-border); }
.bx-dialog-head h2 { margin: 0; font-size: 1.2rem; }
.bx-dialog-body { padding: 1.15rem; }
.bx-close { width: 34px; height: 34px; border: 1px solid var(--bx-border); border-radius: 9px; background: white; cursor: pointer; }
.bx-toast { position: fixed; right: 1rem; bottom: 1rem; z-index: 50; max-width: 390px; padding: .8rem 1rem; border-radius: 12px; background: var(--bx-ink); color: white; box-shadow: var(--bx-shadow); font-size: .8rem; }

/* Public onboarding */
.bx-join { min-height: 100vh; padding: 2rem 1rem; background: linear-gradient(135deg, #f2f8f5, #fff 55%, #e7f2ec); }
.bx-join-shell { width: min(1100px, 100%); margin: 0 auto; }
.bx-join-back { color: var(--bx-teal-dark); font-weight: 800; text-decoration: none; }
.bx-join-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 1rem; margin-top: 1.5rem; }
.bx-join-intro { padding: clamp(1.2rem, 4vw, 2.5rem); border: 1px solid var(--bx-border); border-radius: 22px; background: linear-gradient(145deg, #dceee5, #f0f7f3); color: var(--bx-ink); }
.bx-join-intro h1 { margin: .5rem 0; font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.03; letter-spacing: -.045em; }
.bx-join-intro > p { color: var(--bx-muted); font-size: .92rem; line-height: 1.58; }
.bx-flow { display: grid; gap: .7rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.bx-flow li { display: grid; grid-template-columns: 30px 1fr; gap: .65rem; align-items: start; }
.bx-flow span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: rgba(255,255,255,.82); color: var(--bx-teal-dark); font-weight: 900; }
.bx-flow strong, .bx-flow small { display: block; }
.bx-flow small { margin-top: .15rem; color: var(--bx-muted); font-size: .75rem; }
.bx-join-panel { padding: clamp(1.2rem, 4vw, 2.1rem); }
.bx-join-panel h2 { margin: 0 0 .35rem; font-size: 1.4rem; }
.bx-join-panel > p { margin: 0 0 1.25rem; color: var(--bx-muted); line-height: 1.5; }

@media (max-width: 980px) {
  .bx-shell { grid-template-columns: 78px 1fr; }
  .bx-sidebar { padding-inline: .7rem; }
  .bx-brand span, .bx-nav button > b, .bx-nav a > b, .bx-side-label, .bx-side-footer { display: none; }
  .bx-brand { justify-content: center; }
  .bx-nav button, .bx-nav a { justify-content: center; padding-inline: .4rem; }
  .bx-grid--overview, .bx-split { grid-template-columns: 1fr; }
  .bx-deal-layout { grid-template-columns: 230px 1fr; }
}

@media (max-width: 700px) {
  .bx-shell { display: block; }
  .bx-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; width: min(82vw, 290px); height: 100vh; padding: 1rem; transform: translateX(-105%); transition: transform .22s ease; box-shadow: 25px 0 65px rgba(16,45,34,.16); }
  body.bx-menu-open .bx-sidebar { transform: translateX(0); }
  .bx-brand { justify-content: flex-start; }
  .bx-brand span, .bx-nav button > b, .bx-nav a > b, .bx-side-label { display: block; }
  .bx-nav button, .bx-nav a { justify-content: flex-start; padding-inline: .8rem; }
  .bx-side-footer { display: block; }
  .bx-header { min-height: 66px; padding: .65rem .85rem; }
  .bx-header > div:first-of-type p { display: none; }
  .bx-header h1 { font-size: 1.15rem; }
  .bx-icon-button { display: inline-grid; place-items: center; }
  .bx-account-meta { display: none; }
  .bx-main { padding: 1rem .75rem 5rem; }
  .bx-view-heading { align-items: flex-start; flex-direction: column; }
  .bx-view-heading h2 { font-size: 1.38rem; }
  .bx-view-heading > p { font-size: .82rem; }
  .bx-status-banner { grid-template-columns: auto 1fr; }
  .bx-status-banner > .bx-pill { grid-column: 1 / -1; }
  .bx-form-grid, .bx-checks { grid-template-columns: 1fr; }
  .bx-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .bx-toolbar { align-items: stretch; flex-direction: column; }
  .bx-search { max-width: none; }
  .bx-deal-layout { display: block; min-height: 0; }
  .bx-deal-list { display: flex; gap: .35rem; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--bx-border); }
  .bx-deal-list button { min-width: 210px; }
  .bx-message-form { grid-template-columns: 1fr auto; }
  .bx-message-form select { grid-column: 1 / -1; }
  .bx-join { padding: 1rem .65rem; }
  .bx-join-grid { grid-template-columns: 1fr; }
  .bx-join-intro { padding: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
