.stocks-page .hero-copy h1 {
  font-size: 66px;
}

.stocks-page .hero-copy {
  padding-bottom: 0;
}

.stocks-page .button-zone {
  width: min(100%, 1120px);
  min-height: 400px;
}

.market-ledger {
  position: absolute;
  z-index: 4;
  right: 20px;
  bottom: 34px;
  width: 210px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--rule);
  background: rgba(247, 247, 244, 0.94);
  font-family: "Spline Sans Mono", monospace;
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
}

.market-ledger > header {
  min-height: 28px;
  padding: 6px 0 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.market-ledger > header span {
  font-size: 9px;
  font-weight: 800;
}

.market-ledger > header small,
.market-ledger-totals small {
  color: var(--muted);
  font-size: 6px;
  line-height: 1.2;
}

.market-ledger-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
}

.market-ledger-totals > span {
  min-width: 0;
  min-height: 48px;
  padding: 7px 6px 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-left: 1px solid var(--rule);
}

.market-ledger-totals > span:first-child {
  border-left: 0;
}

.market-ledger-totals strong {
  display: block;
  overflow: hidden;
  font-family: "Hanken Grotesk", Arial, sans-serif;
  font-size: 23px;
  font-weight: 900;
  line-height: 0.9;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-ledger-totals strong b {
  font: inherit;
}

.market-ledger-totals > span:last-child strong {
  font-size: 19px;
}

.market-ledger ol {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--ink);
}

.market-ledger li {
  --market-color: var(--buy);
  min-height: 25px;
  padding: 5px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px 32px;
  align-items: center;
  gap: 6px;
  border-top: 1px solid var(--rule);
  font-size: 7px;
  line-height: 1;
}

.market-ledger li:first-child {
  border-top: 0;
}

