:root {
  --ink: #171511;
  --muted: #746f68;
  --paper: #fffaf5;
  --card: #ffffff;
  --soft: #f5eee7;
  --line: #e8dfd6;
  --accent: #f04424;
  --yes: #177b55;
  --yes-soft: #e6f4ed;
  --no: #b64039;
  --no-soft: #f9e9e6;
  --violet: #6256e8;
  --sun: #ffcb52;
  --shadow-sm: 0 10px 30px rgba(53, 39, 25, .07);
  --shadow-lg: 0 28px 80px rgba(53, 39, 25, .15);
  font-family: "Avenir Next", Avenir, Inter, ui-sans-serif, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
}

html {
  background: var(--paper);
}

body {
  background:
    radial-gradient(circle at 8% 4%, rgba(255, 203, 82, .13), transparent 23rem),
    radial-gradient(circle at 90% 16%, rgba(98, 86, 232, .08), transparent 27rem),
    var(--paper);
}

button,
input,
select,
textarea {
  font-family: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.topbar {
  height: 76px;
  grid-template-columns: 1fr auto 1fr;
  padding-inline: max(clamp(20px, 4vw, 52px), calc((100% - 1440px) / 2 + 40px));
  border-bottom: 1px solid rgba(23, 21, 17, .08);
  background: rgba(255, 250, 245, .82);
  backdrop-filter: blur(22px) saturate(150%);
}

.brand {
  gap: 10px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -.035em;
  text-transform: none;
}

.meridian-symbol {
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  overflow: hidden;
  border-radius: 9px;
  background: var(--accent);
  transform: rotate(-4deg);
}

.meridian-symbol i {
  position: absolute;
  width: 3px;
  height: 15px;
  border-radius: 99px;
  background: white;
  transform: rotate(35deg);
}

.meridian-symbol i:first-child {
  translate: -6px 4px;
  height: 9px;
  opacity: .65;
}

.meridian-symbol i:last-child {
  translate: 6px -4px;
  height: 19px;
  opacity: .82;
}

.primary-nav {
  gap: 8px;
  padding: 4px;
  border: 1px solid rgba(23, 21, 17, .07);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 4px 16px rgba(53, 39, 25, .04);
}

.primary-nav a {
  padding: 9px 15px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.primary-nav a.active {
  color: white;
  background: var(--ink);
}

.primary-nav a.active::after {
  display: none;
}

.wallet-pill {
  display: grid;
  min-width: 112px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .8);
  box-shadow: none;
}

.wallet-pill[hidden] {
  display: none !important;
}

.wallet-pill span {
  display: block;
}

.wallet-pill strong {
  font-size: 12px;
}

.avatar {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(240, 68, 36, .22);
}

.avatar.signed-out {
  width: auto;
  min-width: 72px;
  padding-inline: 13px;
  line-height: 1;
  white-space: nowrap;
}

main {
  max-width: 1440px;
  margin: auto;
  padding: 0 clamp(20px, 4vw, 52px) 96px;
}

.app-page[hidden] {
  display: none !important;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, .65fr);
  gap: clamp(28px, 4vw, 58px);
  align-items: start;
}

.market-section {
  min-width: 0;
  padding: clamp(48px, 6vw, 84px) 0 56px;
}

.section-heading {
  align-items: end;
}

.section-kicker {
  margin: 0 0 9px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .16em;
}

.section-heading h1,
.section-heading h2 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(36px, 4.5vw, 64px);
  line-height: .98;
  letter-spacing: -.055em;
  text-transform: none;
}

.section-intro {
  max-width: 530px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.heading-line {
  align-items: center;
}

.result-count {
  align-self: flex-start;
  min-width: max-content;
  margin-top: 5px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 9px;
}

.search-box {
  width: min(260px, 32vw);
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 8px 28px rgba(53, 39, 25, .04);
}

.search-box:focus-within {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 10%, transparent);
}

.category-row {
  gap: 9px;
  margin: 28px 0 24px;
}

.category-row button {
  min-height: 38px;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .66);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: transform .18s ease, background .18s ease, color .18s ease;
}

.category-row button:hover {
  transform: translateY(-1px);
  background: white;
}

.category-row button.active {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.market-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  border: 0;
}

.market-card {
  position: relative;
  min-height: 230px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 104px auto auto;
  gap: 0 14px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid rgba(23, 21, 17, .08);
  border-radius: 22px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 8px 28px rgba(53, 39, 25, .045);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.market-card:hover {
  transform: translateY(-4px);
  border-color: rgba(23, 21, 17, .13);
  background: white;
  box-shadow: var(--shadow-sm);
}

.market-card.selected {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: white;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 9%, transparent);
}

.market-card.featured {
  min-height: 310px;
  grid-column: 1 / -1;
  grid-template-columns: minmax(260px, .92fr) minmax(0, 1.08fr) auto;
  grid-template-rows: 1fr auto;
  gap: 0 24px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .95), rgba(255, 248, 238, .9));
}

.market-thumb {
  grid-column: 1 / -1;
  width: 100%;
  height: 104px;
  object-fit: cover;
  border: 0;
  border-radius: 14px;
  background: var(--soft);
}

.market-card.featured .market-thumb {
  grid-column: 1;
  grid-row: 1 / -1;
  height: 274px;
  border-radius: 17px;
}

.market-row-main {
  grid-column: 1 / -1;
  min-width: 0;
  padding-top: 14px;
}

.market-card.featured .market-row-main {
  grid-column: 2 / -1;
  grid-row: 1;
  align-self: center;
  padding: 6px 42px 0 0;
}

.card-topline {
  justify-content: flex-start;
  gap: 8px;
  font-size: 9px;
}

.category {
  padding: 5px 7px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--accent) 10%, white);
  color: var(--accent);
}

.closing {
  padding-block: 5px;
}

.market-card h3 {
  min-height: 0;
  max-width: 28ch;
  margin: 9px 0 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -.025em;
}

.market-card.featured h3 {
  max-width: 22ch;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.08;
  letter-spacing: -.045em;
}

.card-meta {
  justify-content: flex-start;
  margin: 12px 0 0;
  padding: 0;
  border: 0;
}

.live-status {
  color: var(--yes);
}

.live-status i {
  display: block;
  background: var(--yes);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--yes) 12%, transparent);
}

.updated {
  flex: 0;
  text-align: left;
}

.market-row-meter {
  grid-column: 1;
  align-self: end;
  min-width: 0;
  padding-top: 14px;
}

.market-card.featured .market-row-meter {
  grid-column: 2;
  grid-row: 2;
}

.probability-meter {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft);
}

.probability-meter span {
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #ff7a3d);
  transition: width .5s cubic-bezier(.2, .8, .2, 1);
}

.outcomes {
  margin-top: 7px;
}

.outcomes span {
  padding: 0;
  background: transparent !important;
  color: var(--muted) !important;
  font-size: 9px;
}

.no-label {
  display: block;
}

.probability-block {
  grid-column: 2;
  align-self: end;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  padding-top: 14px;
}

