:root {
  /* Color tokens */
  --color-bg: #ffffff;
  --color-surface: #f2f4f9;
  --color-surface-warm: #ededed;
  --color-text: #0b0b0c;
  --color-muted: #777a80;
  --color-subtle: #a9abb0;
  --color-divider: #e9eaec;
  --color-brand: #ef3124;
  --color-positive: #49a679;

  /* Spacing tokens: 4px base */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --page-padding: clamp(18px, 5.71vw, 25px);
  --screen-gutter: var(--page-padding);
  --section-gap: 18px;

  /* Radius tokens */
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-round: 999px;

  /* Type tokens */
  --font-caption: 12px;
  --font-body: 15px;
  --font-card: 17px;
  --font-title: 24px;
  --font-display: 30px;

  --nav-safe-area: env(safe-area-inset-bottom, 0px);
  --tab-height: calc(49px + var(--nav-safe-area));
}

html.page-transition-pending body {
  opacity: 0;
}

html.page-transition-pending.page-transition-ready body {
  opacity: 1;
  transition: opacity 160ms ease-out;
}

html.page-transition-pending.page-transition-leaving body {
  opacity: 0;
  transition-duration: 100ms;
  transition-timing-function: ease-in;
}

@media (prefers-reduced-motion: reduce) {
  html.page-transition-pending.page-transition-ready body,
  html.page-transition-pending.page-transition-leaving body {
    transition: none;
  }
}

* { box-sizing: border-box; }

html { background: var(--color-bg); }

html,
body {
  scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--color-text);
  background: var(--color-bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.app {
  position: relative;
  width: 100%;
  max-width: 430px;
  min-height: 100svh;
  margin: 0 auto;
  overflow: clip;
  background: var(--color-bg);
}

.app__chrome {
  position: sticky;
  top: 0;
  z-index: 100;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgb(255 255 255 / 96%);
  backdrop-filter: saturate(160%) blur(14px);
  box-shadow: 0 1px 0 var(--color-divider);
}

.account-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 46px;
  padding: 0 calc(var(--screen-gutter) + 7px) 2px;
}

