:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #1f2d3d;
  --muted: #6b7a8c;
  --line: #e3e8ee;
  --red: #ec3750;
  --green: #33d6a6;
  --amber: #f1c40f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.4rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.brand { font-weight: 700; color: var(--ink); text-decoration: none; }
.whoami { color: var(--muted); margin-right: 0.75rem; }

main { max-width: 900px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }

.hero { text-align: center; padding: 4rem 1rem; }
.hero h1 { font-size: 1.8rem; }
.hero p { color: var(--muted); max-width: 34rem; margin: 0.75rem auto 1.5rem; }

.page-head { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; margin: 1rem 0; }
.page-head h1 { font-size: 1.4rem; margin: 0; }
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.button {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
}
.button.primary { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.button.disabled { opacity: 0.5; cursor: not-allowed; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
}
.card.empty { text-align: center; color: var(--muted); }
.error-card { max-width: 34rem; margin: 3rem auto; text-align: center; }

.banner { border-radius: 10px; padding: 0.8rem 1rem; margin: 0.8rem 0; }
.banner.danger { background: #fdecef; border: 1px solid #f6b8c3; color: #8e1f31; }
.banner.slim { font-size: 0.9rem; padding: 0.5rem 0.75rem; }

.account-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.platform-tag {
  text-transform: uppercase;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: #fdecef;
  color: var(--red);
  margin-right: 0.4rem;
}

.status { font-size: 0.9rem; font-weight: 600; }
.status-active { color: #1a9e77; }
.status-needs_reauth { color: var(--red); }
.status-disconnected { color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.6rem 1rem; margin: 0.9rem 0; }
.stats dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.stats dd { margin: 0.1rem 0 0; font-size: 0.95rem; }

.events summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; }
.events ul { margin: 0.5rem 0 0; padding-left: 1.2rem; font-size: 0.85rem; }

.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em; }

.linklike {
  background: none;
  border: none;
  padding: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: underline;
}
.linklike.danger { color: var(--red); }
