:root {
  --bg: #000;
  --ink: #f5f5f5;
  --mute: #7d7d85;
  --line: #1a1a1a;
  --card: #0a0a0a;
  --up: #b8ff4a;
  --dn: #ff5a6a;
  --acc: #c8ff3e;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.4 Inter, "Segoe UI", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body {
  padding-bottom: max(64px, env(safe-area-inset-bottom));
  overflow-x: clip;
}

#bar {
  display: flex;
  align-items: stretch;
  min-width: 0;
  max-width: 100%;
  background: #000;
  border-bottom: 1px solid var(--line);
}

#rail {
  --rail-y: 12px;
  --rail-x: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  flex: 1;
  min-width: 0;
  padding: var(--rail-y) var(--rail-x) var(--rail-y) 8px;
  scrollbar-width: thin;
  scrollbar-color: #222 transparent;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

#rail[hidden] {
  display: none;
}

.chip {
  position: relative;
  z-index: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 168px;
  max-width: 220px;
  padding: 8px 12px 8px 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: inherit;
  text-decoration: none;
  flex: 0 0 auto;
  transition: border-color 0.28s ease, transform 0.28s ease, background 0.28s ease;
}

.chip:hover {
  border-color: #2e2e2e;
  background: #101010;
  transform: translateY(-1px);
}

.pic {
  position: relative;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
}

.av {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #161616;
  color: var(--mute);
  font-size: 13px;
  font-weight: 650;
}

.pic img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.chip b,
.chip i {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip b {
  font-size: 13px;
}

.chip i {
  margin-top: 2px;
  color: var(--mute);
  font-size: 12px;
  font-style: normal;
}

main {
  width: min(760px, calc(100% - 40px));
  margin: 28px auto 0;
}

.mark {
  display: grid;
  place-items: center;
  width: 64px;
  flex: 0 0 auto;
  background: #000;
}

.mark img {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.brand {
  display: block;
  width: fit-content;
  margin: 0 auto 18px;
  text-decoration: none;
  transition: transform 0.28s ease, filter 0.28s ease;
}

.brand img {
  display: block;
  width: 156px;
  height: 156px;
  object-fit: contain;
}

.brand:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.blurb {
  margin: 18px auto 12px;
  width: 100%;
  max-width: 100%;
  padding: 0 4px;
  color: var(--mute);
  font-size: clamp(13px, 2.05vw, 15px);
  line-height: 1.45;
  text-align: center;
  text-wrap: balance;
}

.x {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 0 auto;
  color: #e8e8e8;
  opacity: 0.72;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.x img {
  display: block;
  width: 18px;
  height: 18px;
}

.x:hover {
  opacity: 1;
  transform: translateY(-1px);
}

form {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.qbox {
  position: relative;
  flex: 1;
  min-width: 0;
}

.amt {
  display: flex;
  align-items: center;
  gap: 2px;
  width: 88px;
  flex: 0 0 auto;
  height: 52px;
  padding: 0 12px 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0b0b0b;
  transition: border-color 0.28s ease, box-shadow 0.28s ease;
}

.amt:focus-within {
  border-color: #333;
  box-shadow: 0 0 0 3px #ffffff08;
}

.amt span {
  color: var(--mute);
  font-weight: 700;
}

.amt input {
  width: 100%;
  min-width: 0;
  height: 50px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  outline: none;
}

#q {
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0b0b0b;
  color: var(--ink);
  font: inherit;
  outline: none;
  transition: border-color 0.28s ease, box-shadow 0.28s ease;
}

#q:focus {
  border-color: #333;
  box-shadow: 0 0 0 3px #ffffff08;
}

#sug {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 24;
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid #222;
  border-radius: 14px;
  background: #0c0c0c;
  box-shadow: 0 16px 40px #000c;
}

#sug[hidden] {
  display: none;
}

.sug-h {
  padding: 4px 8px 8px;
  color: var(--mute);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sug-empty {
  margin: 0;
  padding: 6px 8px 8px;
  color: var(--mute);
  font-size: 13px;
}

.sug-i {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease;
}

.sug-i:hover {
  background: #151515;
}

.sug-i .pic {
  width: 32px;
  height: 32px;
}

.sug-i span {
  flex: 1;
  min-width: 0;
}

.sug-i span b,
.sug-i span i {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sug-i span b {
  font-size: 13px;
}

.sug-i span i {
  color: var(--mute);
  font-size: 11px;
  font-style: normal;
}

.sug-i em {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  font-style: italic;
  transform: skewX(-12deg);
}

.sug-v {
  flex: 0 0 auto;
  font-size: 13px;
}

.sk-sug {
  min-height: 48px;
}

#go {
  height: 52px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--acc);
  color: #111;
  font: inherit;
  font-weight: 650;
  white-space: nowrap;
  flex: 0 0 auto;
  cursor: pointer;
  opacity: 0.26;
  transform: scale(0.98);
  pointer-events: none;
  transition: opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1), transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.38s cubic-bezier(0.22, 1, 0.36, 1), filter 0.28s ease;
}

