:root {
  color-scheme: light;
  --bg: #0b1720;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-soft: rgba(244, 250, 251, 0.92);
  --text: #0d1f2b;
  --muted: #5b7380;
  --ok: #1f9d6a;
  --recovered: #4f83cc;
  --degraded: #d18b2f;
  --down: #c54343;
  --line: rgba(14, 44, 59, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body, "IBM Plex Sans", "Segoe UI", sans-serif);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(72, 163, 196, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(255, 189, 122, 0.18), transparent 24%),
    linear-gradient(180deg, #0a1a24, #102736 42%, #f0f7f8 42%, #eef4f5 100%);
}

.shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  gap: 20px;
  margin-bottom: 24px;
  padding: 28px;
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(9, 30, 42, 0.94), rgba(18, 53, 69, 0.92));
  color: #eef8fb;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.eyebrow {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #9fd7e4;
}

.hero h1 {
  margin: 10px 0 0;
  font-family: var(--font-display, "Fraunces", Georgia, serif);
  font-size: clamp(2.3rem, 5vw, 4.2rem);
  line-height: 0.95;
}

.lede {
  max-width: 64ch;
  color: rgba(238, 248, 251, 0.84);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff7ef, #ffe4d1);
  color: #6b2b18;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 16px 34px rgba(5, 23, 32, 0.16);
}

.cta.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #eef8fb;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
}

.stat-card {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-card strong {
  display: block;
  font-size: 1.8rem;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr);
  gap: 20px;
}

.panel {
  background: var(--panel);
  border-radius: 24px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(9, 33, 43, 0.08);
}

.map-panel, .signals-panel, .feed-panel { grid-column: 1; }
.donate-panel { grid-column: 1; }
.economy-panel { grid-column: 1; }
.funding-history-panel { grid-column: 1; }
.sidebar { grid-column: 2; grid-row: 1 / span 2; }

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

.panel-head h2 { margin: 0; font-size: 1.15rem; }
.panel-head p { margin: 6px 0 0; color: var(--muted); }
.text-link {
  color: #0f6172;
  font-weight: 700;
  text-decoration: none;
}
.text-link:hover { text-decoration: underline; }

#map {
  height: 520px;
  margin: 16px;
  border-radius: 18px;
  overflow: hidden;
}

.node-list, .event-feed {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.signal-list {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.node-card, .event-card, .signal-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.node-top, .event-top, .signal-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.status-pill {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-ok { background: rgba(31, 157, 106, 0.12); color: var(--ok); }
.status-recovered { background: rgba(79, 131, 204, 0.12); color: var(--recovered); }
.status-degraded { background: rgba(209, 139, 47, 0.14); color: var(--degraded); }
.status-down { background: rgba(197, 67, 67, 0.12); color: var(--down); }

.meta, .event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.empty {
  padding: 20px;
  color: var(--muted);
}

.donate-body {
  padding: 16px 20px 22px;
}

.donate-copy {
  margin: 0;
  max-width: 68ch;
  line-height: 1.65;
}

.crypto-funding,
.secondary-funding {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.funding-topline,
.funding-uri-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.funding-address-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}

.funding-address-row code {
  display: block;
  flex: 1 1 420px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #0f2230;
  color: #eff9fb;
  font-size: 0.96rem;
  overflow-wrap: anywhere;
}

.copy-btn,
.wallet-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(15, 97, 114, 0.18);
  background: #fff;
  color: #0f6172;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.wallet-link:hover,
.copy-btn:hover {
  background: #f1fbfd;
}

#copy-status {
  color: var(--muted);
  font-size: 0.92rem;
}

.donate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.donate-btn {
  min-width: 96px;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #0f7e8f, #12586e);
  color: #f3fbfd;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(9, 33, 43, 0.14);
}

.donate-btn[disabled] {
  cursor: wait;
  opacity: 0.7;
}

.donate-note {
  margin: 16px 0 0;
  color: var(--muted);
}

.donate-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
}

.donate-links a {
  color: #0f6172;
  font-weight: 600;
  text-decoration: none;
}

.donate-links a:hover {
  text-decoration: underline;
}

.economy-grid {
  padding: 16px 20px 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.economy-copy {
  padding: 16px 20px 0;
  color: var(--muted);
  line-height: 1.65;
}

.publisher-table-wrap {
  padding: 16px 20px 22px;
  overflow-x: auto;
}

.publisher-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.publisher-table th,
.publisher-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.publisher-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.publisher-table td strong {
  display: block;
}

.publisher-table td a {
  color: #0f6172;
  text-decoration: none;
}

.publisher-table td a:hover {
  text-decoration: underline;
}

.funding-history-list {
  padding: 16px 20px 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.funding-history-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.funding-history-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.funding-history-top strong {
  font-size: 1.2rem;
}

.funding-history-top span {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-weight: 700;
}

.funding-history-card a {
  color: #0f6172;
  text-decoration: none;
}

.funding-history-card a:hover {
  text-decoration: underline;
}

@media (max-width: 980px) {
  .hero, .layout { grid-template-columns: 1fr; }
  .map-panel, .feed-panel, .donate-panel, .sidebar { grid-column: auto; grid-row: auto; }
  #map { height: 380px; }
  .economy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .funding-history-list { grid-template-columns: 1fr; }
}

.trend-block {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.trend-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
}

.trend-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trend-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  line-height: 1.2;
  border: 1px solid rgba(14, 44, 59, 0.08);
}

.detail-block {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.detail-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
}

.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.group-card,
.profile-row {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.group-card strong,
.profile-row strong {
  font-size: 0.92rem;
}

.group-card span,
.profile-row span {
  color: var(--muted);
  font-size: 0.82rem;
}

.profile-list {
  display: grid;
  gap: 10px;
}

.identity-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.identity-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  line-height: 1.2;
  border: 1px solid rgba(14, 44, 59, 0.08);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
}
