/* First-time onboarding (dashboard/onboard.js, docs/ONBOARDING.md) in the Trade page's language (docs/DESIGN-LANGUAGE.md):
   a floating material card over the page, the teal primary for actions that do not trade, quiet fields and chips.
   Nothing animates: the panel, the tour card and its ring appear and go at once; only 160ms colour changes on hover. */
html.ob-on { overflow: hidden; }
.ob { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 56px 16px 24px; overflow-y: auto; }
.ob-back { position: fixed; inset: 0; background: rgba(8, 8, 10, 0.72); }
.ob-card { position: relative; width: 100%; max-width: 560px; background: var(--ob-popover); border-radius: var(--ob-r-card); box-shadow: var(--ob-shadow-pop); padding: 20px 24px 22px; color: var(--ob-ink); }
/* the first screen: one line, one button (vihan, 17 Nov) */
.ob:has(.ob-mini) { align-items: center; }
.ob-card.ob-mini { max-width: 380px; box-shadow: var(--ob-shadow-pop), inset 0 0 0 1px var(--ob-line, #26272b); padding: 24px; text-align: center; }
.ob-mini h1 { margin: 0; font-size: 20px; line-height: 1.3; font-weight: var(--ob-w-semi); letter-spacing: -0.01em; }
.ob-mini .ob-fine { margin: 8px auto 0; max-width: 32ch; font-size: 13px; line-height: 1.45; color: var(--ob-label); }
.ob-mini .ob-acts { margin-top: 20px; display: flex; flex-direction: column; gap: 8px; }
.ob-mini .ob-sec { background: transparent; color: var(--ob-ink-2); }
@media (hover: hover) { .ob-mini .ob-sec:hover { background: transparent; color: var(--ob-ink); } }
.ob-mini .ob-pri, .ob-mini .ob-sec { width: 100%; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.ob-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.ob-brand { font-size: 13px; font-weight: var(--ob-w-medium); color: var(--ob-label); }
.ob-x { height: 28px; padding: 0 10px; border: 0; border-radius: var(--ob-r); background: transparent; color: var(--ob-label); font-size: 12px; font-weight: var(--ob-w-medium); cursor: pointer; transition: background-color 160ms cubic-bezier(.2,.8,.2,1), color 160ms cubic-bezier(.2,.8,.2,1); }
@media (hover: hover) { .ob-x:hover { background: var(--ob-hover); color: var(--ob-ink); } }
.ob-credit { margin: 0 0 14px; padding: 10px 12px; border-radius: var(--ob-r); background: var(--ob-brand-dim); color: var(--ob-ink); font-size: 14px; }
.ob-credit b { font-weight: var(--ob-w-semi); }
.ob-credit.no { background: var(--ob-hover); color: var(--ob-ink-2); }
.ob h1 { margin: 0; font-size: 22px; font-weight: var(--ob-w-semi); line-height: 1.2; }
.ob-sub { margin: 6px 0 0; font-size: 14px; line-height: 1.45; color: var(--ob-ink-2); max-width: 64ch; }
.ob-use { margin: 8px 0 0; font-size: 13px; color: var(--ob-label); }
.ob-paused { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; margin-top: 12px; padding: 12px; border-radius: var(--ob-r); background: color-mix(in srgb, var(--ob-amber) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ob-amber) 40%, transparent); }
.ob-paused b { font-size: 14px; font-weight: var(--ob-w-semi); }
.ob-paused span { grid-column: 1; font-size: 13px; color: var(--ob-ink-2); }
.ob-paused .ob-pri { grid-column: 2; grid-row: 1 / span 2; height: 36px; }
.ob-hbtn.paused { background: color-mix(in srgb, var(--ob-amber) 18%, transparent); color: var(--ob-ink); }
.ob-hbtn.paused .ob-dot { background: var(--ob-amber); }
/* the first screen: two equal choices */
.ob-what { margin: 14px 0 0; font-size: 15px; line-height: 1.5; color: var(--ob-ink); max-width: 52ch; }
.ob-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
.ob-two.ob-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ob-pick i { font-style: normal; font-size: 12px; font-weight: var(--ob-w-medium); color: var(--ob-label); }
.ob-pick { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 120px; padding: 16px; border: 0; border-radius: var(--ob-r-card); background: #0c0c0e; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .10); color: var(--ob-ink); text-align: left; cursor: pointer; transition: background-color 160ms cubic-bezier(.2,.8,.2,1); }
@media (hover: hover) { .ob-pick:hover { background: #121214; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); } }
/* the picked card: one 1px white edge, never a thick double ring */
.ob-pick:focus-visible, .ob-pick.on, .ob-pick[aria-pressed="true"] { outline: 0; box-shadow: inset 0 0 0 1px #fff; }
.ob-pick b { font-size: 17px; font-weight: var(--ob-w-semi); }
.ob-pick span { font-size: 13px; line-height: 1.45; color: var(--ob-ink-2); }
.ob-lab { margin: 18px 0 8px; font-size: 12px; font-weight: var(--ob-w-medium); color: var(--ob-label); }

/* the agent picker: one segmented track */
.ob-seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; padding: 2px; border-radius: var(--ob-r); background: var(--ob-track); box-shadow: var(--ob-track-edge); }
.ob-seg button { height: 32px; border: 0; border-radius: 4px; background: transparent; color: var(--ob-label); font-size: 13px; font-weight: var(--ob-w-medium); cursor: pointer; white-space: nowrap; transition: background-color 160ms cubic-bezier(.2,.8,.2,1), color 160ms cubic-bezier(.2,.8,.2,1); }
@media (hover: hover) { .ob-seg button:hover { color: var(--ob-ink-2); } }
.ob-seg button.on { background: var(--ob-thumb); box-shadow: var(--ob-shadow-thumb); color: var(--ob-ink); }

/* limits: three money fields */
.ob-lims { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ob-f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ob-fl { font-size: 13px; font-weight: var(--ob-w-medium); color: var(--ob-ink); }
.ob-fs { font-size: 12px; color: var(--ob-label); }
.ob-amt { display: flex; align-items: center; gap: 4px; height: 40px; padding: 0 10px; border-radius: 8px; background: var(--ob-track); box-shadow: var(--ob-track-edge); }
@media (hover: hover) { .ob-amt:hover { box-shadow: inset 0 0 0 1px rgba(250, 248, 240, .16); } }
.ob-amt:focus-within { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ob-brand) 55%, transparent); outline: 3px solid var(--ob-focus); }
.ob-amt span { color: var(--ob-label); font-size: 15px; }
.ob-amt input { flex: 1; min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--ob-ink); font-size: 15px; font-weight: var(--ob-w-medium); font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.ob-amt input::-webkit-outer-spin-button, .ob-amt input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* markets: quiet chips */
.ob-mk { display: flex; flex-wrap: wrap; gap: 6px; }
.ob-mk button { height: 28px; padding: 0 10px; border: 0; border-radius: var(--ob-r); background: rgba(250, 248, 240, .06); color: var(--ob-ink-2); font-size: 12px; cursor: pointer; transition: background-color 160ms cubic-bezier(.2,.8,.2,1), color 160ms cubic-bezier(.2,.8,.2,1); }
@media (hover: hover) { .ob-mk button:hover { background: rgba(250, 248, 240, .10); } }
.ob-mk button.on { background: rgba(250, 248, 240, .14); color: var(--ob-ink); font-weight: var(--ob-w-medium); box-shadow: inset 0 0 0 1px var(--ob-line-hi); }

/* how it trades: the mode segment, the ask-first switch and what it means */
.ob-seg.ob-seg3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ob-warn { margin: 8px 0 0; font-size: 12px; line-height: 1.45; color: var(--ob-label); }
/* trades waiting for the person's one click: cards at the bottom right (a sheet on a phone) */
.ob-asks { position: fixed; right: 16px; bottom: 16px; z-index: 58; display: flex; flex-direction: column; gap: 8px; width: 340px; }
.ob-ask { padding: 14px 16px; border-radius: var(--ob-r-card); background: var(--ob-material); -webkit-backdrop-filter: var(--ob-material-blur); backdrop-filter: var(--ob-material-blur); box-shadow: var(--ob-shadow-pop), inset 0 0 0 1px color-mix(in srgb, var(--ob-brand) 45%, transparent); color: var(--ob-ink); }
.ob-ask b { display: block; font-size: 13px; font-weight: var(--ob-w-medium); color: var(--ob-label); }
.ob-ask p { margin: 6px 0 0; font-size: 15px; line-height: 1.4; }
.ob-ask .ob-askm { font-size: 12px; color: var(--ob-label); }
.ob-ask .ob-pacts { justify-content: flex-end; }
.ob-msg { min-height: 18px; margin: 12px 0 0; font-size: 13px; color: var(--ob-ink-2); }
.ob-msg.bad { color: var(--ob-amber); }
.ob-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.ob-pri, .ob-sec, .ob-ghost { height: 40px; padding: 0 16px; border: 0; border-radius: var(--ob-r); font-size: 14px; font-weight: var(--ob-w-medium); cursor: pointer; transition: filter 160ms cubic-bezier(.2,.8,.2,1), background-color 160ms cubic-bezier(.2,.8,.2,1), color 160ms cubic-bezier(.2,.8,.2,1); }
.ob-pri { background: var(--ob-brand); color: var(--ob-on-brand); font-weight: var(--ob-w-semi); }
@media (hover: hover) { .ob-pri:hover { filter: brightness(1.06); } }
.ob-pri:active { filter: brightness(.94); }
.ob-pri:disabled { background: var(--ob-hover); color: var(--ob-label); box-shadow: inset 0 0 0 1px var(--ob-line-hi); cursor: default; filter: none; }
.ob-sec { background: rgba(250, 248, 240, .08); color: var(--ob-ink); }
@media (hover: hover) { .ob-sec:hover { background: rgba(250, 248, 240, .12); } }
.ob-ghost { background: transparent; color: var(--ob-ink-2); }
.ob-a { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.ob-a.ob-pri { color: var(--ob-on-brand); }
@media (hover: hover) { .ob-a.ob-pri:hover { color: var(--ob-on-brand); } }
@media (hover: hover) { .ob-a.ob-sec:hover { color: var(--ob-ink); } }
@media (hover: hover) { .ob-ghost:hover { background: var(--ob-hover); color: var(--ob-ink); } }
.ob-link { padding: 0; border: 0; background: transparent; color: var(--ob-brand); font-size: 13px; font-weight: var(--ob-w-medium); cursor: pointer; }
@media (hover: hover) { .ob-link:hover { color: var(--ob-brand-2); } }

/* how it works: three numbered lines under a hairline */
.ob-how { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--ob-line); }
.ob-howh { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 13px; }
.ob-howh b { font-weight: var(--ob-w-semi); }
.ob-how ol { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.ob-how li { display: flex; gap: 10px; font-size: 13px; line-height: 1.45; color: var(--ob-ink-2); }
.ob-how li b { color: var(--ob-ink); font-weight: var(--ob-w-semi); }
.ob-n { flex: 0 0 20px; height: 20px; border-radius: 50%; background: var(--ob-fill); color: var(--ob-ink-2); font-size: 12px; font-weight: var(--ob-w-medium); display: inline-flex; align-items: center; justify-content: center; }

/* the key and the setup text */
.ob-key, .ob-code { display: flex; align-items: flex-start; gap: 8px; padding: 8px 8px 8px 12px; border-radius: 8px; background: var(--ob-track); box-shadow: var(--ob-track-edge); }
.ob-key { align-items: center; margin-top: 14px; }
.ob-key code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-family: var(--ob-code); font-size: 13px; color: var(--ob-ink); }
.ob-code pre { flex: 1; min-width: 0; margin: 0; padding: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--ob-code); font-size: 12px; line-height: 1.5; color: var(--ob-ink-2); }
.ob-key .ob-sec, .ob-code .ob-sec { flex: none; height: 32px; padding: 0 12px; font-size: 13px; }
.ob-how2 { margin: 0 0 8px; font-size: 13px; color: var(--ob-ink-2); }
.ob-note { margin: 8px 0 0; font-size: 12px; line-height: 1.45; color: var(--ob-amber); }
.ob-lims-line { margin: 16px 0 0; font-size: 13px; color: var(--ob-label); }

/* the header button */
.ob-hbtn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; margin-right: 4px; border: 0; border-radius: var(--ob-r); background: rgba(250, 248, 240, .08); color: var(--ob-ink); font-size: 12px; font-weight: var(--ob-w-medium); white-space: nowrap; cursor: pointer; transition: background-color 160ms cubic-bezier(.2,.8,.2,1); }
@media (hover: hover) { .ob-hbtn:hover { background: rgba(250, 248, 240, .12); } }
.ob-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ob-label); }
.ob-dot.on { background: var(--ob-brand); }
.ob-hs { display: none; }
@media (max-width: 1100px) { .ob-hl { display: none; } .ob-hs { display: inline; } }

