:root {
  color-scheme: dark;
  --bg: #0b141d;
  --panel: #111d29;
  --panel-hi: #182b3a;
  --line: #254257;
  --line-soft: #1d3344;
  --text: #dbe8f2;
  --muted: #8ea5b6;
  --steam: #66c0f4;
  --steam-2: #1a9fff;
  --good: #a4d007;
  --yellow: #f2c94c;
  --orange: #ff9f43;
  --bad: #ff7065;
  --cold: #6f8ca5;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 240px;
  margin: 0;
  background:
    radial-gradient(circle at 15% 0%, rgba(102, 192, 244, .14), transparent 34%),
    linear-gradient(180deg, #162a3a, var(--bg) 46%, #080e14);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 12px;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.watch {
  width: min(100vw, 330px);
  min-height: 100vh;
  padding: 8px;
  display: grid;
  gap: 7px;
  align-content: start;
}

.top,
.price-card,
.facts {
  border: 1px solid rgba(102, 192, 244, .16);
  background: rgba(17, 29, 41, .88);
  box-shadow: inset 0 1px rgba(255, 255, 255, .04), 0 12px 24px rgba(0, 0, 0, .2);
}

.top {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 8px;
}

h1 {
  margin: 0;
  color: #f4f9fd;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
}

#date,
.label,
#updated,
.status-line {
  color: var(--muted);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

#updated {
  max-width: 58px;
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#refresh {
  width: 26px;
  height: 24px;
  border: 1px solid rgba(102, 192, 244, .3);
  background: linear-gradient(180deg, #294a63, #182b3a);
  color: var(--steam);
  cursor: pointer;
}

#refresh:active {
  transform: translateY(1px);
}

.top-actions a {
  color: var(--steam);
  font-size: 10px;
  text-decoration: none;
}

.top-actions a:hover {
  color: #fff;
}

.price-card {
  padding: 8px;
  background:
    linear-gradient(90deg, rgba(102, 192, 244, .08), transparent 62%),
    rgba(17, 29, 41, .92);
}

.status-line {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 16px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cold);
  box-shadow: 0 0 10px currentColor;
  color: var(--cold);
}

.dot.good {
  background: var(--good);
  color: var(--good);
}

.dot.low {
  background: var(--yellow);
  color: var(--yellow);
}

.dot.orange {
  background: var(--orange);
  color: var(--orange);
}

.dot.error {
  background: var(--bad);
  color: var(--bad);
}

.dot.negative {
  background: var(--bad);
  color: var(--bad);
}

.price-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 54px;
  align-items: center;
  gap: 8px;
}

.price-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: baseline;
  justify-content: center;
  gap: 0;
}

.price-value {
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 7px;
}

#price {
  color: #f6fbff;
  font-size: 42px;
  font-weight: 500;
  letter-spacing: 0;
}

.price-value span {
  color: var(--steam);
  font-size: 12px;
}

#price-czk {
  align-self: center;
  margin-top: -3px;
  color: rgba(142, 165, 182, .78);
  font-size: 9px;
}

.price-side {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-color: rgba(102, 192, 244, .12);
}

.price-side-left {
  align-items: flex-start;
  padding-right: 7px;
  border-right: 1px solid rgba(102, 192, 244, .12);
}

.price-side-right {
  align-items: flex-end;
  padding-left: 7px;
  border-left: 1px solid rgba(102, 192, 244, .12);
}

.price-side span {
  color: var(--muted);
  font-size: 9px;
}

.price-side strong {
  max-width: 100%;
  overflow: hidden;
  color: #f3f8fc;
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.facts > div {
  min-width: 0;
  padding: 7px 8px;
  border-left: 1px solid var(--line-soft);
}

.facts > div:first-child {
  border-left: 0;
}

.label {
  display: block;
  margin-bottom: 2px;
  font-size: 10px;
}

.facts strong {
  display: block;
  overflow: hidden;
  color: #f3f8fc;
  font-size: 14px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(96, minmax(1px, 1fr));
  gap: 1px;
  height: 26px;
  align-items: end;
  padding: 1px 0;
}

.time-axis {
  position: relative;
  margin-top: -6px;
  padding-top: 5px;
  border-top: 1px solid rgba(102, 192, 244, .08);
  color: rgba(142, 165, 182, .66);
  font-size: 9px;
  height: 16px;
  letter-spacing: 0;
}

.time-axis span {
  position: absolute;
  top: 5px;
  transform: translateX(-50%);
  white-space: nowrap;
}

.time-axis span::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 1px;
  height: 4px;
  background: rgba(102, 192, 244, .16);
}

.time-axis span:nth-child(1) {
  left: 0;
  transform: none;
}

.time-axis span:nth-child(1)::before {
  left: 0;
}

.time-axis span:nth-child(2) {
  left: 25%;
}

.time-axis span:nth-child(3) {
  left: 50%;
}

.time-axis span:nth-child(4) {
  left: 75%;
}

.time-axis span:nth-child(5) {
  right: 0;
  transform: none;
}

.time-axis span:nth-child(5)::before {
  left: auto;
  right: 0;
}

.next-day {
  display: grid;
  gap: 2px;
  margin-top: -2px;
}

.next-time-axis {
  margin-top: 0;
}

.day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  color: rgba(142, 165, 182, .72);
  font-size: 9px;
}

.day-head strong {
  overflow: hidden;
  color: rgba(219, 232, 242, .78);
  font-size: 9px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.next-timeline {
  height: 26px;
  opacity: .86;
}

.bar {
  min-height: 3px;
  background: linear-gradient(180deg, #41576a, #273845);
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.bar.good {
  background: linear-gradient(180deg, var(--good), #547900);
}

.bar.low {
  background: linear-gradient(180deg, #ffc06f, var(--orange) 48%, #9a5517);
  border-top-color: rgba(255, 226, 190, .3);
}

.bar.orange {
  background: linear-gradient(180deg, #ffe27a, var(--yellow) 48%, #8b6b13);
  border-top-color: rgba(255, 244, 185, .28);
}

.bar.negative {
  background: linear-gradient(180deg, #ff8a7f, var(--bad) 46%, #9f302f);
  border-top-color: rgba(255, 210, 205, .32);
  box-shadow: 0 0 8px rgba(255, 112, 101, .22);
}

.bar.current {
  outline: 1px solid var(--steam);
  outline-offset: 0;
  filter: brightness(1.35);
}

@media (max-width: 280px) {
  .watch {
    width: 100vw;
    padding: 6px;
  }

  #price {
    font-size: 34px;
  }

  .price-row {
    grid-template-columns: 46px minmax(0, 1fr) 46px;
    gap: 6px;
  }

  .price-side-left {
    padding-right: 5px;
  }

  .price-side-right {
    padding-left: 5px;
  }

  .price-side strong {
    font-size: 11px;
  }

  .facts strong {
    font-size: 12px;
  }
}