.market-card.featured .probability-block {
  grid-column: 3;
  grid-row: 2;
}

.probability {
  color: var(--accent);
  font-size: 30px;
  letter-spacing: -.05em;
}

.market-card.featured .probability {
  font-size: 46px;
}

.probability-block span {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.card-arrow {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .9);
  color: var(--ink);
  font-size: 15px;
  box-shadow: 0 5px 16px rgba(53, 39, 25, .1);
  transition: transform .2s ease;
}

.market-card:hover .card-arrow {
  transform: translate(2px, -2px);
}

.market-skeleton {
  height: 230px;
  border: 0;
  border-radius: 22px;
  background:
    linear-gradient(100deg, var(--soft) 20%, white 38%, var(--soft) 56%);
  background-size: 240% 100%;
  animation: market-shimmer 1.4s infinite linear;
}

@keyframes market-shimmer {
  to { background-position-x: -240%; }
}

.market-risk-note {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.trade-drawer {
  position: sticky;
  top: 98px;
  right: auto;
  bottom: auto;
  z-index: 4;
  width: auto;
  max-height: calc(100vh - 118px);
  min-height: 540px;
  margin-top: clamp(48px, 6vw, 84px);
  padding: 18px;
  overflow: auto;
  border: 1px solid rgba(23, 21, 17, .09);
  border-radius: 26px;
  background: rgba(255, 255, 255, .9);
  box-shadow: var(--shadow-sm);
  transform: none;
  scrollbar-width: thin;
}

.trade-drawer.open {
  transform: none;
}

.drawer-close,
.drawer-backdrop {
  display: none;
}

.rail-empty {
  min-height: 500px;
  display: grid;
  place-content: center;
  justify-items: start;
  padding: 34px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 78% 20%, rgba(255, 203, 82, .28), transparent 12rem),
    linear-gradient(145deg, #fff5e8, #f3eeff 115%);
}

.rail-orbit {
  position: relative;
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  margin-bottom: 30px;
  border: 1px solid rgba(98, 86, 232, .24);
  border-radius: 50%;
}

.rail-orbit::before,
.rail-orbit::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(98, 86, 232, .18);
  border-radius: 50%;
}

.rail-orbit::before {
  inset: 11px -15px;
  transform: rotate(34deg);
}

.rail-orbit::after {
  inset: -13px 17px;
  transform: rotate(-28deg);
}

.rail-orbit i {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: var(--accent);
  box-shadow: 0 10px 25px rgba(240, 68, 36, .28);
}

.rail-empty .section-kicker {
  margin-bottom: 8px;
}

.rail-empty h2 {
  max-width: 8ch;
  margin: 0 0 15px;
  font-size: 38px;
  font-weight: 850;
  line-height: .98;
  letter-spacing: -.055em;
  text-transform: none;
}

.rail-empty p:last-child {
  max-width: 34ch;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.drawer-market-image {
  width: 100%;
  height: 210px;
  margin: 0;
  object-fit: cover;
  border: 0;
  border-radius: 18px;
  background: var(--soft);
}

.market-hero {
  display: grid;
  gap: 20px;
}

.market-visual {
  position: relative;
}

.market-visual::after {
  content: "";
  position: absolute;
  inset: 42% 0 0;
  border-radius: 0 0 18px 18px;
  background: linear-gradient(transparent, rgba(23, 21, 17, .62));
  pointer-events: none;
}

.market-visual-badges {
  position: absolute;
  z-index: 1;
  right: 13px;
  bottom: 13px;
  left: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.market-visual-badges span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  color: var(--ink);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .09em;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
}

.market-visual-badges .live-badge {
  background: var(--ink);
  color: white;
}

.market-visual-badges .live-badge i,
.ticket-heading > span i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #49c98a;
  box-shadow: 0 0 0 4px rgba(73, 201, 138, .14);
}

.market-copy {
  position: relative;
  padding-right: 90px;
}

.market-live-price {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  justify-items: end;
  gap: 1px;
}

.market-live-price span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.market-live-price strong {
  color: var(--accent);
  font-size: 29px;
  line-height: 1;
  letter-spacing: -.05em;
}

.drawer-category {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 9px;
}

.trade-drawer h2 {
  margin: 0;
  font-size: 27px;
  font-weight: 850;
  line-height: 1.12;
  letter-spacing: -.045em;
}

.drawer-description {
  margin: 12px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.market-statline {
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 19px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--line);
}

.market-statline div {
  padding: 14px;
  border: 0;
  background: white;
}

.market-statline div:last-child {
  grid-column: auto;
  border: 0;
}

.market-statline strong {
  font-size: 15px;
  letter-spacing: -.025em;
}

.price-chart-panel {
  margin: 20px 0 26px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fffcf8;
}

.price-chart-heading {
  border-bottom-color: var(--line);
}

.chart-ranges button {
  border-radius: 7px;
}

.chart-ranges button.active {
  background: var(--ink);
}

.trade-ticket {
  margin-top: 26px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: #fffdf9;
  box-shadow: 0 12px 34px rgba(53, 39, 25, .055);
}

.ticket-heading {
  align-items: start;
  margin-bottom: 14px;
}

.ticket-heading > span {
  color: var(--yes);
}

.ticket-heading strong {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}

.ticket-heading strong b,
.field > span b,
.quote-empty > strong b {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--ink);
  color: white;
  font-size: 10px;
}

.ticket-heading p:last-child {
  margin: 7px 0 0 30px;
  color: var(--muted);
  font-size: 11px;
}

.outcome-switch {
  gap: 9px;
}

.outcome-switch button {
  min-width: 0;
  min-height: 92px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.outcome-switch button:hover {
  transform: translateY(-2px);
}

.outcome-switch button[data-outcome].active {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(23, 21, 17, .1);
}

.outcome-switch button[data-outcome="YES"].active {
  border-color: color-mix(in srgb, var(--yes) 45%, var(--line));
  background: var(--yes-soft);
  color: var(--yes);
}

.outcome-switch button[data-outcome="NO"].active {
  border-color: color-mix(in srgb, var(--no) 45%, var(--line));
  background: var(--no-soft);
  color: var(--no);
}

.outcome-image {
  border: 0;
  border-radius: 9px;
}

.field {
  min-width: 0;
  margin-top: 16px;
}

.field > * {
  min-width: 0;
  width: 100%;
}

.field > span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.field input {
  padding: 8px 0 10px;
  border: 0;
  border-bottom: 2px solid var(--ink);
  background: transparent;
  font-size: 30px;
  font-weight: 850;
}

.field > small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.quantity-presets {
  gap: 7px;
}

.quantity-presets button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.quantity-presets button.active {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.quote-box {
  margin-top: 15px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
}

.quote-empty > strong {
  display: flex;
  align-items: center;
  gap: 8px;
}

.order-sentence {
  border-radius: 12px;
  background: var(--soft);
}

.trade-actions,
.receipt-actions {
  gap: 8px;
}

.trade-actions button,
.receipt-actions button {
  min-height: 48px;
  padding: 13px;
  border-radius: 13px;
  text-align: center;
}

.preview-button {
  border: 1px solid var(--line);
  background: white;
}

.buy-button,
.primary-action {
  border: 0;
  background: var(--accent) !important;
  color: white;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--accent) 22%, transparent);
}

