:root {
  --bg: #f8f7f3;
  --ink: #1a1a1a;
  --muted: #666;
  --accent: #b8470b;
  --accent-hover: #9c3f0a;
  --rule: #e0ddd6;
  --error-bg: #fef2e6;
  --error-ink: #8a3608;
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

header {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
  position: relative;
}

.signout-btn {
  position: absolute;
  top: 0;
  right: 0;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--rule);
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
}

.signout-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

h1 {
  font-size: 1.875rem;
  line-height: 1.2;
  margin: 0;
  font-weight: 600;
}

.controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary:disabled {
  background: #c9c9c9;
  cursor: wait;
}

.status {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}

.digest-section {
  margin-top: 1.75rem;
}

.digest-section h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 0.75rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.4rem;
}

.top3 h2 {
  color: var(--ink);
  font-size: 0.95rem;
}

.top3-list {
  padding-left: 1.25rem;
  margin: 0;
}

.top3-item {
  margin-bottom: 1.25rem;
}

.theme-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.theme-card {
  border-left: 2px solid var(--rule);
  padding: 0.1rem 0 0.1rem 0.85rem;
}

.theme-label {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  line-height: 1.3;
}

.theme-summary {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink);
}

.theme-sources {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--muted);
}

.theme-sources li {
  margin-bottom: 0.2rem;
}

.theme-sources a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}

.theme-sources a:hover {
  border-bottom-color: var(--accent);
}

.digest-list {
  padding-left: 1.25rem;
  line-height: 1.55;
  margin: 0;
}

.digest-list li {
  margin-bottom: 0.5rem;
}

.digest-list a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}

.digest-list a:hover {
  border-bottom-color: var(--accent);
}

.item-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.empty-state {
  margin-top: 2rem;
  padding: 1rem;
  background: var(--bg);
  border: 1px dashed var(--rule);
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.degrade-notice {
  margin-top: 1rem;
  padding: 0.65rem 0.9rem;
  background: var(--error-bg);
  border-left: 3px solid var(--accent);
  font-size: 0.85rem;
  color: var(--error-ink);
}

.errors {
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--error-bg);
  border-left: 3px solid var(--accent);
  font-size: 0.85rem;
  color: var(--error-ink);
}

.errors ul {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}
