:root {
  color-scheme: dark;
  --bg: #111318;
  --panel: #1a1e26;
  --panel-strong: #202632;
  --text: #f7f3ed;
  --muted: #adb4c2;
  --accent: #ffcc66;
  --accent-2: #71e1c5;
  --border: rgba(255,255,255,0.08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #0f1218 0%, #171c24 100%);
  color: var(--text);
}
.app-shell {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 18px 14px 40px;
}
.hero {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.hero-main {
  min-width: 0;
  flex: 1 1 auto;
}
.hero-actions {
  display: grid;
  gap: 8px;
  justify-items: stretch;
  min-width: 132px;
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.version-chip {
  margin: 8px 0 0;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}
.summary {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.hero-live-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 204, 102, 0.08);
  border: 1px solid rgba(255, 204, 102, 0.12);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}
.hero-live-label {
  color: var(--muted);
}
.hero-live-value {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}
.refresh-button {
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: #2b2415;
  font-weight: 700;
  padding: 12px 14px;
}
.export-button {
  background: rgba(113, 225, 197, 0.18);
  color: var(--accent-2);
}
.export-button:disabled {
  opacity: 0.6;
}
.project-picker {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.project-picker select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  appearance: none;
}
.status-card,
.ranking-section {
  background: rgba(26, 30, 38, 0.92);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.18);
}
.status-card {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
  gap: 12px;
}
.section-header h2 {
  margin: 0;
  font-size: 18px;
}
.section-heading-stack {
  min-width: 0;
  flex: 1 1 auto;
}
.section-header.compact {
  margin-bottom: 8px;
  align-items: center;
}
.section-header.compact h3 {
  margin: 0;
  font-size: 16px;
}
.count-badge {
  min-width: 34px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}
.ranking-list {
  display: grid;
  gap: 10px;
}
.alerts-block {
  margin-top: 12px;
}
.history-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.history-date-picker {
  display: block;
  min-width: 164px;
}
.calendar-date-select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
}
.rank-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  background: var(--panel-strong);
  border-radius: 18px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.05);
}
.rank-index {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(255, 204, 102, 0.14);
  color: var(--accent);
  font-size: 18px;
  font-weight: 800;
}
.rank-body {
  min-width: 0;
}
@media (max-width: 480px) {
  .hero {
    gap: 10px;
  }
  .hero-actions {
    min-width: 124px;
  }
  .history-date-picker {
    min-width: 128px;
  }
  .hero-live-row {
    display: flex;
    width: fit-content;
    max-width: 100%;
  }
}
.rank-title {
  margin: 0 0 6px;
  font-size: 15px;
  line-height: 1.35;
}
.rank-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}
.rank-metric {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-2);
}
.alert-card {
  display: grid;
  gap: 8px;
  background: var(--panel-strong);
  border-radius: 16px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.05);
}
.alert-card-main {
  display: grid;
  gap: 4px;
}
.alert-title {
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
}
.alert-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}
.alert-deltas {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.alert-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 204, 102, 0.12);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}
.alert-chip.is-muted {
  background: rgba(255,255,255,0.07);
  color: var(--muted);
}
.alert-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.alert-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}
.rank-metric-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.metric-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(113, 225, 197, 0.12);
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 700;
}
.metric-chip.is-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}
.metric-chip-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.empty-state {
  padding: 16px 10px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.history-summary {
  margin-bottom: 12px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.history-detail-grid {
  display: grid;
  gap: 14px;
}
.is-hidden {
  display: none;
}
.footer-note {
  margin-top: 4px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(173, 180, 194, 0.92);
  background: rgba(255,255,255,0.03);
  box-shadow: none;
}
@media (max-width: 480px) {
  .history-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .history-date-picker {
    min-width: 0;
  }
}