.resolution {
  display: grid;
  gap: 5px;
  margin-top: 20px;
  padding: 17px;
  border: 0;
  border-radius: 14px;
  background: var(--soft);
}

.resolution span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.resolution strong {
  font-size: 12px;
}

.portfolio-section {
  padding-top: 80px;
  margin-top: 0;
}

.history-section {
  min-height: calc(100vh - 190px);
  padding-top: 80px;
}

.history-section .section-heading {
  align-items: flex-end;
  margin-bottom: 30px;
}

.history-section .section-heading h2 {
  font-size: clamp(38px, 5vw, 64px);
}

.history-section .activity-panel {
  margin-top: 0;
}

.history-section .settlement-panel {
  margin-top: 22px;
}

.history-summary {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  overflow: hidden;
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .74);
  box-shadow: 0 8px 28px rgba(53, 39, 25, .035);
}

.history-summary > div {
  min-height: 92px;
  display: grid;
  align-content: end;
  gap: 6px;
  padding: 18px 20px;
  border-right: 1px solid var(--line);
}

.history-summary > div:first-child {
  background:
    radial-gradient(circle at 90% 10%, rgba(255, 203, 82, .2), transparent 7rem),
    var(--ink);
}

.history-summary > div:last-child {
  border: 0;
}

.history-summary span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.history-summary strong {
  font-size: 28px;
  letter-spacing: -.04em;
}

.history-summary > div:first-child span,
.history-summary > div:first-child strong {
  color: white;
}

.history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 24px 0;
}

.history-search {
  width: min(340px, 45vw);
  min-height: 45px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .78);
}

.history-search svg {
  width: 16px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
}

.history-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
}

.history-filters {
  display: flex;
  align-items: center;
  gap: 7px;
}

.history-filters button {
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.history-filters button.active {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.portfolio-section .section-heading {
  align-items: end;
}

.portfolio-section .section-heading h2 {
  font-size: clamp(38px, 5vw, 64px);
}

.portfolio-market-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: max-content;
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--ink);
  text-decoration: none;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(53, 39, 25, .04);
}

.portfolio-market-link span {
  color: var(--accent);
  font-size: 15px;
}

.portfolio-summary,
.position-grid,
.activity-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 8px 28px rgba(53, 39, 25, .035);
}

.portfolio-summary {
  grid-template-columns: repeat(4, 1fr);
  margin-top: 28px;
}

.portfolio-summary div {
  min-height: 112px;
  padding: 20px;
  justify-content: flex-end;
  background: rgba(255, 255, 255, .68);
}

.portfolio-summary .portfolio-value-card {
  background:
    radial-gradient(circle at 90% 10%, rgba(255, 203, 82, .22), transparent 7rem),
    var(--ink);
}

.portfolio-summary .portfolio-value-card span,
.portfolio-summary .portfolio-value-card strong,
.portfolio-summary .portfolio-value-card small {
  color: white;
}

.portfolio-summary small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.portfolio-summary strong {
  font-size: clamp(20px, 2.3vw, 29px);
  letter-spacing: -.04em;
}

.valuation-note {
  margin: 12px 4px 24px;
}

.position-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-top: 40px;
}

.position-section-heading h3 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -.04em;
}

.position-section-heading > p {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 10px;
}

.position-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.position-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line) !important;
  border-radius: 18px;
  background: rgba(255, 255, 255, .8);
  box-shadow: 0 8px 24px rgba(53, 39, 25, .04);
}

.position-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.position-card-heading > img {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  border-radius: 14px;
  object-fit: cover;
  background: var(--soft);
}

.position-card-heading > div {
  min-width: 0;
  display: grid;
  justify-items: end;
  gap: 7px;
}

.position-card .position-market {
  min-height: 0;
  margin: 18px 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 820;
  line-height: 1.22;
  letter-spacing: -.025em;
}

.position-primary {
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 18px;
  padding: 16px 0;
  margin-bottom: 16px;
}

.position-primary > div {
  display: grid;
  gap: 4px;
}

.position-primary > div > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.position-primary > div > strong {
  font-size: 25px;
  letter-spacing: -.04em;
}

.position-return {
  justify-items: end;
  text-align: right;
}

.position-return.positive strong,
.position-return.positive small {
  color: var(--yes);
}

.position-return.negative strong,
.position-return.negative small {
  color: var(--no);
}

.position-return small {
  font-size: 9px;
}