.account-button, .icon-button {
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.account-button { display: flex; align-items: center; gap: 7px; padding: 0; text-decoration: none; }
.account-button--static { cursor: default; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #f34c2e, #df2b20);
}
.brand-mark svg { width: 19px; height: 19px; fill: none; stroke: #fff; stroke-width: 3.1; stroke-linecap: square; stroke-linejoin: miter; }
.account-button__name { font-size: 16px; font-weight: 400; }

.icon-button { position: relative; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; }
.icon-button svg { width: 22px; fill: #0b0b0c; stroke: #0b0b0c; stroke-width: 1.7; }
.notification-dot { display: none; position: absolute; top: 2px; right: 1px; width: 8px; height: 8px; border-radius: 50%; background: var(--color-brand); }

.chevron {
  display: inline-block;
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-top: 2px solid var(--color-subtle);
  border-right: 2px solid var(--color-subtle);
  transform: rotate(45deg);
}
.chevron--small { width: 8px; height: 8px; }

.app__content {
  padding: 0 var(--screen-gutter) calc(var(--tab-height) + var(--space-8));
}

.search {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 44px;
  margin: 9px 0 15px;
  padding: 0 13px 0 3px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-warm);
}
.search svg { flex: 0 0 19px; width: 19px; fill: none; stroke: #7c7e82; stroke-width: 1.8; stroke-linecap: round; }
.search input { min-width: 0; width: 100%; border: 0; outline: 0; color: var(--color-text); background: transparent; font-size: 16px; font-weight: 400; }
.search input::placeholder { color: #888a8f; opacity: 1; }

.surface-card { border-radius: var(--radius-lg); background: var(--color-surface); }

.portfolio-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 94px;
  margin-bottom: 20px;
  padding: 10px 20px;
}
.eyebrow { margin: 0 0 3px; font-size: 14px; font-weight: 400; }
.portfolio-card__value { margin: 0; font-size: 20px; font-weight: 500; line-height: 1.12; letter-spacing: -.25px; }
.portfolio-card__delta { margin: 3px 0 0; color: var(--color-muted); font-size: 13.5px; font-weight: 400; }

.dzyn-intro-card {
  position: relative;
  display: grid;
  grid-template-rows: minmax(132px, 1fr) auto;
  width: 100%;
  min-height: 224px;
  margin-bottom: 32px;
  overflow: hidden;
  padding: 18px 16px 16px;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.dzyn-intro-card__copy {
  position: relative;
  z-index: 2;
  width: min(62%, 210px);
}

.dzyn-intro-card__copy h2 {
  margin: 0 0 var(--space-2);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.25px;
}

.dzyn-intro-card__copy p {
  margin: 0;
  color: var(--color-muted);
  font-size: 14px;
  line-height: 1.32;
}

.dzyn-intro-card__mascot {
  position: absolute;
  z-index: 1;
  top: 4px;
  right: 10px;
  display: block;
  width: clamp(118px, 32vw, 132px);
  aspect-ratio: 1;
  object-fit: contain;
}

.dzyn-intro-card__actions {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.primary-button,
.secondary-button {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 48px;
  padding: 10px var(--space-5);
  border: 0;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.primary-button {
  color: #fff;
  background: var(--color-brand);
}

.secondary-button {
  color: var(--color-text);
  background: #fff;
}

.primary-button--compact,
.secondary-button--compact {
  min-height: 44px;
  padding: 8px 6px;
  border-radius: var(--radius-sm);
  font-size: clamp(12.5px, 3.46vw, 13.5px);
  white-space: nowrap;
}

.primary-button:active { filter: brightness(.9); }
.secondary-button:active { background: var(--color-divider); }

.digital-card {
  position: relative;
  display: flex;
  justify-content: space-between;
  height: 126px;
  margin-bottom: 44px;
  overflow: hidden;
  padding: 14px 16px;
}
.digital-card h2 { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.18; letter-spacing: -.2px; }
.digital-card p { position: absolute; bottom: 17px; left: 16px; margin: 0; font-size: 14px; font-weight: 400; }
.digital-art { position: absolute; right: 27px; top: 11px; width: 91px; height: 96px; overflow: visible; }

.home-section { margin: 0 calc(var(--screen-gutter) * -1) 38px; }
.section-title { margin: 0 var(--screen-gutter) 18px; font-size: clamp(24px, 6.67vw, 26px); line-height: 1.12; letter-spacing: -.65px; }
.horizontal-list { display: flex; gap: 8px; overflow-x: auto; padding: 0 var(--screen-gutter) 4px; scrollbar-width: none; scroll-snap-type: x proximity; }
.horizontal-list::-webkit-scrollbar { display: none; }

.stock-card {
  flex: 0 0 103px;
  height: 135px;
  padding: 15px 7px 10px;
  border-radius: var(--radius-lg);
  text-align: center;
  background: #f1f5f5;
  scroll-snap-align: start;
}
.stock-logo { display: block; width: 47px; height: 47px; margin: 0 auto 8px; overflow: visible; }
.stock-card h3 { overflow: hidden; margin: 0 0 5px; font-size: 14px; font-weight: 500; white-space: nowrap; text-overflow: clip; }
.stock-card p { margin: 0 0 5px; color: var(--color-muted); font-size: 14px; }
.stock-card strong { color: var(--color-positive); font-size: 14px; font-weight: 600; }

.calendar-section { margin-bottom: 28px; }
.calendar-card { position: relative; height: 108px; margin: 0 var(--screen-gutter); overflow: hidden; padding: 36px 16px 14px; }
.calendar-card h3 { position: relative; z-index: 1; margin: 0; font-size: clamp(17px, 4.87vw, 19px); line-height: 1.2; }
.calendar-art { position: absolute; right: 1px; bottom: -8px; width: clamp(112px, 33.85vw, 132px); height: auto; overflow: visible; }

.section-heading { display: flex; align-items: center; justify-content: space-between; padding-right: 25px; }
.section-heading .section-title { margin-bottom: 19px; font-weight: 500; }
.placements-section { margin-right: 0; margin-bottom: 36px; margin-left: 0; }
.placements-section .section-heading { padding-right: 7px; }
.placements-section .section-title { margin-left: 0; }
.placements-list { gap: 8px; padding-right: 0; padding-left: 0; scroll-padding-left: 0; scroll-snap-type: none; }
.placement-card {
  position: relative;
  flex: 0 0 151px;
  height: 137px;
  overflow: hidden;
  padding: 16px;
  border-radius: var(--radius-lg);
  color: #fff;
  scroll-snap-align: none;
}
.placement-card--blue { background: #7895d1; }
.placement-card--slate { background: #56698f; }
.placement-card--navy { background: #23284f; }
.placement-card h3 { margin: 0 0 2px; font-size: 18px; line-height: 1.05; font-weight: 500; }
.placement-card p { margin: 0; font-size: 16px; }
.placement-card small { position: absolute; bottom: 15px; left: 16px; font-size: 14px; line-height: 1.25; }
.placement-logo { position: absolute; right: 15px; bottom: 15px; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #2158f4; font-size: 25px; }
.placement-logo--gold { color: #f3d45d; background: #18254a; font-size: 18px; }

.currency-section { margin-bottom: 20px; }
.currency-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0 var(--screen-gutter); overflow: hidden; background: var(--color-divider); }
.currency-grid div { display: grid; grid-template-columns: auto 1fr; gap: 3px 9px; padding: 14px; background: var(--color-surface); }
.currency-grid b { grid-row: 1 / span 2; align-self: center; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: #fff; background: #2c864e; }
.currency-grid span { color: var(--color-muted); font-size: 12px; }
.currency-grid strong { font-size: 14px; }

.tab-bar {
  position: fixed;
  z-index: 1000;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: 100%;
  max-width: 430px;
  height: var(--tab-height);
  margin-inline: auto;
  padding: 5px 5px 0;
  padding-bottom: var(--nav-safe-area);
  border-top: 1px solid var(--color-divider);
  background: #fff;
}
.tab-bar__item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; color: #96989c; font-size: clamp(9px, 2.56vw, 10px); line-height: 11px; text-decoration: none; }
.nav-icon { display: block; flex: 0 0 29px; width: 29px; height: 29px; }
.tab-bar__item.is-active { color: #dc3329; }
.badge { position: absolute; top: -4px; right: 10px; display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border: 2px solid #fff; border-radius: var(--radius-round); color: #fff; background: var(--color-brand); font-size: 10px; font-weight: 500; line-height: 1; }
@media (max-width: 350px) {
  .section-title { font-size: 24px; }
}