.market-ledger li > b {
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-logo {
  width: 22px;
  height: 22px;
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  box-sizing: border-box;
}

.stock-logo > i,
.stock-logo > img {
  width: 100%;
  height: 100%;
  grid-area: 1 / 1;
  border: 0;
  border-radius: inherit;
  box-sizing: border-box;
}

.stock-logo > i {
  display: grid;
  place-items: center;
  background: var(--buy);
  font-family: "Spline Sans Mono", monospace;
  font-size: 6px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
}

.stock-logo > img {
  z-index: 1;
  padding: 3px;
  background: #fff;
  object-fit: contain;
}

.stock-logo.is-missing > img {
  display: none;
}

.stock-logo-market {
  width: 17px;
  height: 17px;
}

.market-ledger li > strong {
  font-size: 9px;
  text-align: right;
}

.market-ledger li > small {
  color: var(--muted);
  font-size: 7px;
  text-align: right;
}

.market-ledger li.is-latest {
  animation: market-ledger-hit 420ms cubic-bezier(0.16, 0.86, 0.22, 1);
}

.market-ledger .market-ledger-empty {
  min-height: 38px;
  display: flex;
  align-items: center;
  color: var(--muted);
}

@keyframes market-ledger-hit {
  0% { background: var(--buy); transform: translateX(5px); }
  100% { background: transparent; transform: none; }
}

.stocks-page .receipt-mark {
  display: grid;
  place-items: center;
}

.stock-monogram {
  width: 48px;
  height: 48px;
  padding: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font-family: "Spline Sans Mono", monospace;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.stock-logo-receipt {
  width: 48px;
  height: 48px;
  border-color: #55584f;
}

.stock-logo-receipt > i {
  font-size: 9px;
}

.stock-logo-receipt > img {
  padding: 5px;
}

.stocks-page .effect-plus small {
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-note {
  width: min(90%, 1120px);
  min-height: 48px;
  margin: -18px auto 36px;
  padding: 12px 0;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 20px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-family: "Spline Sans Mono", monospace;
  font-size: 8px;
  line-height: 1.45;
  text-transform: uppercase;
}

.stock-note span {
  color: var(--muted);
}

.stock-footer {
  min-height: 44px;
}

.stock-pulse-section {
  width: min(90%, 1120px);
  margin: 54px auto 44px;
  font-family: "Spline Sans Mono", monospace;
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
}

.stock-pulse-head {
  min-height: 112px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 380px);
  align-items: end;
  gap: 32px;
  padding: 0 0 22px;
}

.stock-pulse-head span,
.route-flow header span {
  color: var(--muted);
  font-size: 7px;
  font-weight: 700;
  line-height: 1.4;
}

.stock-pulse-head h2,
.route-flow h3 {
  margin: 6px 0 0;
  font-family: "Hanken Grotesk", Arial, sans-serif;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.92;
}

.stock-pulse-head h2 {
  max-width: 640px;
  font-size: 48px;
}

.stock-pulse-head p {
  max-width: 380px;
  margin: 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.55;
  text-transform: none;
}

.stock-pulse-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 248px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.stock-heatmap-shell {
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-color: var(--ink) var(--paper-cool);
  scrollbar-width: thin;
}

.stock-heatmap {
  --stock-columns: 12;
  min-width: 800px;
  background: var(--paper);
}

.stock-heat-row {
  min-height: 47px;
  display: grid;
  grid-template-columns: 132px repeat(var(--stock-columns), minmax(48px, 1fr));
  border-top: 1px solid var(--rule);
}

.stock-heat-row:first-child {
  border-top: 0;
}

.stock-heat-row > * {
  min-width: 0;
  display: grid;
  place-items: center;
  border-left: 1px solid var(--rule);
}

.stock-heat-row > :first-child {
  border-left: 0;
}

.stock-heat-axis {
  min-height: 34px;
  color: var(--muted);
  font-size: 6px;
}

.stock-heat-axis > span {
  padding: 0 12px;
  place-items: center start;
}

.stock-heat-axis time {
  white-space: nowrap;
}

.stock-heat-label {
  padding: 5px 8px;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  place-items: center start;
  gap: 7px;
}

.stock-heat-label img,
.stock-heat-label i {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  object-fit: cover;
}

.stock-heat-label > .stock-logo {
  width: 28px;
  height: 28px;
  border: 1px solid var(--ink);
  background: #fff;
}

.stock-heat-label .stock-logo > img,
.stock-heat-label .stock-logo > i {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: inherit;
}

.stock-heat-label .stock-logo > img {
  padding: 3px;
  background: #fff;
  object-fit: contain;
}

.stock-heat-label .stock-logo > i {
  background: var(--buy);
  font-size: 7px;
}

.stocks-page .recent-events li a {
  padding: 11px 14px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  justify-content: initial;
  gap: 10px;
}

.stocks-page .recent-events .stock-logo {
  width: 34px;
  height: 34px;
  margin-top: 0;
  color: var(--ink);
  font-family: "Spline Sans Mono", monospace;
  font-size: 6px;
  text-transform: none;
}

.stock-logo-recent > img {
  padding: 4px;
}

.stock-recent-copy {
  min-width: 0;
}

.stocks-page .stock-recent-copy > strong,
.stocks-page .stock-recent-copy > span {
  display: block;
}

.stock-heat-label i {
  background: var(--buy);
  font-style: normal;
  font-size: 7px;
  font-weight: 800;
}

.stock-heat-label b {
  max-width: 100%;
  overflow: hidden;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-heat-label small {
  color: var(--muted);
  font-size: 7px;
}

.stock-heat-cell {
  position: relative;
  color: var(--ink);
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
  cursor: help;
}

.stock-heat-cell.level-0 {
  background: var(--paper);
  color: var(--muted);
  font-weight: 500;
}

.stock-heat-cell.level-1 {
  background: #efffc1;
}

.stock-heat-cell.level-2 {
  background: #e1ff73;
}

.stock-heat-cell.level-3 {
  background: var(--buy);
}

.stock-heat-cell.level-4 {
  background: var(--ink);
  color: var(--buy);
}

.stock-heat-cell.is-missing {
  background: #eceee9;
  color: #8b8f87;
}

.stock-heat-cell.is-partial::after {
  content: "";
  height: 2px;
  position: absolute;
  right: 5px;
  bottom: 4px;
  left: 5px;
  background: var(--signal);
}

.stock-heat-cell.is-current::before,
.stock-heat-total .is-current::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--ink);
}

.stock-pulse-empty-row {
  min-height: 190px;
  padding: 24px;
  display: grid;
  place-items: center;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
  text-align: center;
}

.stock-heat-total {
  min-height: 38px;
  background: var(--ink);
  color: var(--paper);
  font-size: 7px;
}

.stock-heat-total > * {
  position: relative;
  border-left-color: #3d3f39;
}

.stock-heat-total > span {
  place-items: center start;
  padding-left: 12px;
  color: var(--buy);
  font-weight: 800;
}

.stock-heat-total > b {
  font-size: 8px;
}

.stock-heat-total .is-missing {
  color: #777b73;
}

.stock-heat-total .is-current::before {
  background: var(--buy);
}

.stock-pulse-loading {
  min-height: 310px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 8px;
}

.route-flow {
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.route-flow header {
  min-height: 112px;
  padding: 18px 18px 15px;
  border-bottom: 1px solid #3d3f39;
}

.route-flow header span,
.route-flow header small {
  color: #a9aca4;
}

.route-flow h3 {
  color: var(--buy);
  font-size: 28px;
}

.route-flow header small {
  display: block;
  margin-top: 10px;
  font-size: 6px;
  line-height: 1.45;
}

.route-flow ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.route-flow li {
  --route-color: var(--buy);
  min-height: 65px;
  padding: 12px 18px 10px;
  border-bottom: 1px solid #3d3f39;
}

.route-flow li > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.route-flow li b,
.route-flow li strong {
  color: var(--paper);
  font-size: 8px;
}

.route-flow li > span {
  height: 4px;
  margin-top: 8px;
  display: block;
  overflow: hidden;
  background: #30322d;
}

.route-flow li > span i {
  height: 100%;
  display: block;
  background: var(--route-color);
}

.route-flow li small {
  margin-top: 7px;
  display: block;
  color: #a9aca4;
  font-size: 6px;
}

.route-flow .route-flow-empty {
  min-height: 170px;
  display: grid;
  place-items: center start;
  color: #a9aca4;
  font-size: 7px;
  line-height: 1.5;
}

.route-latest {
  min-height: 90px;
  margin-top: auto;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-top: 1px solid #3d3f39;
  transition: background 140ms ease, color 140ms ease;
}

.route-latest:hover {
  background: var(--buy);
  color: var(--ink);
}

.route-latest span,
.route-latest small {
  color: #a9aca4;
  font-size: 6px;
}

.route-latest strong {
  margin: 6px 0 4px;
  overflow: hidden;
  color: var(--buy);
  font-family: "Hanken Grotesk", Arial, sans-serif;
  font-size: 19px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-latest:hover span,
.route-latest:hover small,
.route-latest:hover strong {
  color: var(--ink);
}

.stock-pulse-foot {
  min-height: 42px;
  padding: 9px 0;
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 6px;
}

.stock-pulse-foot span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.stock-pulse-foot i {
  width: 8px;
  height: 8px;
  display: inline-block;
  border: 1px solid var(--rule);
  background: var(--paper);
}

.stock-pulse-foot i.is-partial {
  border-bottom: 2px solid var(--signal);
}

.stock-pulse-foot i.is-missing {
  background: #eceee9;
}

.stock-pulse-foot strong {
  margin-left: auto;
  color: var(--ink);
  font-size: 6px;
  text-align: right;
}

@media (max-width: 900px) {
  .stocks-page .hero-copy h1 {
    font-size: 54px;
  }

  .stocks-page .button-machine {
    max-width: 68vw;
  }

  .market-ledger {
    width: 190px;
  }

  .stock-note {
    width: calc(100% - 40px);
    grid-template-columns: 170px minmax(0, 1fr);
  }

  .stock-pulse-section {
    width: calc(100% - 40px);
  }

  .stock-pulse-layout {
    grid-template-columns: minmax(0, 1fr) 220px;
  }
}

@media (max-width: 620px) {
  .stocks-page .hero-copy h1 {
    max-width: 360px;
    margin: 0 auto;
    font-size: 44px;
    line-height: 0.9;
  }

  .stocks-page .hero-line {
    margin-top: 12px;
  }

  .stocks-page .button-zone {
    min-height: 0;
    grid-template-rows: auto 72px auto;
  }

  .stocks-page .button-machine {
    max-width: 430px;
  }

  .market-ledger {
    position: relative;
    right: auto;
    bottom: auto;
    width: calc(100% - 28px);
    margin: 0 auto 16px;
    grid-row: 3;
    background: transparent;
  }

  .market-ledger > header {
    min-height: 30px;
  }

  .market-ledger-totals > span {
    min-height: 46px;
    padding-right: 8px;
    padding-left: 8px;
  }

  .market-ledger ol {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .market-ledger li {
    min-width: 0;
    min-height: 45px;
    padding: 7px 8px;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 3px 5px;
    border-top: 0;
    border-left: 1px solid var(--rule);
  }

  .market-ledger li:first-child {
    border-left: 0;
  }

  .market-ledger li > b {
    grid-column: 1 / -1;
  }

  .market-ledger li > strong {
    text-align: left;
  }

  .market-ledger li > small {
    text-align: right;
  }

  .market-ledger .market-ledger-empty {
    min-height: 42px;
    grid-column: 1 / -1;
    border-left: 0;
  }

  .stock-note {
    width: calc(100% - 28px);
    margin-top: -8px;
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .stock-footer {
    padding: 10px 14px;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px 16px;
  }

  .stock-footer span:nth-child(2) {
    width: 100%;
    order: 3;
  }

  .stock-pulse-section {
    width: calc(100% - 28px);
    margin-top: 38px;
    margin-bottom: 28px;
  }

  .stock-pulse-head {
    min-height: 0;
    padding-bottom: 16px;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 12px;
  }

  .stock-pulse-head h2 {
    max-width: 330px;
    font-size: 38px;
  }

  .stock-pulse-head p {
    max-width: 360px;
  }

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

  .stock-heatmap {
    min-width: 754px;
  }

  .stock-heat-row {
    grid-template-columns: 118px repeat(var(--stock-columns), 53px);
  }

  .stock-heat-label {
    grid-template-columns: 25px minmax(0, 1fr) auto;
    gap: 5px;
  }

  .stock-heat-label img,
  .stock-heat-label i {
    width: 25px;
    height: 25px;
  }

  .stock-heat-label > .stock-logo {
    width: 25px;
    height: 25px;
  }

  .route-flow {
    border-top: 1px solid var(--ink);
    border-left: 0;
  }

  .route-flow header {
    min-height: 96px;
  }

  .route-flow ol {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .route-flow li {
    border-right: 1px solid #3d3f39;
  }

  .route-flow li:nth-child(even) {
    border-right: 0;
  }

  .route-flow .route-flow-empty {
    min-height: 90px;
    grid-column: 1 / -1;
  }

  .route-latest {
    min-height: 78px;
    margin-top: 0;
  }

  .stock-pulse-foot {
    min-height: 60px;
    flex-wrap: wrap;
    gap: 7px 13px;
  }

  .stock-pulse-foot strong {
    width: 100%;
    margin-left: 0;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stocks-page .round-segment,
  .market-ledger li.is-latest,
  .route-latest {
    transition: none;
    animation: none;
  }
}