.position-numbers {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.position-numbers div:last-child {
  text-align: left;
}

.position-numbers strong {
  font-size: 14px;
}

.position-actions {
  margin-top: 20px;
}

.position-actions button {
  min-height: 46px;
  border-radius: 11px;
}

.position-trade {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.portfolio-empty-state {
  grid-column: 1 / -1;
  min-height: 360px;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 38px 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(circle at 72% 20%, rgba(255, 203, 82, .2), transparent 13rem),
    linear-gradient(145deg, rgba(255, 255, 255, .88), rgba(243, 238, 255, .68));
  text-align: center;
}

.portfolio-empty-state .empty-orbit {
  position: relative;
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  margin-bottom: 22px;
  border: 1px solid rgba(98, 86, 232, .22);
  border-radius: 50%;
}

.portfolio-empty-state .empty-orbit::before {
  content: "";
  position: absolute;
  inset: 13px -14px;
  border: 1px solid rgba(98, 86, 232, .16);
  border-radius: 50%;
  transform: rotate(29deg);
}

.portfolio-empty-state .empty-orbit i {
  width: 17px;
  height: 17px;
  border-radius: 6px;
  background: var(--accent);
}

.portfolio-empty-state h3 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -.045em;
}

.portfolio-empty-state > p:not(.section-kicker) {
  max-width: 46ch;
  margin: 12px 0 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.portfolio-empty-state button {
  padding: 12px 17px;
  border: 0;
  border-radius: 11px;
  background: var(--ink);
  color: white;
  font-weight: 800;
}

.activity-panel {
  margin-top: 22px;
}

.activity-heading {
  padding: 18px 20px;
  background: var(--soft);
}

.activity-heading > div {
  display: grid;
  gap: 1px;
}

.activity-heading .section-kicker {
  margin: 0;
  font-size: 8px;
}

.activity-heading h3 {
  font-size: 18px;
  letter-spacing: -.025em;
}

.activity-heading > span {
  padding: 5px 8px;
  border-radius: 999px;
  background: white;
}

.history-entry {
  grid-template-columns: 58px minmax(0, 1fr) 130px 150px;
  gap: 16px;
  min-width: 0;
  padding: 17px 20px;
  background: rgba(255, 255, 255, .55);
}

.history-entry[hidden] {
  display: none;
}

.history-market-image {
  width: 58px;
  height: 58px;
  border-radius: 13px;
  object-fit: cover;
  background: var(--soft);
}

.history-entry-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 2px;
}

.history-entry-label > span:last-child {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.history-kind {
  display: inline-flex;
  width: max-content;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 8px !important;
  font-weight: 850;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.history-kind.buy {
  background: var(--yes-soft);
  color: var(--yes);
}

.history-kind.sell {
  background: var(--no-soft);
  color: var(--no);
}

.history-kind.settlement {
  background: color-mix(in srgb, var(--violet) 11%, white);
  color: var(--violet);
}

.history-entry .activity-market {
  gap: 5px;
}

.history-entry .activity-market strong {
  font-size: 13px;
}

.reference-copy {
  width: max-content;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-copy small {
  flex: 0 0 auto;
  color: var(--accent);
  font-family: inherit;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.activity-time {
  display: grid;
  justify-items: start;
  gap: 4px;
  color: var(--ink);
}

.activity-time strong {
  font-size: 10px;
}

.activity-time span {
  color: var(--muted);
  font-size: 9px;
}

.portfolio-summary div,
.position-card,
.activity-heading,
.activity-row {
  border-color: var(--line);
}

footer {
  border-top: 1px solid var(--line);
}

.account-backdrop {
  background: rgba(23, 21, 17, .46);
  backdrop-filter: blur(6px);
}

.account-modal {
  width: min(1120px, calc(100vw - 30px));
  border: 0;
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow-lg);
}

.account-header {
  align-items: center;
}

.account-summary {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, .78);
}

.account-header .avatar {
  border-radius: 11px;
  background: var(--accent);
}

.account-modal > .drawer-close {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.auth-assurance {
  background:
    radial-gradient(circle at 20% 12%, rgba(255, 203, 82, .22), transparent 14rem),
    var(--ink);
}

.auth-assurance h2,
.account-modal h2 {
  font-weight: 850;
  letter-spacing: -.045em;
  text-transform: none;
}

.auth-entry {
  background:
    radial-gradient(circle at 100% 0, rgba(255, 203, 82, .11), transparent 16rem),
    var(--paper);
}

.auth-copy h3 {
  font-size: 30px;
  letter-spacing: -.05em;
}

.auth-tabs,
.account-nav {
  border-color: var(--line);
}

.auth-tabs button.active,
.account-nav button.active {
  border-color: var(--accent);
  color: var(--accent);
}

.account-nav {
  gap: 6px;
  margin-top: 22px;
  padding-block: 0;
}

.account-nav button {
  position: relative;
  min-width: 116px;
  padding: 15px 16px 13px;
  border-bottom-width: 3px;
  font-size: 12px;
  letter-spacing: .01em;
}

.account-nav button:hover {
  color: var(--ink);
}

.account-nav button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -4px;
}

.auth-tabs {
  gap: 5px;
  padding: 4px;
  border: 0;
  border-radius: 13px;
  background: var(--soft);
}

.auth-tabs button {
  border: 0;
  border-radius: 10px;
}

.auth-tabs button.active {
  border: 0;
  background: white;
  box-shadow: 0 5px 14px rgba(53, 39, 25, .08);
}

.auth-form input,
.kyc-form input,
.kyc-form select,
.wallet-form input,
.wallet-form select {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
}

.auth-form input:focus,
.kyc-form input:focus,
.kyc-form select:focus,
.wallet-form input:focus,
.wallet-form select:focus {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 9%, transparent);
}

.password-requirements {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: -3px 0 2px;
  padding: 0;
  list-style: none;
}

.password-requirements li {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  transition: color .15s ease;
}

.password-requirements li::before {
  display: grid;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  content: "";
  color: white;
  font-size: 11px;
}

.password-requirements li.met {
  color: var(--yes);
}

.password-requirements li.met::before {
  border-color: var(--yes);
  background: var(--yes);
  content: "✓";
}

.password-requirements li.unmet {
  color: color-mix(in srgb, var(--accent) 78%, #8a4036);
}

.password-requirements li.unmet::before {
  border-color: currentColor;
  content: "×";
}

.secondary-action {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.account-view {
  padding-top: 34px;
}

.view-heading {
  display: grid;
  gap: 6px;
  max-width: 700px;
  margin-bottom: 22px;
}

.view-heading h3 {
  margin: 0;
  font-size: 31px;
  letter-spacing: -.05em;
}

.view-heading > p:last-child {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.account-progress {
  gap: 8px;
  margin-block: 24px 28px;
}

.account-progress li {
  align-content: start;
  min-width: 0;
  padding: 14px 8px;
  border: 1px solid transparent;
  border-radius: 13px;
}

.account-progress li.current {
  border-color: color-mix(in srgb, var(--accent) 24%, var(--line));
  background: color-mix(in srgb, var(--accent) 5%, white);
}

.account-progress li > span {
  border-radius: 11px;
}

.account-progress li.complete > span {
  background: var(--yes);
}

.account-progress li div {
  min-width: 0;
}

.account-progress strong {
  font-size: 11px;
}

.account-progress small {
  line-height: 1.35;
  text-transform: none;
}

.account-progress button,
.inline-link {
  width: fit-content;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  padding: 2px 0;
  color: var(--accent);
  font: inherit;
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
}

.account-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.account-quick-actions > button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  padding: 14px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.account-quick-actions > button:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  transform: translateY(-1px);
}

.account-quick-actions > button > span:first-child {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--soft);
  color: var(--accent);
  font-weight: 900;
}

.account-quick-actions > button > span:nth-child(2) {
  display: grid;
  gap: 4px;
}

.account-quick-actions strong {
  font-size: 13px;
}

.account-quick-actions small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.account-panel {
  padding: 18px;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 8px 24px rgba(53, 39, 25, .035);
}

.panel-heading h3 {
  font-size: 17px;
  letter-spacing: -.02em;
}

.panel-heading p {
  max-width: 550px;
  font-size: 11px;
  line-height: 1.45;
}

.panel-heading .panel-kicker {
  margin-bottom: 2px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.money-overview {
  gap: 10px;
}

.money-overview div {
  min-height: 96px;
  justify-content: flex-end;
  background: white;
}

.money-overview strong {
  overflow-wrap: anywhere;
  font-size: clamp(17px, 2vw, 23px);
  letter-spacing: -.025em;
}

.money-overview div:first-child {
  background:
    radial-gradient(circle at 100% 0, rgba(98, 86, 232, .25), transparent 8rem),
    var(--ink);
}

.money-overview div:first-child span,
.money-overview div:first-child strong,
.money-overview div:first-child small {
  color: white;
}

.money-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  align-items: start;
  gap: 12px;
}

.money-primary,
.money-secondary {
  display: grid;
  gap: 12px;
}

.money-layout .account-panel {
  margin-top: 0;
}

.money-action-card {
  gap: 18px;
}

.wallet-form label > span:not(.amount-input) {
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  line-height: 1.4;
}

.amount-input {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
}

.amount-input > span {
  padding-left: 13px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
}

.amount-input input {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.amount-input:focus-within {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 9%, transparent);
}

.action-form {
  grid-template-columns: minmax(0, 1fr) auto;
}

.action-form .primary-action {
  min-width: 190px;
}

.payment-activity {
  border: 0;
  background: white;
}

.payment-activity li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 62px;
  padding: 11px 12px;
}

.payment-kind {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--soft);
  color: var(--accent);
  font-size: 16px;
  font-weight: 900;
}

.payment-detail {
  align-self: center;
}

.payment-detail strong {
  font-size: 12px;
}

.payment-activity b {
  align-self: center;
  font-size: 12px;
}

.payment-status {
  border-radius: 999px;
  padding: 3px 7px;
  background: var(--soft);
  color: var(--muted);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.payment-status.complete {
  background: color-mix(in srgb, var(--yes) 11%, white);
  color: var(--yes);
}

.payment-status.attention {
  background: var(--no-soft);
  color: var(--no);
}

.payment-status.action {
  background: color-mix(in srgb, var(--accent) 10%, white);
  color: var(--accent);
}

.checkout-link {
  border-bottom: 1px solid currentColor;
  padding-top: 1px;
}

.destination-list li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  background: white;
}

.destination-list .bank-symbol {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--soft);
  color: var(--accent);
}

