/* ACT, corporate actions on Robinhood Chain.
   Pixeloid is a 9 px face, so every size here is a multiple of 9 and nothing is set between
   the steps: a bitmap face at 14 px is a blurred bitmap face. */

@font-face {
  font-family: "Pixeloid";
  src: url("/fonts/PixeloidSans.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Pixeloid";
  src: url("/fonts/PixeloidSans-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Pixeloid Mono";
  src: url("/fonts/PixeloidMono.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ground: #0a0a0b;
  --sunk: #08080a;
  --card: #17181b;
  --card-lit: #1f2125;
  --card-edge: #26282d;
  --ink: #e4e6e9;
  --ink-dim: #8d9198;
  --ink-faint: #5c6066;
  --lime: #77fb0c;
  --lime-dim: #4a8d13;
  --wire: #3a3d42;
  --red: #ff5d47;

  --mast: 96px;
  --bar: 54px;
  --gap: 18px;

  color-scheme: dark;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

/* A chip is display:flex, which beats the hidden attribute unless this says otherwise. */
[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: "Pixeloid", ui-monospace, monospace;
  font-size: 18px;
  line-height: 27px;
  -webkit-font-smoothing: none;
  overflow: hidden;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}

.skip {
  position: fixed;
  left: -999px;
  top: 8px;
  z-index: 50;
  background: var(--lime);
  color: #000;
  padding: 6px 12px;
  text-decoration: none;
}
.skip:focus {
  left: 8px;
}

/* ── the ground: the calendar itself, thrown out of focus ─────────────────────────────── */

#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  filter: blur(20px) saturate(0.35);
  opacity: 0.7;
  pointer-events: none;
}

/* ── masthead ─────────────────────────────────────────────────────────────────────────── */

.mast {
  position: relative;
  z-index: 2;
  background: linear-gradient(var(--ground) 62%, rgba(10, 10, 11, 0.82));
  height: var(--mast);
  padding: 0 var(--gap);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
}

.lockup {
  display: flex;
  align-items: baseline;
  gap: 18px;
  min-width: 0;
}

.wordmark {
  position: relative;
  margin: 0;
  white-space: nowrap;
  font-weight: 700;
  font-size: 54px;
  line-height: 54px;
  letter-spacing: 2px;
  color: var(--ink);
}
.wordmark span {
  display: inline-block;
}
/* The two lime pixels off his lockup: one lifted off the A, one shed by the T. */
.pix {
  position: absolute;
  width: 9px;
  height: 9px;
  background: var(--lime);
}
.pix-a {
  left: -6px;
  top: 3px;
}
.pix-b {
  right: 6px;
  bottom: 6px;
}

.strap {
  margin: 0;
  font-size: 18px;
  line-height: 27px;
  color: var(--ink-dim);
  white-space: nowrap;
}
.tick {
  color: var(--lime);
  margin-left: 9px;
}

.ident {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ident-links {
  display: flex;
  gap: 9px;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 18px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  font-size: 18px;
  border-top: 1px solid var(--card-edge);
}
.chip:hover {
  background: var(--card-lit);
}
.chip[aria-disabled="true"] {
  color: var(--ink-faint);
  cursor: not-allowed;
}

.ca {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #101114;
  border-top: 1px solid var(--card-edge);
  padding: 6px 9px 6px 12px;
  min-height: 36px;
}
.ca-label {
  font-size: 18px;
  color: var(--ink-dim);
  letter-spacing: 1px;
}
.ca-value {
  font-family: "Pixeloid Mono", ui-monospace, monospace;
  font-size: 18px;
  color: var(--ink);
  word-break: break-all;
  user-select: all;
}
.ca-value.empty {
  color: var(--ink-faint);
  user-select: auto;
}
.ca-copy {
  min-height: 27px;
  padding: 0 12px;
  background: var(--card-lit);
  color: var(--ink);
  font-size: 18px;
}
.ca-copy:hover {
  background: var(--lime);
  color: #000;
}
.ca-copy[disabled] {
  color: var(--ink-faint);
  cursor: not-allowed;
  background: transparent;
}
.ca-say {
  font-size: 18px;
  color: var(--lime);
  min-width: 72px;
}
.ca-say:empty {
  display: none;
}
.ca-say.bad {
  color: var(--red);
}

/* ── filter bar ───────────────────────────────────────────────────────────────────────── */

.bar {
  position: relative;
  z-index: 2;
  background: linear-gradient(rgba(10, 10, 11, 0.82), var(--ground));
  height: var(--bar);
  padding: 0 var(--gap);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
}
.tab {
  min-height: 36px;
  padding: 0 15px;
  font-size: 18px;
  color: var(--ink-dim);
  background: var(--card);
  border-top: 1px solid transparent;
}
.tab:hover {
  color: var(--ink);
}
.tab.on {
  color: #000;
  background: var(--lime);
}
.tab b {
  font-weight: 400;
  color: var(--lime);
  margin-left: 6px;
}
.tab.on b {
  color: #000;
}

.bar-right {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.alert-btn {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 0 15px;
  font-size: 18px;
  color: var(--ink-dim);
  background: var(--card);
}
.alert-btn:hover {
  color: var(--ink);
}
.alert-btn[aria-pressed="true"] {
  color: var(--lime);
}
.bell {
  width: 9px;
  height: 9px;
  background: var(--ink-faint);
}
.alert-btn[aria-pressed="true"] .bell {
  background: var(--lime);
  animation: blink 1.6s steps(1, end) infinite;
}
@keyframes blink {
  0%,
  55% {
    opacity: 1;
  }
  56%,
  100% {
    opacity: 0.15;
  }
}

.read {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 18px;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── floor ────────────────────────────────────────────────────────────────────────────── */

.floor {
  position: relative;
  z-index: 2;
  height: calc(100dvh - var(--mast) - var(--bar));
  padding: 0 var(--gap) var(--gap);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(370px, 0.85fr);
  gap: var(--gap);
}

/* the one scrolling region on the page */
.feed {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--card-edge) transparent;
}

.empty {
  margin: 0;
  padding: 27px 0;
  color: var(--ink-faint);
}

.daymark {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0 6px;
  background: linear-gradient(var(--ground) 68%, transparent);
  font-size: 18px;
  color: var(--ink-faint);
  letter-spacing: 1px;
}
.daymark hr {
  flex: 1;
  height: 1px;
  border: 0;
  background: var(--card-edge);
  margin: 0;
}
.daymark.today {
  color: var(--lime);
}
.daymark.today hr {
  background: var(--lime-dim);
}

.row {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) 150px 132px 40px;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  margin-bottom: 3px;
  background: var(--card);
  text-align: left;
  color: inherit;
  border-left: 3px solid transparent;
}
.row:hover {
  background: var(--card-lit);
}
.row.on {
  background: var(--card-lit);
  border-left-color: var(--lime);
}
.row.done {
  color: var(--ink-dim);
}
.row.done .r-tick {
  color: var(--ink-dim);
}

/* The whole row opens the event. The button is invisible, so the ring goes on the row. */
.r-open {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  cursor: pointer;
}
.row:has(.r-open:focus-visible) {
  outline: 2px solid var(--lime);
  outline-offset: -2px;
}

.r-when {
  font-family: "Pixeloid Mono", ui-monospace, monospace;
  font-size: 18px;
  color: var(--ink-dim);
}
.row.on .r-when {
  color: var(--ink);
}

.r-who {
  display: flex;
  align-items: baseline;
  gap: 9px;
  min-width: 0;
}
.r-tick {
  flex: 0 0 auto;
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
  letter-spacing: 1px;
}
.r-co {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 18px;
  color: var(--ink-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.r-kind {
  font-size: 18px;
  color: var(--ink-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.r-kind b {
  display: block;
  font-weight: 400;
  color: var(--ink);
}

.r-count {
  font-family: "Pixeloid Mono", ui-monospace, monospace;
  font-size: 18px;
  color: var(--ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.r-count.soon {
  color: var(--lime);
}
.r-count.past {
  color: var(--ink-faint);
}

/* how many coins are priced in this company: the wire, before you open it */
.r-load {
  display: flex;
  gap: 3px;
  align-items: center;
  justify-content: flex-end;
  height: 18px;
}
.r-load i {
  width: 6px;
  height: 6px;
  background: var(--lime-dim);
}
.row.on .r-load i,
.row:hover .r-load i {
  background: var(--lime);
}

.r-star {
  position: absolute;
  right: 3px;
  top: 3px;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  color: var(--ink-faint);
  font-size: 18px;
  line-height: 18px;
}
.r-star:hover,
.r-star[aria-pressed="true"] {
  color: var(--lime);
}

/* ── panel ────────────────────────────────────────────────────────────────────────────── */

.panel {
  position: relative;
  background: var(--sunk);
  padding: 15px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-idle {
  margin: auto 0;
}
.idle-line {
  margin: 0 0 9px;
  font-weight: 700;
  font-size: 27px;
  line-height: 36px;
}
.idle-note {
  margin: 0;
  color: var(--ink-dim);
  max-width: 42ch;
}

.panel-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  gap: 12px;
}
/* Everything in the panel keeps its own height. The wire is the one part that takes what is
   left, and it measures itself rather than squashing its neighbours. */
.panel-body > * {
  flex: 0 0 auto;
}
.panel-body > .p-wire {
  flex: 1 1 auto;
}

.p-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.p-tick {
  margin: 0;
  font-weight: 700;
  font-size: 36px;
  line-height: 36px;
  letter-spacing: 2px;
}
.p-tick a {
  text-decoration: none;
}
.p-tick a:hover {
  color: var(--lime);
}
.p-co {
  margin: 3px 0 0;
  color: var(--ink-dim);
}
.p-close {
  width: 36px;
  height: 36px;
  background: var(--card);
  color: var(--ink-dim);
  display: none;
  place-items: center;
}

.p-when {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.p-kind {
  color: #000;
  background: var(--lime);
  padding: 0 9px;
  font-weight: 700;
}
.p-kind.past {
  background: var(--card-edge);
  color: var(--ink-dim);
}
.p-date {
  font-family: "Pixeloid Mono", ui-monospace, monospace;
}
.p-count {
  font-family: "Pixeloid Mono", ui-monospace, monospace;
  color: var(--lime);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.p-count.past {
  color: var(--ink-faint);
}

.p-note {
  margin: 0;
  color: var(--ink-dim);
}
.p-note b {
  color: var(--ink);
  font-weight: 400;
}

/* The figures for whatever the line below them is showing: the share's own market, or the
   coin priced in it. One line, so the slot keeps its height when they swap. */
.p-market {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--card-edge);
  margin: 0;
}
.cell {
  background: var(--sunk);
  padding: 3px 9px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}
.cell dt abbr {
  text-decoration: none;
  cursor: help;
}
.cell dt {
  flex: 0 0 auto;
  margin: 0;
  font-size: 18px;
  color: var(--ink-faint);
  white-space: nowrap;
}
.cell dd {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-family: "Pixeloid Mono", ui-monospace, monospace;
  font-size: 18px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.up {
  color: var(--lime);
}
.down {
  color: var(--red);
}

/* the wire: the event on the left, everything priced in it on the right */
.p-wire {
  position: relative;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 0;
  min-height: 84px;
}
.wire-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.wire-from {
  align-self: center;
  padding: 12px 9px;
  background: var(--card);
  text-align: center;
}
.wire-from .wf-k {
  display: block;
  font-size: 18px;
  color: var(--ink-dim);
  letter-spacing: 1px;
}
.wire-from .wf-v {
  display: block;
  font-family: "Pixeloid Mono", ui-monospace, monospace;
  font-size: 18px;
  color: var(--ink);
  margin-top: 6px;
}

.tiles {
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 6px;
  padding-left: 72px;
  align-content: start;
}
.tile {
  position: relative;
  background: var(--card);
  padding: 6px;
  text-align: center;
  color: var(--ink);
  min-height: 60px;
  display: grid;
  align-content: center;
  gap: 3px;
}
/* A grid item with overflow:hidden has an automatic minimum size of ZERO, so the ticker was
   being squashed out of existence by its own row. Every line here states its height. */
.tile > span {
  line-height: 21px;
  min-height: 21px;
}
.tile:hover {
  background: var(--card-lit);
}
.tile.on {
  background: var(--card-lit);
  box-shadow: inset 0 0 0 1px var(--lime);
}
.tile .t-sym {
  font-weight: 700;
  font-size: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tile .t-chg {
  font-family: "Pixeloid Mono", ui-monospace, monospace;
  font-size: 18px;
}

/* the coins that did not fit, counted rather than hidden in silence */
.tile.more {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--card-edge);
  color: var(--ink-faint);
  cursor: default;
  align-content: center;
}
.tile.more:hover {
  background: transparent;
}

.tiles-none {
  margin: 0;
  padding: 18px 0 18px 48px;
  color: var(--ink-faint);
}

/* the measured slot: 60 days of closes with the event day standing in it */
/* A fixed slot: the candles arrive over the network, and nothing above or below them is
   allowed to move when they do. */
.p-chart {
  height: clamp(204px, 27vh, 246px);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chart-note {
  margin: 0;
  min-height: 54px;
  line-height: 27px;
  color: var(--ink-dim);
}
.chart-note b {
  color: var(--ink);
  font-weight: 400;
}

.chart-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.chart-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
}
.chart-head .chart-say {
  color: var(--ink-dim);
  margin-left: auto;
  font-family: "Pixeloid Mono", ui-monospace, monospace;
}
.bars {
  flex: 1;
  min-height: 0;
  display: block;
  width: 100%;
}
.bars polyline {
  fill: none;
  stroke-width: 2;
  shape-rendering: crispEdges;
}
.bars polyline.before {
  stroke: var(--wire);
}
.bars polyline.since {
  stroke: var(--ink);
}
.bars rect.mark {
  fill: var(--lime);
  opacity: 0.85;
}
.bars circle.now {
  fill: var(--lime);
  stroke: none;
}
.chart-foot {
  display: flex;
  justify-content: space-between;
  color: var(--ink-faint);
  font-family: "Pixeloid Mono", ui-monospace, monospace;
}

.p-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  line-height: 27px;
}
.p-links a {
  font-size: 18px;
  color: var(--ink-dim);
  text-decoration: none;
  text-underline-offset: 3px;
}
.p-links a:hover {
  text-decoration: underline;
}
.p-links a:hover {
  color: var(--lime);
}

.noscript {
  position: fixed;
  inset: auto 18px 18px;
  z-index: 9;
  background: var(--card);
  padding: 18px;
}

/* ── narrow ───────────────────────────────────────────────────────────────────────────── */

@media (max-width: 1180px) {
  .floor {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  }
  .row {
    grid-template-columns: 84px minmax(0, 1fr) 120px 108px 34px;
  }
}

@media (max-width: 900px) {
  :root {
    --mast: auto;
    --bar: auto;
    --gap: 12px;
  }
  body {
    overflow: auto;
    overflow-x: hidden;
  }
  .read {
    white-space: normal;
    line-height: 27px;
  }
  .mast {
    flex-direction: column;
    align-items: stretch;
    gap: 9px;
    padding: 12px 12px 6px;
  }
  .lockup {
    align-items: baseline;
    gap: 12px;
  }
  .wordmark {
    font-size: 36px;
    line-height: 36px;
  }
  .pix-a {
    left: -4px;
    top: 2px;
  }
  .ident {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .ca {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 9px 12px;
    line-height: 21px;
  }
  .ca-value {
    width: 100%;
  }
  .ca-copy {
    min-height: 36px;
    margin-top: 3px;
    align-self: flex-start;
  }
  .bar {
    flex-wrap: wrap;
    height: auto;
    padding: 0 12px 9px;
    gap: 9px;
  }
  .tabs {
    flex-wrap: wrap;
    width: 100%;
  }
  .bar-right {
    width: 100%;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 9px 12px;
  }
  .read {
    width: 100%;
  }
  .alert-btn {
    flex: 0 0 auto;
  }
  .floor {
    display: block;
    height: auto;
    padding: 0 12px 12px;
  }
  .feed {
    overflow: visible;
  }

  /* Two lines a row, and the star keeps its own column instead of floating over the date. */
  .row {
    grid-template-columns: 66px minmax(0, 1fr) 30px;
    grid-template-areas:
      "when  who   star"
      "when  kind  star"
      "when  count load";
    row-gap: 3px;
    padding: 9px;
  }
  .r-when {
    grid-area: when;
    align-self: start;
  }
  .r-who {
    grid-area: who;
  }
  .r-kind {
    grid-area: kind;
    display: flex;
    gap: 9px;
  }
  .r-kind b {
    display: inline;
  }
  .r-count {
    grid-area: count;
    text-align: left;
  }
  .r-load {
    grid-area: load;
  }
  .r-star {
    grid-area: star;
    position: static;
    width: 30px;
    height: 30px;
    align-self: start;
    justify-self: end;
  }

  /* on a phone the detail is a drawer over the calendar, not a second column */
  .panel {
    position: fixed;
    inset: 0;
    z-index: 20;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px;
    transform: translateY(101%);
    transition: transform 220ms ease-out;
    background: #0c0d0f;
  }
  .panel.open {
    transform: none;
  }
  .panel-idle {
    display: none;
  }
  /* The drawer scrolls, so nothing in it is squashed to fit a screen it does not have to. */
  .panel-body {
    height: auto;
  }
  .panel-body > .p-wire {
    flex: 0 0 auto;
  }
  .p-close {
    display: grid;
  }
  .p-wire {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }
  .wire-from {
    align-self: start;
    justify-self: start;
    min-width: 132px;
    margin-bottom: 36px;
  }
  .tiles {
    overflow: visible;
    padding-left: 0;
  }
  .p-chart {
    height: auto;
    min-height: 234px;
  }
  .p-market {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .lockup {
    flex-wrap: wrap;
    gap: 0 12px;
  }
  .strap {
    white-space: normal;
  }
  .row {
    grid-template-columns: 60px minmax(0, 1fr) 30px;
  }
  .r-kind {
    flex-wrap: wrap;
    gap: 0 9px;
  }
  .tiles {
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
