:root {
  --bg: #f1ede3;
  --panel: rgba(255, 250, 241, 0.9);
  --panel-strong: #fff9ee;
  --ink: #1d2a2f;
  --muted: #5a6b70;
  --line: rgba(29, 42, 47, 0.12);
  --accent: #c35f2d;
  --accent-soft: #edd3b8;
  --success: #2d6c4f;
  --shadow: 0 18px 50px rgba(55, 42, 18, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(195, 95, 45, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(45, 108, 79, 0.14), transparent 26%),
    linear-gradient(180deg, #f7f2e8 0%, #eee6d7 100%);
  min-height: 100vh;
}

.shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.hero {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  padding: 24px 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 252, 245, 0.94), rgba(239, 228, 208, 0.96));
  box-shadow: var(--shadow);
}

.hero-brand {
  position: absolute;
  top: 24px;
  right: 28px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.hero-logo {
  display: block;
  width: min(320px, 24vw);
  height: auto;
}

.hero-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--accent);
}

.environment-flag {
  display: inline-flex;
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(195, 95, 45, 0.14);
  border: 1px solid rgba(195, 95, 45, 0.24);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.environment-flag-production {
  background: rgba(45, 108, 79, 0.14);
  border: 1px solid rgba(45, 108, 79, 0.24);
  color: var(--success);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.95;
  max-width: 12ch;
}

.lede {
  margin-top: 12px;
  max-width: 56ch;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.45;
}

.refresh {
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  padding: 14px 20px;
  font-size: 0.98rem;
  cursor: pointer;
}

.download-button {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(255, 249, 238, 0.92);
  color: var(--ink);
  padding: 14px 20px;
  font-size: 0.98rem;
  cursor: pointer;
  border: 1px solid var(--line);
  text-decoration: none;
}

.refresh:disabled {
  opacity: 0.7;
  cursor: wait;
}

.metric-refresh {
  margin-top: 12px;
  width: 100%;
  justify-content: center;
}

.layout {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.metrics,
.grid {
  display: grid;
  gap: 18px;
}

.metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 22px;
  backdrop-filter: blur(8px);
}

.metric {
  background: var(--panel-strong);
  border-radius: 18px;
  padding: 18px;
  border: 1px solid var(--line);
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric strong {
  font-size: 2rem;
  line-height: 1;
}

.metric-detail {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.metric-detail p {
  margin: 0;
}

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

.panel-head h2 {
  font-size: 1.35rem;
}

.panel-head p {
  max-width: 38ch;
  color: var(--muted);
  line-height: 1.4;
}

.rank-list {
  display: grid;
  gap: 12px;
}

.rank-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.56);
}

.workshop-item {
  align-items: center;
}

.workshop-item-empty {
  background: rgba(255, 255, 255, 0.35);
  border-style: dashed;
}

.workshop-host {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.workshop-attendees {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.workshop-attendees p {
  margin: 0;
}

.rank-copy p {
  line-height: 1.45;
}

.rank-count {
  min-width: 42px;
  text-align: center;
  border-radius: 999px;
  padding: 8px 10px;
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 700;
}

.workshop-count {
  background: transparent;
  border: 1px solid rgba(45, 108, 79, 0.28);
  color: var(--success);
}

.workshop-count-empty {
  border-color: rgba(45, 108, 79, 0.18);
  color: rgba(45, 108, 79, 0.6);
}

.sponsor-list {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sponsor-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  padding: 16px;
}

.sponsor-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.sponsor-card h3 {
  margin: 0;
  font-size: 1.2rem;
  min-width: 0;
}

.sponsor-title {
  display: block;
}

.sponsor-title-truncated {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.sponsor-count {
  min-width: 42px;
  text-align: center;
  border-radius: 999px;
  padding: 8px 10px;
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 700;
  justify-self: end;
  flex-shrink: 0;
}

.sponsor-buckets {
  display: grid;
  gap: 12px;
}

.name-list {
  margin-top: 8px;
}

.name-list summary {
  display: flex;
  gap: 8px;
  align-items: baseline;
  cursor: pointer;
  list-style: none;
}

.name-list summary::-webkit-details-marker {
  display: none;
}

.name-list-more {
  color: var(--accent);
  font-weight: 700;
  white-space: nowrap;
}

.name-list-toggle {
  display: none;
  color: var(--accent);
  font-weight: 700;
  white-space: nowrap;
}

.name-list[open] .name-list-preview,
.name-list[open] .name-list-more {
  display: none;
}

.name-list[open] .name-list-toggle {
  display: inline;
}

.name-list p {
  margin: 10px 0 0;
  line-height: 1.45;
}

.name-list-empty {
  color: rgba(90, 107, 112, 0.68);
}

.sponsor-names {
  margin-top: 12px;
  line-height: 1.45;
  color: var(--ink);
}

.sponsor-names p {
  margin: 0;
}

.bucket-label {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.bucket-label.yes {
  background: rgba(45, 108, 79, 0.16);
  color: var(--success);
}

.bucket-label.maybe {
  background: rgba(195, 95, 45, 0.14);
  color: var(--accent);
}

.bucket-label.no {
  background: rgba(128, 56, 56, 0.14);
  color: #8d3b3b;
}

.empty,
.empty-cell {
  color: var(--muted);
}

.error {
  border-color: rgba(195, 30, 30, 0.25);
  background: rgba(255, 240, 240, 0.92);
  color: #8f2626;
}

.hidden {
  display: none;
}

@media (max-width: 1100px) {
  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .sponsor-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 1440px);
    padding-top: 16px;
  }

  .hero {
    padding: 20px;
    flex-direction: column;
    align-items: stretch;
  }

  .hero-brand {
    position: static;
    justify-content: flex-start;
    order: -1;
  }

  .hero-logo {
    width: min(260px, 60vw);
  }

  .hero-actions {
    width: 100%;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel {
    padding: 18px;
  }

  .sponsor-list {
    grid-template-columns: 1fr;
  }
}
