:root {
  --bg: #fff;
  --fg: #111;
  --muted: #666;
  --accent: #007acc;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

* {
  box-sizing: border-box
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--fg)
}

body {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3rem;
  overflow-y: auto;
}

.container {
  max-width: 900px;
  width: 100%;
  text-align: center
}

.unit-option {
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.unit-option:hover {
  background: #f0f0f0;
}

.unit-option.active {
  background: var(--accent);
  color: white;
  font-weight: 600;
}

.tab-nav {
  display: flex;
  gap: 0;
  justify-content: center;
  margin: 1.5rem 0 1rem;
  border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: #666;
  transition: all 0.2s;
  position: relative;
  bottom: -2px;
}

.tab-btn:hover {
  color: var(--accent);
  background: #f8f8f8;
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

h1 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem
}

#countdown {
  color: var(--accent);
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: -0.02em;
  margin: 0.5rem 0 1.5rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.section-header {
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid #f0f0f0;
  color: var(--fg);
  font-size: 1.25rem;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 1rem
}

code {
  background: #f7f7f7;
  padding: 0.15rem 0.35rem;
  border-radius: 4px
}

/* Shared compact table style used for both lifts and trades */
.data-table {
  /* don't stretch to full width; size to content */
  width: auto;
  display: inline-table;
  table-layout: auto;
  border-collapse: collapse;
  margin-top: 0.25rem;
  font-size: 0.88rem;
  border: 1px solid #e6e6e6;
  white-space: nowrap;
  /* keep columns tight */
}

.data-table th,
.data-table td {
  /* tight padding */
  padding: 0.18rem 0.36rem;
  border: 1.5px solid #e6e6e6;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.data-table thead th {
  border-bottom: 3px solid #dcdcdc;
  border-top: 2px solid #dcdcdc;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.data-table td.right,
.data-table th.right {
  text-align: right;
}

/* Visual indicator for headers with tooltips */
.data-table th[title] {
  border-bottom: 3px dotted #000;
  cursor: help;
}

/* Highlight table row when hovering chart point */
.data-table tbody tr.highlight-row {
  background-color: #fff3cd;
  outline: 2px solid #ffc107;
  outline-offset: -1px;
}

/* allow horizontal scroll on small viewports instead of forcing wide columns */
#trades-list,
#lifts-list {
  max-width: 520px;
  overflow-x: auto;
}

/* reuse trades-grid for lifts too */
#trades-grid,
#lifts-grid {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  justify-content: center;
  margin-top: 0.4rem;
  flex-wrap: wrap;
}

/* plot container (shared) */
#trades-plot,
#lifts-plot {
  width: 400px;
  min-width: 280px;
  max-width: 480px;
  background: #fff;
  border: 1px solid #e6e6e6;
  padding: 0.5rem;
  border-radius: 4px;
  box-shadow: none;
  font-size: 0.85rem;
  color: var(--muted);
}

/* svg fills container */
#trades-plot svg,
#lifts-plot svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Make tooltips appear faster */
#trades-plot svg title,
#lifts-plot svg title {
  pointer-events: none;
}

#trades-plot svg circle.series-point:hover title,
#lifts-plot svg circle.series-point:hover title {
  display: block;
}

/* Thicker axes for charts */
#trades-plot svg line[stroke="#e6e6e6"],
#lifts-plot svg line[stroke="#e6e6e6"] {
  stroke: #d0d0d0;
  stroke-width: 1.8px;
}

/* nicer series styling for plots */
#trades-plot svg .series-path,
#lifts-plot svg .series-path {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.06));
  pointer-events: none;
  /* ensure circles can be hovered */
}

#trades-plot svg .series-epley,
#lifts-plot svg .series-epley {
  opacity: 0.95;
  pointer-events: none;
  /* ensure circles can be hovered */
}

#trades-plot svg circle.series-point,
#lifts-plot svg circle.series-point {
  cursor: pointer;
  transition: stroke-width 0.15s ease;
}

#trades-plot svg circle.series-point:hover,
#lifts-plot svg circle.series-point:hover {
  stroke-width: 2.5px;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.2));
}

/* Larger touch targets for mobile */
@media (max-width: 768px) {

  #trades-plot svg circle.series-point,
  #lifts-plot svg circle.series-point {
    r: 5;
    /* Larger dots on mobile for easier tapping */
  }

  .tab-btn {
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
  }

  #unit-toggle {
    position: static !important;
    justify-content: center;
    margin-top: 0.5rem;
    font-size: 0.8rem;
  }

  h1 {
    margin-bottom: 0;
  }

  .data-table {
    font-size: 0.75rem;
    overflow-x: auto;
    display: block;
  }

  body {
    padding: 1.5rem;
  }
}

#trades-plot .caption,
#lifts-plot .caption {
  color: var(--muted);
}

/* small caption */
#trades-plot .caption,
#lifts-plot .caption {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
}

/* keep existing .empty rules */
.empty {
  color: var(--muted);
  padding: 0.5rem 0;
  text-align: left;
}