:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #d62976;
  --card-bg: #f9fafb;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111318;
    --fg: #e6e6e6;
    --muted: #9aa0ab;
    --border: #2a2d34;
    --card-bg: #1a1d24;
  }
}

* { box-sizing: border-box; }

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

.muted { color: var(--muted); font-size: 0.9em; }
.error { color: #dc2626; }

.center-page {
  max-width: 480px;
  margin: 15vh auto;
  text-align: center;
  padding: 0 1rem;
}

.button {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
}

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

.link { color: var(--muted); text-decoration: none; }
.link:hover { text-decoration: underline; }

.topbar-actions { display: flex; align-items: center; gap: 1rem; }

.button-small {
  font: inherit;
  cursor: pointer;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--fg);
}
.button-small:hover { border-color: var(--accent); color: var(--accent); }

main { padding: 1.5rem; }

.flash {
  background: var(--card-bg);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.sync-status { margin-bottom: 1rem; }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
}
.empty-state .button { cursor: pointer; border: none; font-size: 1rem; }
.empty-state p.muted { max-width: 480px; margin: 1rem auto 0; }

.summary-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  min-width: 140px;
}

.card-label { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.25rem; }
.card-value { font-size: 1.4rem; font-weight: 700; }
.card-value a { color: inherit; text-decoration: none; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.sort-link { color: var(--fg); text-decoration: none; font-weight: 600; }
.sort-link:hover { color: var(--accent); }

.post-cell { display: flex; align-items: center; gap: 0.5rem; max-width: 260px; }
.post-cell a { color: var(--fg); text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }

.thumb {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}
