.hero {
  background: transparent;
  padding: 80px 20px 10px;
  text-align: center;
}

.hero h1 {
  color: var(--accent);
  font-size: 3rem;
  margin: 0 0 40px 0;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
  letter-spacing: 3px;
}

.hero .tagline { color: var(--text-secondary); font-size: 1.2rem; margin-bottom: 40px; }

.hero .description {
  color: var(--text-secondary);
  max-width: 800px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.stats-bar {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 0;
  flex-wrap: wrap;
}

.stat-item { text-align: center; }
.stat-value { color: var(--accent); font-size: 2rem; font-weight: bold; }
.stat-label { color: var(--text-secondary); font-size: 0.9rem; }

.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  padding-top: 5px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  padding: 8px;
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.filter-group {
  display: flex;
  flex-direction: column;
  min-width: 160px;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: grab;
  line-height: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.filter-group:hover { border-color: var(--accent); box-shadow: 0 1px 4px rgba(0,0,0,0.1); }
.filter-group.dragging { opacity: 0.5; border-color: var(--accent); }
.filter-group.drag-over { border-color: var(--accent); box-shadow: 0 0 6px var(--accent); }

label { font-size: 0.75rem; line-height: 14px; margin-bottom: 2px; font-weight: bold; color: var(--bg-primary); }
select { padding: 2px 4px; border: 1px solid var(--border); border-radius: 3px; font-size: 0.75rem; line-height: 14px; }
.toggles { display: flex; flex-direction: column; gap: 1px; margin-top: 2px; }
.toggles label { font-size: 0.7rem; line-height: 14px; margin-bottom: 0; font-weight: normal; }
.inline-buttons { margin-top: 2px; display: flex; gap: 4px; flex-wrap: wrap; }
.inline-buttons button { font-size: 0.7rem; padding: 1px 6px; line-height: 14px; }

table { border-collapse: collapse; width: 100%; margin-top: 10px; background: white; }
th, td { border: 1px solid #ddd; padding: 8px 10px; font-size: 0.85rem; }
th { background-color: var(--bg-primary); color: var(--accent); text-align: left; position: sticky; top: 0; }
tbody tr:nth-child(even) { background-color: #fafafa; }
tbody tr:hover { background-color: #fff3cd; }

.callout-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: italic;
  color: #666;
  font-size: 0.8rem;
}

.status { margin-bottom: 10px; font-size: 0.9rem; color: #555; }

.chart-container {
  margin-top: 20px;
  padding: 16px;
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.chart-container h2 { color: var(--bg-primary); border-bottom: 2px solid var(--accent); padding-bottom: 10px; }
#chartWrapper { position: relative; height: 400px; width: 100%; }

.chart-resize-handle {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 8px;
  cursor: ns-resize;
  background: linear-gradient(to bottom, transparent, var(--accent));
  opacity: 0.5;
  transition: opacity 0.2s;
  border-radius: 0 0 8px 8px;
}

.chart-resize-handle:hover { opacity: 1; }
.sort-controls { display: flex; flex-direction: column; gap: 4px; }
.sort-buttons { display: flex; gap: 4px; }

.data-section {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 16px;
  margin-top: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.data-section h2 { color: var(--bg-primary); border-bottom: 2px solid var(--accent); padding-bottom: 10px; margin-top: 0; }
.table-container { max-height: 500px; overflow-y: auto; }

.hrv-group-order {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  align-items: center;
}

.hrv-group-order label { font-size: 0.85rem; font-weight: bold; color: var(--bg-primary); margin-right: 4px; }

.hrv-group-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 14px;
  border: 1px solid var(--accent);
  background: var(--bg-primary);
  color: var(--accent);
  font-size: 0.8rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, color 0.15s;
}

.hrv-group-chip:hover { background: var(--accent); color: var(--bg-primary); }
.hrv-group-chip .hrv-arrow { font-size: 0.7rem; opacity: 0.7; }
.hrv-group-chip.active { background: var(--accent); color: var(--bg-primary); }
.hrv-section { margin-bottom: 28px; }

.hrv-section h3 {
  margin: 0 0 6px 0;
  color: var(--bg-primary);
  font-size: 1.05rem;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 4px;
}

.hrv-table-wrapper { max-height: 500px; overflow: auto; border: 1px solid #ccc; border-radius: 4px; }

.hrv-table {
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background: white;
}

.hrv-table th {
  background-color: var(--bg-primary);
  color: var(--accent);
  text-align: right;
  padding: 4px 8px;
  font-size: 0.8rem;
  white-space: nowrap;
  border: 1px solid #ccc;
  position: sticky;
  top: 0;
  z-index: 1;
}

.hrv-table th:first-child { text-align: left; position: sticky; left: 0; z-index: 2; background-color: var(--bg-tertiary); }

.hrv-table td {
  padding: 3px 8px;
  border: 1px solid #ddd;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hrv-table td:first-child { text-align: left; color: #333; position: sticky; left: 0; z-index: 1; background: white; }
.hrv-table td.hrv-num { text-align: right; color: #333; }

.hrv-table tr.hrv-total-row td {
  font-weight: bold;
  border-top: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  color: var(--bg-primary);
  background-color: #f0f0f0;
}

.hrv-table tr.hrv-total-row td:first-child { text-align: left; background-color: #f0f0f0; }
.hrv-table tr.hrv-blank-row td { padding: 0; height: 12px; border: none; background: transparent; }
.hrv-empty { color: #999; font-style: italic; padding: 8px 0; }

.hrv-downloads {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #ddd;
}

.hrv-dl-label { font-weight: bold; color: var(--bg-primary); font-size: 0.9rem; }

.hrv-dl-btn {
  padding: 6px 16px;
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid var(--accent);
  background: var(--bg-primary);
  color: var(--accent);
  font-size: 0.85rem;
  transition: background 0.15s, color 0.15s;
}

.hrv-dl-btn:hover { background: var(--accent); color: var(--bg-primary); }

.pv-tooltip {
  position: absolute;
  background: rgba(20, 20, 30, 0.95);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  pointer-events: auto;
  z-index: 1000;
  max-width: 400px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.15);
  line-height: 1.4;
}

.pv-tooltip .tooltip-metric {
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.pv-tooltip .tooltip-metric:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.pv-tooltip .tooltip-metric-header {
  font-size: 0.85rem;
  margin-bottom: 2px;
}

.pv-tooltip .tooltip-period {
  color: #aaa;
  font-size: 0.75rem;
}

.pv-tooltip .tooltip-value {
  font-size: 0.9rem;
  font-weight: bold;
  margin: 2px 0;
}

.pv-tooltip .tooltip-convert {
  color: #8f8;
  font-size: 0.75rem;
}

.pv-tooltip .tooltip-rate {
  color: #aaa;
  font-size: 0.7rem;
}

.pv-tooltip .tooltip-callout {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.2);
  color: #ff9;
  font-size: 0.78rem;
  line-height: 1.4;
}

.pv-tooltip .callout-toggle {
  cursor: pointer;
  margin-left: 4px;
  color: #88f;
  font-size: 0.7rem;
  user-select: none;
}

.pv-tooltip .callout-toggle:hover {
  color: #aaf;
}

.hrv-metric-cell {
  position: relative;
}

.hrv-callout {
  color: #666;
  font-size: 0.75rem;
  margin-top: 2px;
  line-height: 1.3;
  font-style: italic;
}

.hrv-callout-preview {
  color: #888;
}

.hrv-callout-full {
  display: none;
}

.hrv-callout-toggle {
  cursor: pointer;
  color: var(--accent);
  font-size: 0.7rem;
  margin-left: 4px;
  user-select: none;
}

.hrv-callout-toggle:hover {
  opacity: 0.7;
}




.chart-callout-bubble {
  position: absolute;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid var(--accent);
  border-radius: 8px;
  padding: 8px 12px;
  min-width: 100px;
  max-width: 300px;
  min-height: 40px;
  font-size: 0.8rem;
  color: #333;
  line-height: 1.4;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  cursor: move;
  z-index: 10;
  user-select: none;
  overflow: hidden;
}

.chart-callout-content {
  overflow: auto;
  max-height: calc(100% - 16px);
  padding-right: 4px;
}

.chart-callout-resize {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, var(--accent) 50%);
  border-radius: 0 0 6px 0;
  opacity: 0.7;
}

.chart-callout-resize:hover {
  opacity: 1;
}

.chart-callout-arrow {
  position: absolute;
  pointer-events: none;
  z-index: 5;
  overflow: visible;
}