/* src/web/styles.css */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
:root {
  --page-top-color: #07090f;
  --ink: #f5f5f7;
  --dim: #b9c0cf;
  --faint: #8d96a9;
  --up: #3dd68c;
  --dn: #ff7a6e;
  --flat: #b9c0cf;
  --accent: #ffd60a;
  --toolbar-edge-color: color-mix(in srgb, black 55%, var(--page-top-color));
}
html {
  background: var(--page-top-color);
}
body {
  font-family:
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  background: #07090f;
  color: var(--ink);
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
}
.ambient {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.ambient i {
  position: absolute;
  border-radius: 50%;
  filter: blur(46px);
  opacity: .5;
}
.ambient .a {
  width: 260px;
  height: 260px;
  background: #274b8f;
  top: -70px;
  left: -60px;
}
.ambient .b {
  width: 220px;
  height: 220px;
  background: #6e2a3a;
  bottom: 120px;
  right: -80px;
  opacity: .38;
}
.ambient .c {
  width: 200px;
  height: 200px;
  background: #14532d;
  bottom: -60px;
  left: 30px;
  opacity: .32;
}
.screen {
  position: relative;
  max-width: 430px;
  margin: 0 auto;
  padding: 20px 16px 96px;
}
.glass {
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, .13),
      rgba(255, 255, 255, .045) 42%,
      rgba(255, 255, 255, .02));
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .35),
    inset 0 -1px 0 rgba(255, 255, 255, .05),
    0 10px 26px rgba(0, 0, 0, .42);
  border-radius: 20px;
  position: relative;
}
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, .20),
      rgba(255, 255, 255, .05) 30%,
      transparent 58%);
}
.hd {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0 2px;
  gap: 10px;
}
.hd .t {
  font-size: 21px;
  font-weight: 700;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .6);
}
.hd .d {
  color: var(--dim);
  font-size: 12.5px;
  text-align: right;
}
.updated {
  color: var(--faint);
  font-size: 12px;
  margin: 6px 2px 0;
}
.updated b {
  color: var(--dim);
  font-weight: 600;
}
.stalebar {
  display: none;
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(255, 182, 94, .16);
  border: 1px solid rgba(255, 182, 94, .45);
  color: #ffd9a8;
  font-size: 12.5px;
}
.stalebar.show {
  display: block;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.tile {
  padding: 13px 13px 11px;
  border-radius: 20px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease;
  overflow: hidden;
  text-align: left;
  width: 100%;
  color: var(--ink);
  font: inherit;
}
.tile:active {
  transform: scale(.985);
}
.tile .s {
  font-size: 17px;
  font-weight: 750;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
}
.tile .nm {
  font-size: 11px;
  color: var(--dim);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tile .p {
  font-size: 21px;
  font-weight: 700;
  margin-top: 5px;
}
.tile .p.none {
  font-size: 14px;
  color: var(--faint);
  font-weight: 600;
}
.tile .c {
  font-size: 13.5px;
  font-weight: 650;
  margin-top: 2px;
}
.tile .cost {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(255, 255, 255, .13);
  font-size: 11.5px;
  color: #c3cadb;
}
.tile .cost b {
  color: var(--ink);
}
.up {
  color: var(--up);
}
.dn {
  color: var(--dn);
}
.flat {
  color: var(--flat);
}
.hot-d {
  border-color: rgba(255, 107, 94, .75);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .35),
    inset 0 0 22px rgba(255, 107, 94, .16),
    0 0 24px rgba(255, 107, 94, .28),
    0 10px 26px rgba(0, 0, 0, .42);
}
.hot-u {
  border-color: rgba(61, 214, 140, .7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .35),
    inset 0 0 22px rgba(61, 214, 140, .14),
    0 0 24px rgba(61, 214, 140, .25),
    0 10px 26px rgba(0, 0, 0, .42);
}
.tile .rm {
  flex: none;
  width: 28px;
  height: 28px;
  margin: -6px -6px 0 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .18);
  color: var(--dim);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  position: relative;
  z-index: 2;
}
.tile .rm::after {
  content: "";
  position: absolute;
  inset: -8px;
}
.empty {
  margin-top: 12px;
  padding: 18px 14px;
  text-align: center;
  color: var(--dim);
  font-size: 14px;
  line-height: 1.5;
}
.idx {
  margin-top: 12px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: #c3cadb;
  border-radius: 14px;
}
.idx b {
  color: var(--ink);
  font-weight: 650;
}
.idx .when {
  color: var(--faint);
}
.aurora {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  overflow: hidden;
  background:
    radial-gradient(
      130% 90% at 50% -20%,
      rgba(255, 190, 60, .34),
      transparent 60%),
    radial-gradient(
      110% 90% at 112% 50%,
      rgba(255, 90, 160, .28),
      transparent 60%),
    radial-gradient(
      130% 95% at 50% 120%,
      rgba(122, 92, 255, .34),
      transparent 62%),
    radial-gradient(
      100% 80% at -12% 50%,
      rgba(60, 160, 255, .26),
      transparent 58%);
  filter: blur(9px);
  transform: scale(1.07);
}
.aurora i {
  position: absolute;
  inset: 0;
  opacity: 0;
  background:
    radial-gradient(rgba(255, 255, 255, .55) 1px, transparent 1.6px),
    radial-gradient(
      120% 60% at 50% -10%,
      rgba(255, 190, 60, .55),
      transparent 55%),
    radial-gradient(
      90% 70% at 108% 45%,
      rgba(255, 90, 160, .48),
      transparent 55%),
    radial-gradient(
      100% 65% at 50% 112%,
      rgba(122, 92, 255, .58),
      transparent 58%),
    radial-gradient(
      80% 60% at -8% 45%,
      rgba(60, 160, 255, .42),
      transparent 55%);
  background-size:
    26px 26px,
    auto,
    auto,
    auto,
    auto;
  -webkit-mask-image:
    radial-gradient(
      115% 115% at 50% 50%,
      transparent 50%,
      #000 86%);
  mask-image:
    radial-gradient(
      115% 115% at 50% 50%,
      transparent 50%,
      #000 86%);
}
.flooding .aurora {
  animation: washIn 2.4s ease-out forwards;
}
.flooding .aurora i {
  animation: edgeIn 2.4s ease-out forwards;
}
@keyframes washIn {
  0% {
    opacity: 0;
  }
  22% {
    opacity: .55;
  }
  48% {
    opacity: .3;
  }
  68% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes edgeIn {
  0% {
    opacity: 0;
  }
  26% {
    opacity: .3;
  }
  46% {
    opacity: .85;
  }
  68% {
    opacity: .48;
  }
  86% {
    opacity: .28;
  }
  100% {
    opacity: 0;
  }
}
.bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  pointer-events: none;
}
.bar .dock {
  pointer-events: auto;
  display: flex;
  gap: 8px;
  padding: 8px;
  border-radius: 999px;
}
.bar button {
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .09);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  padding: 10px 18px;
  cursor: pointer;
}
.bar button.primary {
  background: var(--ink);
  color: #14161c;
  border-color: var(--ink);
}
.detail {
  position: fixed;
  inset: 0;
  background: #0a0e18;
  padding: calc(18px + env(safe-area-inset-top)) 16px 32px;
  overflow-y: auto;
  transform: translateY(102%);
  transition: transform .32s ease;
  z-index: 30;
  visibility: hidden;
}
.detail.open {
  transform: translateY(0);
  visibility: visible;
}
.d-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.back {
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .18);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13.5px;
  cursor: pointer;
  min-height: 44px;
  font: inherit;
}
.d-when {
  color: var(--faint);
  font-size: 12px;
  text-align: right;
}
.d-name {
  font-size: 24px;
  font-weight: 750;
  margin-top: 14px;
}
.d-name span {
  font-size: 14px;
  color: var(--faint);
  font-weight: 500;
  display: block;
  margin-top: 2px;
}
.d-price {
  font-size: 19px;
  font-weight: 650;
  margin-top: 6px;
}
.d-price span {
  font-size: 14px;
  font-weight: 600;
}
.ranges {
  display: flex;
  gap: 7px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.ranges button {
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  color: var(--faint);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  padding: 8px 13px;
  min-height: 36px;
  cursor: pointer;
}
.ranges button.on {
  background: var(--ink);
  color: #14161c;
  border-color: var(--ink);
}
.chart {
  width: 100%;
  height: 110px;
  margin-top: 10px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 14px;
}
.d-chartcap {
  font-size: 11.5px;
  color: var(--faint);
  margin-top: 6px;
}
.ohlc {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px 14px;
  margin-top: 10px;
}
.ohlc div,
.nums div {
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 12px;
  padding: 9px 11px;
}
.ohlc span,
.nums span {
  display: block;
  font-size: 11px;
  color: var(--faint);
}
.ohlc b,
.nums b {
  font-size: 14.5px;
  font-weight: 650;
}
.d-sec {
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 20px 0 8px;
}
.nums {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px 14px;
}
.d-actions {
  display: flex;
  gap: 8px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.d-actions button {
  min-height: 44px;
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 650;
  cursor: pointer;
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .18);
  color: var(--ink);
}
.d-actions button.danger {
  color: var(--dn);
  border-color: rgba(255, 107, 94, .5);
}
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 40;
}
.toolbar-edge {
  position: fixed;
  inset-inline: 0;
  top: -7px;
  height: 12px;
  pointer-events: none;
  background-color: var(--toolbar-edge-color);
  z-index: 41;
}
.toolbar-edge::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 100%;
  height: 48px;
  background-image:
    linear-gradient(
      to bottom,
      var(--toolbar-edge-color),
      transparent);
}
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 42;
  max-width: 430px;
  margin: 0 auto;
  background: #12151d;
  border: 1px solid rgba(255, 255, 255, .16);
  border-bottom: none;
  border-radius: 22px 22px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  max-height: 82dvh;
  overflow-y: auto;
}
.sheet h2 {
  font-size: 17px;
  font-weight: 700;
}
.sheet .x {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .18);
  color: var(--ink);
  font-size: 16px;
  cursor: pointer;
}
.sheet .x::after {
  content: "";
  position: absolute;
  inset: -4px;
}
.field {
  margin-top: 14px;
}
.field label {
  display: block;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .06);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  padding: 10px 12px;
}
.field input:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.results {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
}
.results button {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  text-align: left;
  min-height: 48px;
  padding: 10px 8px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
}
.results .sym {
  font-weight: 750;
  font-size: 15px;
}
.results .nm {
  color: var(--dim);
  font-size: 12.5px;
  text-align: right;
}
.sheet .msg {
  color: var(--dim);
  font-size: 13px;
  margin-top: 10px;
  line-height: 1.45;
}
.sheet .msg.err {
  color: var(--dn);
}
.sheet .row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.sheet .row button {
  flex: 1;
  min-height: 48px;
  border-radius: 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .09);
  color: var(--ink);
}
.sheet .row button.primary {
  background: var(--ink);
  color: #14161c;
  border-color: var(--ink);
}
.setrow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  font-size: 14px;
}
.setrow span {
  color: var(--faint);
}
.setrow button {
  min-height: 44px;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .18);
  color: var(--ink);
}
.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  bottom: calc(86px + env(safe-area-inset-bottom));
  z-index: 60;
  background: #1c2130;
  border: 1px solid rgba(255, 255, 255, .22);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  display: flex;
  gap: 12px;
  align-items: center;
  max-width: calc(100vw - 32px);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.toast button {
  background: none;
  border: none;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  min-height: 32px;
}
@media (prefers-reduced-motion: reduce) {
  .flooding .aurora,
  .flooding .aurora i {
    animation: none;
  }
  .detail {
    transition: none;
  }
  .tile {
    transition: none;
  }
}