.payment-notifications {
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}

.payment-notifications li {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr) auto;
  gap: 9px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 12px;
}

.payment-notifications li:last-child {
  border-bottom: 0;
}

.payment-notifications li.unread {
  background: color-mix(in srgb, var(--accent) 5%, white);
}

.notification-dot {
  width: 7px;
  height: 7px;
  margin-top: 4px;
  border-radius: 50%;
  background: transparent;
}

.payment-notifications .unread .notification-dot {
  background: var(--accent);
}

.payment-notifications time {
  color: var(--muted);
  font-size: 8px;
}

.panel-empty.illustrated {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 24px 12px;
  text-align: center;
}

.panel-empty.illustrated > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--soft);
  color: var(--accent);
  font-size: 17px;
}

.panel-empty.illustrated strong {
  color: var(--ink);
  font-size: 12px;
}

.panel-empty.illustrated p {
  margin: 0;
  font-size: 10px;
}

.payout-setup-form {
  padding: 15px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 13px;
  background: color-mix(in srgb, var(--accent) 4%, white);
}

.locked-state {
  min-height: 150px;
  align-items: center;
  border-style: solid;
  background: white;
}

.inline-error {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.inline-error strong,
.inline-error span {
  grid-column: 1;
}

.inline-error button {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.account-actions span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.account-actions i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--yes);
}

.verification-box,
.document-ready,
.security-note,
.review-state,
.locked-state,
.account-panel,
.money-overview div,
.destination-list li,
.payment-activity,
.payment-notifications li,
.setup-action,
.cooling-note {
  border-color: var(--line);
  border-radius: 14px;
}

.status-chip {
  border-radius: 999px;
}

.toast {
  border-radius: 14px;
  background: var(--ink);
  box-shadow: var(--shadow-lg);
}

@media (max-width: 1120px) {
  .workspace-grid {
    grid-template-columns: minmax(0, 1.18fr) minmax(340px, .82fr);
    gap: 28px;
  }

  .market-grid {
    grid-template-columns: 1fr;
  }

  .market-card.featured {
    min-height: 260px;
    grid-template-columns: minmax(210px, .8fr) minmax(0, 1.2fr) auto;
  }

  .market-card.featured .market-thumb {
    height: 224px;
  }
}

