:root {
  --bg: #06131a;
  --bg-base: #041016;
  --bg-soft: rgba(10, 31, 39, 0.78);
  --card: rgba(8, 25, 33, 0.82);
  --card-strong: rgba(10, 34, 43, 0.94);
  --line: rgba(145, 221, 214, 0.18);
  --text: #ebfffb;
  --muted: #9fc1be;
  --accent: #56f0c4;
  --accent-strong: #98ff6c;
  --danger: #ff8474;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background-color: var(--bg-base);
  background:
    radial-gradient(circle at top left, rgba(46, 196, 182, 0.28), transparent 30%),
    radial-gradient(circle at 85% 10%, rgba(152, 255, 108, 0.18), transparent 24%),
    linear-gradient(180deg, #071219 0%, #041016 56%, #02070a 100%);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  font-family: "Sora", sans-serif;
  background-color: var(--bg-base);
  background:
    linear-gradient(135deg, rgba(86, 240, 196, 0.06), transparent 38%),
    linear-gradient(320deg, rgba(152, 255, 108, 0.06), transparent 30%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.65), transparent 85%);
  opacity: 0.25;
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.is-loading {
  pointer-events: none;
}

.is-loading .status-value,
.is-loading .status-chip,
.is-loading .stat-value,
.is-loading .period-label,
.is-loading .period-percent,
.is-loading .section-copy,
.is-loading .source-badge,
.is-loading .timeline-state,
.is-loading .timeline-time,
.is-loading #status-updated,
.is-loading #karasu-rate,
.is-loading #history-count,
.is-loading #latest-change,
.is-loading #chart-copy,
.is-loading #period-meta,
.is-loading #period-label,
.is-loading #period-percent {
  color: transparent;
}

.is-loading .status-value,
.is-loading .status-chip,
.is-loading .stat-value,
.is-loading .section-copy,
.is-loading .source-badge,
.is-loading .period-label,
.is-loading .period-percent,
.is-loading .timeline-state,
.is-loading .timeline-time,
.is-loading #status-updated,
.is-loading #karasu-rate,
.is-loading #history-count,
.is-loading #latest-change,
.is-loading #chart-copy,
.is-loading #period-meta,
.is-loading #period-percent,
.is-loading #period-label {
  position: relative;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.is-loading .status-value::after,
.is-loading .status-chip::after,
.is-loading .stat-value::after,
.is-loading .section-copy::after,
.is-loading .source-badge::after,
.is-loading .period-label::after,
.is-loading .period-percent::after,
.is-loading .timeline-state::after,
.is-loading .timeline-time::after,
.is-loading #status-updated::after,
.is-loading #karasu-rate::after,
.is-loading #history-count::after,
.is-loading #latest-change::after,
.is-loading #chart-copy::after,
.is-loading #period-meta::after,
.is-loading #period-percent::after,
.is-loading #period-label::after,
.is-loading .chart-frame::after,
.is-loading .timeline-list::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
  transform: translateX(-100%);
  animation: skeleton-sheen 1.3s ease-in-out infinite;
}

.is-loading .source-badge {
  min-width: 150px;
  min-height: 40px;
}

.is-loading .status-value {
  width: min(4ch, 100%);
  min-height: 1em;
}

.is-loading .status-chip {
  min-width: 128px;
  min-height: 42px;
  box-shadow: none;
}

.is-loading .status-chip::before {
  opacity: 0;
}

.is-loading #status-updated,
.is-loading #chart-copy {
  width: min(34ch, 100%);
  min-height: 1.4em;
}

.is-loading .stat-value {
  width: 5ch;
  min-height: 1em;
}

.is-loading .period-label {
  width: 11ch;
  min-height: 1.1em;
  margin: 0 auto;
}

.is-loading .period-percent {
  width: 6ch;
  min-height: 1em;
  margin: 0 auto;
}

.is-loading .chart-frame {
  min-height: 320px;
}

.is-loading .chart-frame::before {
  content: "";
  position: absolute;
  inset: 20px;
  border-radius: 18px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px) 0 0 / 100% 68px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px) 0 0 / 56px 100%,
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
}

.is-loading .chart-svg,
.is-loading .chart-labels {
  opacity: 0;
}

.is-loading #period-meta {
  width: 24ch;
  min-height: 1em;
}

.is-loading .timeline-list {
  position: relative;
  min-height: 284px;
}

.is-loading .timeline-list::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    linear-gradient(transparent 0 0);
  box-shadow:
    inset 0 0 0 1px rgba(145, 221, 214, 0.08),
    0 76px 0 0 rgba(255, 255, 255, 0.03),
    0 152px 0 0 rgba(255, 255, 255, 0.03),
    0 228px 0 0 rgba(255, 255, 255, 0.03);
}

.is-loading .timeline-item,
.is-loading .empty-state {
  opacity: 0;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border: 1px solid rgba(126, 228, 208, 0.18);
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(8, 25, 33, 0.8), rgba(4, 13, 18, 0.94));
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -20% -35% auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(86, 240, 196, 0.28), transparent 70%);
  filter: blur(12px);
}

.hero-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(10, 41, 50, 0.7);
  border: 1px solid rgba(145, 221, 214, 0.14);
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 20px rgba(86, 240, 196, 0.9);
}

.source-badge {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(145, 221, 214, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.84rem;
}

h1 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.3rem, 6vw, 4.9rem);
  line-height: 0.95;
  max-width: 10ch;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 24px;
  position: relative;
  z-index: 1;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.lead {
  margin: 0;
  max-width: 56ch;
  color: var(--muted);
  line-height: 1.75;
}