#go.on {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  box-shadow: 0 0 0 1px #c8ff3e33, 0 10px 28px #c8ff3e1f;
}

#go.on:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

#go.on:active {
  transform: translateY(0);
  filter: brightness(0.98);
}

.info {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px 18px 12px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
  max-width: 100%;
}

.info > div {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px 14px;
  min-width: 0;
  max-width: 100%;
}

.info span {
  color: #4e4e54;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  flex: 0 0 auto;
}

.info ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
  flex: 1;
}

.info li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #8a8a92;
  font-size: 11px;
}

.info li img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  flex-shrink: 0;
}

#msg {
  margin: 18px 0 0;
  color: var(--mute);
  animation: fade 0.3s ease;
}

#out {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.card {
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  animation: rise 0.48s cubic-bezier(0.22, 1, 0.36, 1);
}

.head {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.head > div {
  min-width: 0;
}

.head .pic {
  width: 48px;
  height: 48px;
}

.head h2 {
  margin: 0;
  font-size: 20px;
  overflow-wrap: anywhere;
}

.head h2 span {
  color: var(--mute);
  font-weight: 550;
}

.head p {
  margin: 4px 0 0;
  color: var(--mute);
  font-size: 13px;
}

.head .born {
  margin-top: 6px;
  color: #9a9aa2;
  font-size: 12px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.cell span {
  display: block;
  color: var(--mute);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cell b {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  font-weight: 650;
}

.snaps-wrap {
  display: grid;
  gap: 10px;
}

.snaps-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--mute);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.snaps-h b {
  color: #b8b8be;
  font-weight: 650;
}

.snaps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.snap {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 14px 14px 12px;
  border: 1px solid #1c1c1c;
  border-radius: 14px;
  background: #0c0c0c;
  transition: border-color 0.25s ease, transform 0.25s ease, background 0.25s ease;
}

.snap:hover {
  border-color: #2a2a2a;
  background: #101010;
  transform: translateY(-1px);
}

.snap.up {
  border-color: #1d2a10;
}

.snap.dn {
  border-color: #2a1216;
}

.snap.off {
  opacity: 1;
}

.snap-wait {
  margin: 2px 0 0;
  color: #8a8a92;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.4;
}

.snap-k {
  color: #c8c8ce;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.snap-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.snap-val {
  color: var(--ink);
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1;
}

.snap.up .snap-val {
  color: var(--up);
}

.snap.dn .snap-val {
  color: var(--dn);
}

.snap-x {
  font-size: 13px;
  font-weight: 750;
  font-style: italic;
  letter-spacing: 0.02em;
  transform: skewX(-14deg);
  transform-origin: left bottom;
}

.snap-bot {
  display: grid;
  gap: 3px;
  padding-top: 8px;
  border-top: 1px solid #1a1a1a;
  color: var(--mute);
  font-size: 11px;
}

.snap-bot em {
  font-style: normal;
}

.snap-px {
  color: #9a9aa2;
}

.sk-snap {
  min-height: 118px;
}

.up {
  color: var(--up);
}

.dn {
  color: var(--dn);
}

.plot {
  display: grid;
  gap: 6px;
}

.plot-b {
  position: relative;
  cursor: crosshair;
  touch-action: none;
}

.plot-ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.plot-gx {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--plot, #fff);
  opacity: 0.4;
  transform: translateX(-50%);
}

.plot-dot {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--plot, #fff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--plot, #fff) 28%, transparent);
  transform: translate(-50%, -50%);
}

.plot-tip {
  position: absolute;
  top: 8px;
  padding: 6px 8px;
  border: 1px solid #262626;
  border-radius: 8px;
  background: #0d0d0d;
  white-space: nowrap;
}

.plot-tip b {
  display: block;
  font-size: 13px;
  font-weight: 650;
}

.plot-tip span {
  color: var(--mute);
  font-size: 11px;
}

.plot-x {
  position: relative;
  height: 16px;
  margin: 2px 0 0;
}

.plot-x i {
  position: absolute;
  color: var(--mute);
  font-size: 10px;
  font-style: normal;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transform: translateX(-50%);
}

.plot-x i.a {
  transform: none;
}

.plot-x i.z {
  transform: translateX(-100%);
}

.plot-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.plot-h span {
  color: var(--mute);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.plot-h b {
  font-size: 13px;
  font-weight: 650;
}

.plot-h i {
  font-style: normal;
  font-weight: 650;
}

.plot svg {
  width: 100%;
  height: 168px;
  display: block;
}

.plot .area {
  opacity: 0.14;
}

.plot .line {
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lnk {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 550;
  text-decoration: none;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.lnk img {
  width: 14px;
  height: 14px;
}

.lnk:hover {
  border-color: #2e2e2e;
  background: #111;
  transform: translateY(-1px);
}

.ca {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding-top: 2px;
  border-top: 1px solid var(--line);
}

.ca code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--mute);
  font-size: 12px;
}

.copy {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d0d0d;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.copy img {
  width: 14px;
  height: 14px;
}

.copy:hover {
  border-color: #333;
  background: #151515;
  transform: translateY(-1px);
}

.copy:active {
  transform: scale(0.96);
}

.sk-b {
  display: inline-block;
  height: 0.82em;
  border-radius: 6px;
  background: linear-gradient(90deg, #121212 0%, #1d1d1d 48%, #121212 100%);
  background-size: 200% 100%;
  animation: shimmer 1.15s ease-in-out infinite;
  vertical-align: middle;
}

.sk .av {
  background: #141414;
}

.sk h2,
.sk p {
  height: 16px;
  margin: 0;
}

.sk h2 {
  width: 180px;
  margin-bottom: 8px;
}

.sk p {
  width: 120px;
}

.sk .cell b {
  height: 18px;
  margin-top: 8px;
}

.sk-plot {
  height: 168px;
  border-radius: 10px;
  overflow: hidden;
}

.sk-plot .sk-b {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 10px;
}

.w-10 {
  width: 40px;
}

.w-16 {
  width: 72px;
}

.w-24 {
  width: 110px;
}

.w-40 {
  width: 168px;
}

#toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  padding: 12px 16px;
  border: 1px solid #c8ff3e66;
  border-radius: 12px;
  background: #10140a;
  color: var(--acc);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.01em;
  box-shadow: 0 16px 40px #000a, 0 0 28px #c8ff3e2e;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1), transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

#toast.on {
  opacity: 1;
  transform: none;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

@media (max-width: 720px) {
  .info {
    padding: 8px 14px 10px;
  }

  .info ul {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .info ul::-webkit-scrollbar {
    display: none;
  }

  .info li {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

@media (max-width: 560px) {
  body {
    padding-bottom: max(48px, env(safe-area-inset-bottom));
  }

  main {
    width: min(760px, calc(100% - 24px));
    margin-top: 12px;
  }

  .brand {
    margin-bottom: 10px;
  }

  .blurb {
    margin-top: 14px;
  }

  .brand img {
    width: 124px;
    height: 124px;
  }

  #rail {
    --rail-y: 10px;
    --rail-x: 12px;
    gap: 8px;
  }

  .mark {
    width: 52px;
  }

  .mark img {
    width: 34px;
    height: 34px;
  }

  .chip {
    min-width: 150px;
    max-width: 196px;
    padding: 7px 10px 7px 7px;
  }

  .pic {
    width: 32px;
    height: 32px;
  }

  form {
    flex-wrap: wrap;
    gap: 8px;
  }

  .amt {
    width: 76px;
    height: 48px;
    padding: 0 10px 0 12px;
  }

  .amt input,
  #q {
    height: 48px;
  }

  #q {
    padding: 0 12px;
  }

  .qbox {
    flex: 1 1 calc(100% - 84px);
  }

  #go {
    width: 100%;
    height: 48px;
  }

  .card {
    gap: 14px;
    padding: 14px;
    border-radius: 14px;
  }

  .head {
    gap: 10px;
  }

  .head .pic {
    width: 42px;
    height: 42px;
  }

  .head h2 {
    font-size: 17px;
  }

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

  .snaps {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .snap {
    padding: 12px 12px 10px;
  }

  .snap-val {
    font-size: 20px;
  }

  .plot svg,
  .sk-plot {
    height: 140px;
  }

  .plot-h {
    flex-wrap: wrap;
    gap: 6px;
  }

  .ca code {
    font-size: 11px;
  }

  #toast {
    right: 12px;
    left: 12px;
    bottom: 12px;
  }
}

@media (max-width: 380px) {
  .brand img {
    width: 108px;
    height: 108px;
  }

  .amt {
    width: 70px;
  }

  .qbox {
    flex: 1 1 calc(100% - 78px);
  }
}

@media (hover: none) {
  .chip:hover,
  .snap:hover,
  .lnk:hover,
  .brand:hover,
  .x:hover,
  #go.on:hover,
  .copy:hover {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