@media (max-width: 980px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .trade-drawer {
    position: fixed;
    z-index: 50;
    inset: 0 0 0 auto;
    width: min(560px, 100vw);
    max-height: none;
    min-height: 0;
    margin: 0;
    padding: 24px;
    border: 0;
    border-radius: 26px 0 0 26px;
    background: var(--paper);
    box-shadow: -24px 0 80px rgba(23, 21, 17, .2);
    transform: translateX(105%);
  }

  .trade-drawer.open {
    transform: translateX(0);
  }

  .drawer-close {
    display: grid;
    position: sticky;
    top: 0;
    z-index: 3;
    margin: 0 0 12px auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
  }

  .drawer-backdrop:not([hidden]) {
    display: block;
    backdrop-filter: blur(5px);
  }

  .position-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  body {
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }

  .topbar {
    height: 66px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding-inline: 16px;
  }

  .primary-nav,
  .wallet-pill {
    display: none;
  }

  .brand {
    min-width: 0;
  }

  .brand #brand-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  main {
    padding-inline: 16px;
  }

  .market-section {
    padding-top: 38px;
  }

  .section-heading {
    display: grid;
    gap: 22px;
  }

  .section-heading h1 {
    max-width: 9ch;
    font-size: 42px;
  }

  .section-intro {
    font-size: 14px;
  }

  .search-box {
    width: 100%;
    margin: 0;
  }

  .category-row {
    flex-wrap: nowrap;
    margin-block: 20px;
    padding: 0 16px 4px;
    margin-inline: -16px;
    overflow-x: auto;
    scroll-padding-inline: 16px;
  }

  .category-row button:first-child {
    margin-left: 0;
  }

  .market-card,
  .market-card.featured {
    min-height: 0;
    grid-column: auto;
    grid-template-columns: 88px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 0 13px;
    padding: 12px;
    border-radius: 18px;
  }

  .market-card .market-thumb,
  .market-card.featured .market-thumb {
    grid-column: 1;
    grid-row: 1 / -1;
    width: 88px;
    height: 108px;
    border-radius: 13px;
  }

  .market-row-main,
  .market-card.featured .market-row-main {
    grid-column: 2 / -1;
    grid-row: 1;
    align-self: start;
    padding: 0 28px 0 0;
  }

  .market-card h3,
  .market-card.featured h3 {
    max-width: none;
    margin-top: 7px;
    font-size: 15px;
    line-height: 1.25;
    letter-spacing: -.02em;
  }

  .card-meta {
    display: none;
  }

  .market-row-meter,
  .market-card.featured .market-row-meter {
    grid-column: 2;
    grid-row: 2;
    padding-top: 10px;
  }

  .probability-block,
  .market-card.featured .probability-block {
    grid-column: 3;
    grid-row: 2;
    padding-top: 8px;
  }

  .probability,
  .market-card.featured .probability {
    font-size: 23px;
  }

  .card-arrow {
    top: 11px;
    right: 11px;
    width: 27px;
    height: 27px;
  }

  .market-risk-note {
    padding-inline: 4px;
  }

  .portfolio-section {
    padding-top: 58px;
  }

  .portfolio-heading {
    align-items: flex-start !important;
  }

  .portfolio-market-link {
    width: max-content;
  }

  .history-section {
    padding-top: 58px;
  }

  .history-section .section-heading {
    align-items: flex-start;
  }

  .history-summary {
    grid-template-columns: 1fr 1fr;
  }

  .history-summary > div:first-child {
    grid-column: 1 / -1;
  }

  .history-summary > div:nth-child(2) {
    border-top: 1px solid var(--line);
  }

  .history-summary > div:last-child {
    border-top: 1px solid var(--line);
  }

  .history-toolbar {
    display: grid;
  }

  .history-search {
    width: 100%;
  }

  .history-filters {
    width: calc(100% + 24px);
    margin-inline: -12px;
    padding-inline: 12px;
    overflow-x: auto;
  }

  .history-filters button {
    flex: 0 0 auto;
  }

  .history-entry {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    padding: 15px 14px;
  }

  .history-market-image {
    width: 48px;
    height: 48px;
    border-radius: 11px;
  }

  .history-entry .activity-time {
    display: none;
  }

  .history-entry .activity-amount {
    grid-column: 2 / -1;
    justify-items: start;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    text-align: left;
  }

  .reference-copy {
    width: 100%;
  }

  .portfolio-summary {
    grid-template-columns: 1fr 1fr;
  }

  .position-grid {
    grid-template-columns: 1fr;
  }

  .position-card {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .position-section-heading {
    align-items: flex-start;
  }

  .position-section-heading > p {
    display: none;
  }

  .position-primary {
    grid-template-columns: 1fr;
  }

  .position-return {
    justify-items: start;
    text-align: left;
  }

  .position-numbers {
    grid-template-columns: 1fr 1fr;
  }

  .portfolio-empty-state {
    min-height: 330px;
  }

  .mobile-nav {
    grid-template-columns: repeat(4, 1fr);
    height: calc(64px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid rgba(23, 21, 17, .08);
    background: rgba(255, 250, 245, .94);
    backdrop-filter: blur(18px);
  }

  .mobile-nav a,
  .mobile-nav button {
    font-size: 9px;
    letter-spacing: .04em;
    text-transform: none;
  }

  .mobile-nav span {
    color: var(--accent);
    font-size: 8px;
  }

  .trade-drawer {
    width: 100%;
    max-width: 100%;
    padding: max(16px, env(safe-area-inset-top)) 16px
      calc(24px + env(safe-area-inset-bottom));
    border-radius: 0;
  }

  .drawer-market-image {
    height: 190px;
  }

  .market-copy {
    padding-right: 0;
  }

  .market-live-price {
    position: static;
    justify-items: start;
    margin-bottom: 14px;
  }

  .trade-drawer h2 {
    font-size: 25px;
  }

  .price-chart-heading,
  .ticket-heading {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .chart-ranges {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }

  .quantity-presets {
    grid-template-columns: repeat(4, 1fr);
  }

  .market-statline {
    grid-template-columns: 1fr 1fr;
  }

  .market-statline div:last-child {
    grid-column: 1 / -1;
  }

  .trade-ticket {
    padding: 16px;
  }

  .trade-actions {
    grid-template-columns: 1fr;
  }

  .account-modal {
    inset: 0;
    border-radius: 0;
  }

  .account-modal {
    padding: 24px 16px calc(32px + env(safe-area-inset-bottom));
  }

  .account-header {
    align-items: start;
    gap: 14px;
  }

  .account-header h2 {
    font-size: 30px;
  }

  .account-summary {
    width: 100%;
    padding: 9px;
  }

  .account-nav {
    position: sticky;
    z-index: 4;
    top: -24px;
    margin-inline: -16px;
    padding: 6px 16px 0;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--paper) 94%, transparent);
    backdrop-filter: blur(14px);
  }

  .account-nav button {
    padding: 13px 4px 11px;
    font-size: 11px;
  }

  .account-view {
    min-height: 0;
    padding-top: 26px;
  }

  .view-heading h3 {
    font-size: 27px;
  }

  .account-progress {
    gap: 0;
    margin-block: 20px 24px;
  }

  .account-progress li {
    min-height: 64px;
    padding: 8px 0 13px;
    border: 0;
    border-radius: 0;
  }

  .account-progress li.current {
    background: transparent;
  }

  .account-progress button {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin: -5px 0 -8px -8px;
    padding: 8px;
  }

  .account-progress li::before {
    top: -44px;
  }

  .account-quick-actions {
    grid-template-columns: 1fr;
  }

  .money-overview,
  .money-layout {
    grid-template-columns: 1fr;
  }

  .money-overview div {
    min-height: 88px;
  }

  .money-overview div:not(:first-child) {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .money-overview div:not(:first-child) strong {
    grid-column: 2;
    grid-row: 1 / span 2;
    text-align: right;
  }

  .money-overview div:not(:first-child) small {
    grid-column: 1;
  }

  .account-panel {
    padding: 15px;
  }

  .action-form {
    grid-template-columns: 1fr;
  }

  .action-form .primary-action {
    width: 100%;
    min-width: 0;
  }

  .payment-activity li {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .payment-activity b {
    grid-column: 2;
    justify-items: start;
  }

  .payment-notifications li {
    grid-template-columns: 7px minmax(0, 1fr);
  }

  .payment-notifications button {
    grid-column: 2;
    justify-self: start;
    padding: 4px 0;
  }

  .setup-action {
    align-items: stretch;
    flex-direction: column;
  }

  .setup-action .hosted-setup-link,
  .setup-action button {
    text-align: center;
  }

  .destination-list li {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .destination-list button {
    grid-column: 2;
    justify-self: start;
    padding: 5px 0;
  }

  .inline-error {
    display: grid;
    grid-template-columns: 1fr;
  }

  .inline-error button {
    grid-column: 1;
    grid-row: auto;
  }

  .auth-entry {
    padding-top: 58px;
  }

  .account-summary {
    min-width: 0;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .account-summary .status-chip {
    grid-column: 1 / -1;
  }

  .account-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
  }

  .account-nav button {
    min-width: 0;
    padding-inline: 0;
  }

  .toast-region {
    bottom: calc(76px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 390px) {
  main {
    padding-inline: 12px;
  }

  .topbar {
    padding-inline: 12px;
  }

  .category-row {
    margin-inline: -12px;
    padding-inline: 12px;
  }

  .market-card,
  .market-card.featured {
    grid-template-columns: 76px minmax(0, 1fr) auto;
    gap: 0 10px;
  }

  .market-card .market-thumb,
  .market-card.featured .market-thumb {
    width: 76px;
    height: 102px;
  }

  .market-card h3,
  .market-card.featured h3 {
    font-size: 14px;
  }

  .probability,
  .market-card.featured .probability {
    font-size: 21px;
  }

  .outcomes .no-label {
    display: none;
  }
}

.funds-page {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(36px, 6vw, 76px) 0 84px;
}

.funds-page-heading {
  max-width: 680px;
  margin-bottom: 34px;
}

.funds-back {
  display: inline-flex;
  margin-bottom: 38px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.funds-back:hover {
  color: var(--accent);
}

.funds-page-heading h1 {
  margin: 5px 0 10px;
  font-size: clamp(42px, 6vw, 74px);
  line-height: .96;
  letter-spacing: -.065em;
}

.funds-page-heading > p:last-child {
  max-width: 580px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.funds-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  gap: 22px;
  align-items: start;
}

.funds-form-card,
.funds-side-card,
.funds-auth-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--card);
  box-shadow: 0 18px 60px rgba(32, 30, 29, .06);
}

.funds-form-card {
  padding: clamp(24px, 4vw, 42px);
}

.funds-side-card {
  padding: 28px;
}

.funds-side-card h2 {
  margin: 4px 0 22px;
  font-size: 25px;
  letter-spacing: -.035em;
}

.funds-balance {
  display: grid;
  padding-bottom: 28px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--line);
}

.funds-balance span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.funds-balance strong {
  margin: 8px 0 5px;
  font-size: clamp(32px, 5vw, 48px);
  letter-spacing: -.055em;
}

.funds-balance small,
.funds-form > p {
  color: var(--muted);
  line-height: 1.5;
}

.funds-form {
  display: grid;
  gap: 17px;
}

.funds-form > label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
}

.funds-form input,
.funds-form select {
  width: 100%;
  min-height: 56px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 750;
  padding: 0 16px;
}

.funds-form input:focus,
.funds-form select:focus {
  outline: 3px solid color-mix(in srgb, var(--accent) 20%, transparent);
  border-color: var(--accent);
}

.funds-amount {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-height: 84px;
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
}

.funds-amount:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}

.funds-amount span {
  padding-left: 20px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 900;
}

.funds-amount input {
  min-height: 80px;
  border: 0;
  border-radius: 0;
  padding: 0 20px 0 12px;
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 850;
  letter-spacing: -.04em;
}

.funds-amount input:focus {
  outline: 0;
}

.amount-presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.amount-presets button {
  min-height: 43px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.amount-presets button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.funds-primary {
  min-height: 58px;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}

.funds-primary:hover {
  filter: brightness(.94);
}

.funds-primary:disabled {
  cursor: progress;
  opacity: .68;
}

.funds-trust {
  display: flex;
  gap: 12px;
  padding-top: 24px;
  margin-top: 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.funds-trust > span {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--yes) 12%, white);
  color: var(--yes);
}

.funds-trust p {
  margin: 0;
  line-height: 1.5;
}

.funds-trust strong {
  color: var(--ink);
}

.funds-activity {
  display: grid;
  gap: 0;
  padding: 0;
  margin: 0 0 22px;
  list-style: none;
}

.funds-activity li {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.funds-activity li span {
  display: grid;
  gap: 4px;
}

.funds-activity small {
  color: var(--muted);
  font-size: 11px;
}

.funds-activity a {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.funds-secondary-link {
  display: grid;
  width: 100%;
  min-height: 48px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

.funds-empty {
  display: grid;
  place-items: center;
  padding: 34px 12px;
  color: var(--muted);
  text-align: center;
}

.funds-empty > span {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  place-items: center;
  border-radius: 50%;
  background: var(--paper);
  color: var(--accent);
  font-size: 22px;
}

.funds-empty strong {
  color: var(--ink);
}

.funds-empty p {
  margin: 7px 0 20px;
  line-height: 1.5;
}

.funds-empty.prominent {
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
}

.funds-empty .funds-primary {
  width: 100%;
}

.funds-auth-card {
  display: grid;
  max-width: 600px;
  place-items: center;
  padding: clamp(34px, 7vw, 68px);
  margin: 0 auto;
  text-align: center;
}

.funds-auth-card .funds-icon {
  display: grid;
  width: 68px;
  height: 68px;
  margin-bottom: 24px;
  place-items: center;
  border-radius: 22px;
  background: color-mix(in srgb, var(--accent) 12%, white);
  color: var(--accent);
  font-size: 29px;
  font-weight: 900;
}

.funds-auth-card h2 {
  margin: 6px 0 10px;
  font-size: clamp(28px, 5vw, 42px);
  letter-spacing: -.05em;
}

.funds-auth-card > p:not(.section-kicker) {
  max-width: 440px;
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.55;
}

.funds-auth-card .funds-primary {
  width: min(320px, 100%);
}

.funds-auth-card small {
  margin-top: 14px;
  color: var(--muted);
}

.funds-loading {
  display: flex;
  justify-content: center;
  gap: 12px;
  align-items: center;
  min-height: 260px;
  color: var(--muted);
}

.funds-loading span {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.deposit-result-page {
  display: grid;
  min-height: min(760px, calc(100vh - 150px));
  place-items: center;
}

.deposit-result-card {
  display: grid;
  width: min(660px, 100%);
  justify-items: center;
  padding: clamp(34px, 7vw, 68px);
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--card);
  box-shadow: 0 24px 80px rgba(32, 30, 29, .08);
  text-align: center;
}

.deposit-result-icon {
  display: grid;
  width: 78px;
  height: 78px;
  margin-bottom: 26px;
  place-items: center;
  border-radius: 26px;
  background: color-mix(in srgb, var(--accent) 12%, white);
  color: var(--accent);
  font-size: 34px;
  font-weight: 900;
}

.deposit-result-card.success .deposit-result-icon {
  background: color-mix(in srgb, var(--yes) 14%, white);
  color: var(--yes);
}

.deposit-result-card.failed .deposit-result-icon {
  background: color-mix(in srgb, var(--no) 12%, white);
  color: var(--no);
}

.deposit-result-icon i {
  width: 25px;
  height: 25px;
  border: 3px solid color-mix(in srgb, var(--accent) 24%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.deposit-result-card h1 {
  margin: 6px 0 12px;
  font-size: clamp(34px, 6vw, 54px);
  line-height: 1;
  letter-spacing: -.06em;
}

.deposit-result-card > p:not(.section-kicker) {
  max-width: 490px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.deposit-result-details {
  display: grid;
  width: 100%;
  padding: 10px 0;
  margin: 30px 0 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.deposit-result-details > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 18px;
  padding: 12px 4px;
}

.deposit-result-details dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.deposit-result-details dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 900;
  text-align: right;
}

.deposit-result-actions {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 11px;
  margin-top: 30px;
}

.deposit-result-actions .funds-primary,
.deposit-result-actions .funds-secondary-link {
  width: 100%;
}

.deposit-result-progress {
  display: grid;
  width: 100%;
  gap: 12px;
  margin-top: 30px;
}

.deposit-result-progress > span {
  position: relative;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.deposit-result-progress > span::after {
  position: absolute;
  inset: 0;
  width: 40%;
  border-radius: inherit;
  background: var(--accent);
  content: "";
  animation: deposit-progress 1.5s ease-in-out infinite;
}

.deposit-result-progress small {
  color: var(--muted);
  line-height: 1.5;
}

.deposit-detail-link {
  margin-top: 18px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

@keyframes deposit-progress {
  from { transform: translateX(-110%); }
  to { transform: translateX(250%); }
}

.money-flow-card {
  display: grid;
  gap: 22px;
}

.money-flow-card h3 {
  margin: 4px 0 6px;
}

.money-flow-card p {
  margin: 0;
  color: var(--muted);
}

.money-flow-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.money-flow-links a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  text-decoration: none;
}

.money-flow-links a:hover {
  border-color: var(--accent);
}

.money-flow-links a > span:first-child {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 12%, white);
  color: var(--accent);
  font-weight: 900;
}

.money-flow-links a span:nth-child(2) {
  display: grid;
  gap: 3px;
}

.money-flow-links small {
  color: var(--muted);
  line-height: 1.35;
}

.category-scroller {
  position: relative;
}

.category-scroll-hint {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  padding: 5px 10px 5px 24px;
  background: linear-gradient(90deg, transparent, var(--paper) 28%);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
  pointer-events: none;
}

.category-scroll-hint[hidden] {
  display: none;
}

.market-image-pair {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  padding: 7px;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(145deg, #fff, var(--soft));
}

.market-image-pair img {
  position: relative;
  z-index: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  padding: 7px;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(23, 21, 17, .1));
}

.market-card .market-image-pair::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 253, 249, .02) 38%, rgba(255, 250, 245, .78) 100%);
  box-shadow: inset 0 -1px 0 rgba(23, 21, 17, .07);
}

.drawer-market-image.market-image-pair {
  padding: 34px;
}

.history-mobile-time {
  display: none;
}

.history-market-link {
  max-width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.history-market-link:hover,
.history-market-link:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

.history-auth-state {
  display: grid;
  justify-items: start;
  gap: 9px;
  padding: 28px 20px;
}

.history-auth-state > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: var(--soft);
  color: var(--accent);
  font-size: 21px;
}

.history-auth-state strong {
  font-size: 18px;
}

.history-auth-state p {
  max-width: 480px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.history-auth-state button {
  min-height: 44px;
  margin-top: 4px;
  padding: 11px 19px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  font-weight: 800;
}

.auth-help-link {
  width: fit-content;
  min-height: 36px;
  margin-top: -4px;
  padding: 6px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--accent);
  font-weight: 800;
  cursor: pointer;
}

.password-help-card {
  display: grid;
  gap: 13px;
  margin-top: 26px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}

.password-help-card > span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 13px;
  background: var(--soft);
  color: var(--accent);
}

.password-help-card p {
  margin: -5px 0 3px;
  color: var(--muted);
  line-height: 1.5;
}

.password-help-card a {
  display: grid;
  place-items: center;
  min-height: 48px;
  border-radius: 12px;
  text-decoration: none;
}

@media (max-width: 800px) {
  .funds-page {
    padding-top: 26px;
  }

  .funds-back {
    margin-bottom: 28px;
  }

  .funds-layout {
    grid-template-columns: 1fr;
  }

  .funds-side-card {
    order: 2;
  }

  .amount-presets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .money-flow-links {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .funds-page-heading h1 {
    font-size: 43px;
  }

  .funds-form-card,
  .funds-side-card,
  .funds-auth-card {
    border-radius: 20px;
  }

  .funds-form-card,
  .funds-side-card {
    padding: 20px;
  }

  .funds-amount {
    min-height: 72px;
  }

  .funds-amount input {
    min-height: 68px;
    font-size: 30px;
  }

  .deposit-result-page {
    min-height: calc(100vh - 132px);
    padding-top: 18px;
  }

  .deposit-result-card {
    padding: 32px 20px;
    border-radius: 22px;
  }

  .deposit-result-actions {
    grid-template-columns: 1fr;
  }

  .deposit-result-details > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .deposit-result-details dd {
    text-align: left;
  }
}

@media (max-width: 700px) {
  .account-cluster {
    gap: 7px;
  }

  .wallet-pill {
    display: grid;
    width: min(108px, 29vw);
    min-width: 0;
    min-height: 44px;
    padding: 5px 9px;
  }

  .wallet-pill span {
    display: block;
    font-size: 8px;
  }

  .wallet-pill strong {
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .avatar {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
  }

  .avatar.signed-out {
    width: auto;
    min-width: 66px;
    padding-inline: 12px;
    background: var(--ink);
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
  }

  .section-kicker {
    font-size: 11px;
  }

  .category-row {
    padding-right: 48px;
    scroll-snap-type: x proximity;
  }

  .category-row.has-overflow:not(.at-end) {
    mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 35px), transparent 100%);
  }

  .category-row button {
    min-height: 44px;
    scroll-snap-align: start;
  }

  .category-scroll-hint {
    bottom: -1px;
    font-size: 9px;
  }

  .quantity-presets button,
  .chart-ranges button {
    min-height: 44px;
  }

  .trade-drawer > .drawer-close {
    position: sticky;
    top: 0;
    right: auto;
    display: grid;
    width: 44px;
    height: 44px;
    margin: 0 0 8px auto;
    border-radius: 13px;
    background: rgba(255, 253, 249, .96);
    box-shadow: 0 7px 20px rgba(53, 39, 25, .1);
    backdrop-filter: blur(12px);
  }

  .trade-actions {
    position: sticky;
    z-index: 6;
    bottom: calc(-24px - env(safe-area-inset-bottom));
    grid-template-columns: minmax(105px, .72fr) minmax(0, 1.28fr);
    margin: 18px -16px 0;
    padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 253, 249, .96);
    box-shadow: 0 -12px 30px rgba(53, 39, 25, .08);
    backdrop-filter: blur(16px);
  }

  .trade-actions button {
    min-width: 0;
    min-height: 50px;
    padding-inline: 10px;
  }

  .account-modal {
    inset: 0;
    left: 0;
    top: 0;
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    transform: none;
    border-radius: 0;
  }

  .account-modal > .drawer-close {
    position: sticky;
    z-index: 8;
    top: 0;
    width: 44px;
    height: 44px;
    margin: 0 0 4px auto;
  }

  .account-nav button {
    min-height: 44px;
    font-size: 12px;
  }

  .auth-tabs button {
    min-height: 48px;
    font-size: 14px;
  }

  .auth-form input,
  .kyc-form input:not([type="checkbox"]):not([type="file"]),
  .kyc-form select,
  .wallet-form input:not([type="checkbox"]),
  .wallet-form select {
    min-height: 48px;
    font-size: 16px;
  }

  .auth-form .password-input > button {
    min-width: 52px;
    min-height: 48px;
    font-size: 12px;
  }

  .kyc-form > .primary-action {
    position: sticky;
    z-index: 3;
    bottom: calc(-32px - env(safe-area-inset-bottom));
    margin-inline: -16px;
    padding-block: 15px;
    border-radius: 0;
    box-shadow: 0 -10px 24px rgba(53, 39, 25, .1);
  }

  .text-button,
  .account-actions button {
    min-height: 44px;
    padding-block: 10px;
  }

  .history-entry {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .history-entry .activity-time {
    display: none;
  }

  .history-mobile-time {
    display: block;
    color: var(--muted);
    font-size: 11px;
  }

  .history-market-link {
    min-height: 44px;
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .reference-copy {
    min-height: 44px;
    padding-block: 8px;
    font-size: 10px;
  }

  .reference-copy b {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 7px;
    background: var(--soft);
    color: var(--accent);
    font-family: Arial, sans-serif;
    font-size: 13px;
  }

  .history-entry .activity-amount {
    grid-column: 2;
  }

  .mobile-nav a,
  .mobile-nav button {
    min-height: 54px;
    gap: 3px;
  }

  .mobile-nav svg {
    width: 20px;
    height: 20px;
    margin: auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
}

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