.status-panel {
  display: grid;
  gap: 18px;
  padding: 24px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(9, 30, 39, 0.86), rgba(6, 17, 24, 0.98));
  border: 1px solid rgba(145, 221, 214, 0.16);
}

.status-label {
  color: var(--muted);
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.status-value {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(4rem, 15vw, 8rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 10px 16px;
  border-radius: 999px;
  color: #041016;
  font-weight: 700;
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  box-shadow: 0 14px 28px rgba(86, 240, 196, 0.2);
}

.status-chip.no {
  color: #fff8f6;
  background: linear-gradient(120deg, #ff9f66, var(--danger));
  box-shadow: 0 14px 28px rgba(255, 132, 116, 0.16);
}

.status-chip::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.8;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.stat-card,
.chart-card,
.timeline-card {
  border-radius: 24px;
  border: 1px solid rgba(145, 221, 214, 0.12);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.stat-card {
  padding: 20px;
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.stat-value {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.7rem;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 20px;
  margin-top: 22px;
  align-items: start;
}

.chart-card,
.timeline-card {
  padding: 24px;
}

.timeline-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 510px;
}

.section-title {
  margin: 0 0 10px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.35rem;
}

.section-copy {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.7;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.chart-toolbar {
  display: grid;
  gap: 14px;
  justify-items: end;
}

.view-switch {
  display: inline-flex;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(145, 221, 214, 0.12);
}

.view-button,
.period-button {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.view-button {
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.view-button.active {
  color: #041016;
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
}

.period-tools {
  display: grid;
  grid-template-columns: auto minmax(170px, auto) auto;
  gap: 12px;
  align-items: center;
}

.period-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(145, 221, 214, 0.12);
}

.period-button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.period-summary {
  display: grid;
  gap: 4px;
  text-align: center;
}

.period-label {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.1rem;
}

.period-percent {
  color: var(--accent-strong);
  font-size: 0.92rem;
}

.period-meta {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.chart-frame {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(145, 221, 214, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01)),
    rgba(5, 16, 22, 0.9);
}

.chart-svg {
  display: block;
  width: 100%;
  height: auto;
}

.chart-tooltip {
  position: absolute;
  z-index: 2;
  max-width: min(220px, calc(100% - 24px));
  width: max-content;
  padding: 9px 12px;
  border-radius: 14px;
  border: 1px solid rgba(145, 221, 214, 0.22);
  background: rgba(4, 17, 24, 0.94);
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.4;
  white-space: nowrap;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 8px));
  backdrop-filter: blur(12px);
}

.chart-tooltip::after {
  content: "";
  position: absolute;
  left: calc(50% + var(--tooltip-arrow-offset, 0px));
  bottom: -7px;
  width: 12px;
  height: 12px;
  border-right: 1px solid rgba(145, 221, 214, 0.22);
  border-bottom: 1px solid rgba(145, 221, 214, 0.22);
  background: rgba(4, 17, 24, 0.94);
  transform: translateX(-50%) rotate(45deg);
}

.chart-bar {
  cursor: default;
  transform-box: fill-box;
  transform-origin: center bottom;
  transition: transform 160ms ease, opacity 160ms ease, stroke 160ms ease, stroke-width 160ms ease, filter 160ms ease;
}

.chart-bar:hover,
.chart-bar:focus-visible,
.chart-bar.is-active {
  opacity: 1;
  stroke: rgba(235, 255, 251, 0.7);
  stroke-width: 2;
  filter: drop-shadow(0 10px 18px rgba(86, 240, 196, 0.28));
  transform: translateY(-4px) scaleX(1.03);
  outline: none;
}

.chart-labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.8rem;
}

.timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  align-content: start;
  gap: 14px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(145, 221, 214, 0.36) transparent;
}

.timeline-list::-webkit-scrollbar {
  width: 10px;
}

.timeline-list::-webkit-scrollbar-track {
  background: transparent;
}

.timeline-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 2px solid transparent;
  background: rgba(145, 221, 214, 0.28);
  background-clip: padding-box;
}

.timeline-list::-webkit-scrollbar-thumb:hover {
  background: rgba(145, 221, 214, 0.42);
  background-clip: padding-box;
}

.timeline-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(145, 221, 214, 0.08);
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(86, 240, 196, 0.7);
}

.timeline-dot.no {
  background: var(--danger);
  box-shadow: 0 0 18px rgba(255, 132, 116, 0.5);
}

.timeline-state {
  font-weight: 700;
}

.timeline-time {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: right;
}

.empty-state {
  padding: 22px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.live {
  animation: fade-up 700ms ease both;
}

.stagger-1 { animation-delay: 80ms; }
.stagger-2 { animation-delay: 160ms; }
.stagger-3 { animation-delay: 240ms; }

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes skeleton-sheen {
  to {
    transform: translateX(100%);
  }
}

@media (max-width: 980px) {
  .hero-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .timeline-card {
    height: auto;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .chart-header {
    flex-direction: column;
  }

  .chart-toolbar {
    width: 100%;
    justify-items: stretch;
  }
}

@media (max-width: 640px) {
  .page {
    width: min(100% - 20px, 100%);
    padding: 20px 0 36px;
  }

  .hero,
  .chart-card,
  .timeline-card,
  .stat-card {
    border-radius: 22px;
  }

  .hero {
    padding: 20px;
  }

  .hero-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .status-panel {
    padding: 20px;
  }

  .period-tools {
    grid-template-columns: 42px 1fr 42px;
  }

  .timeline-item {
    grid-template-columns: auto 1fr;
  }

  .timeline-time {
    grid-column: 2;
    text-align: left;
  }
}