/* the tour: a ring around the real element and a card next to it */
.ob-ring { position: fixed; z-index: 55; pointer-events: none; border-radius: 8px; box-shadow: 0 0 0 2px var(--ob-brand), 0 0 0 9999px rgba(8, 8, 10, 0.55); }
.ob-pop { position: fixed; z-index: 56; width: 300px; padding: 14px 16px; border-radius: var(--ob-r-card); background: var(--ob-material); -webkit-backdrop-filter: var(--ob-material-blur); backdrop-filter: var(--ob-material-blur); box-shadow: var(--ob-shadow-pop); color: var(--ob-ink); }
.ob-pop b { display: block; font-size: 15px; font-weight: var(--ob-w-semi); }
.ob-pop p { margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: var(--ob-ink-2); }
.ob-pacts { display: flex; align-items: center; gap: 6px; margin-top: 12px; }
.ob-step { flex: 1; font-size: 12px; color: var(--ob-label); }
.ob-pacts .ob-pri, .ob-pacts .ob-ghost { height: 32px; padding: 0 12px; font-size: 13px; }

@media (max-width: 700px) {
  .ob { display: block; padding: 0; }
  .ob-card { max-width: none; min-height: 100%; border-radius: 0; padding: 16px 16px 24px; }
  .ob-seg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ob-two, .ob-two.ob-three { grid-template-columns: minmax(0, 1fr); }
  .ob-seg.ob-seg3 { grid-template-columns: minmax(0, 1fr); }
  .ob-asks { left: 0; right: 0; bottom: 0; width: auto; }
  .ob-ask { border-radius: var(--ob-r-card) var(--ob-r-card) 0 0; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .ob-ask .ob-pacts .ob-pri, .ob-ask .ob-pacts .ob-ghost { height: 44px; }
  .ob-pick { min-height: 96px; }
  .ob-seg button { height: 40px; }
  .ob-lims { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .ob-amt { height: 44px; }
  .ob-amt input, .ob-amt span { font-size: 16px; }
  .ob-mk button { height: 44px; padding: 0 14px; font-size: 13px; }
  .ob-acts { flex-direction: column; align-items: stretch; }
  .ob-pri, .ob-sec, .ob-ghost { height: 48px; font-size: 15px; }
  .ob-key .ob-sec, .ob-code .ob-sec { height: 44px; }
  .ob-x { height: 44px; }
  .ob-hbtn { height: 32px; padding: 0 8px; }
  .ob-pop.sheet { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: auto; border-radius: var(--ob-r-card) var(--ob-r-card) 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
  .ob-pacts .ob-pri, .ob-pacts .ob-ghost { height: 44px; padding: 0 16px; }
}
@media (min-width: 701px) { .ob-pop.sheet { left: 50% !important; top: auto !important; bottom: 24px; margin-left: -150px; } }

/* tablet: the header's balance figures keep their room; Invite is in the agent panel's reach on desktop */
@media (max-width: 1100px) { #obInvite { display: none; } }

/* the first screen stays a small card on phones too (not a full-screen sheet) */
@media (max-width: 700px) {
  .ob:has(.ob-mini) { display: flex; align-items: center; padding: 16px; }
  .ob-card.ob-mini { max-width: 380px; min-height: 0; border-radius: var(--ob-r-card); padding: 24px 20px 20px; }
  .ob-mini h1 { font-size: 19px; }
}
/* the heading takes the opening focus (a modal's focus goes inside it), so no ring sits on the button until Tab */
.ob-mini h1:focus { outline: none; }

