:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #17212b;
  --muted: #66707a;
  --border: #d9e1e8;
  --accent: #0f766e;
  --important: #0f766e;
  --later: #c2801f;
  --known: #2563eb;
  --irrelevant: #6b7280;
  --shadow: 0 10px 30px rgba(23, 33, 43, 0.08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px;
}
.topbar {
  padding: 12px 4px 16px;
}
.import-panel {
  background: rgba(255,255,255,0.78);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 14px;
}
.import-label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}
#newsletter-file {
  display: block;
  width: 100%;
  margin-bottom: 8px;
}
.eyebrow, .meta, .summary, .score, .empty, .detail-empty {
  color: var(--muted);
}
h1, h2, h3, p { margin-top: 0; }
.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 12px;
}
.filter {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 10px 14px;
  white-space: nowrap;
}
.filter.is-active {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}
.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.feed {
  display: grid;
  gap: 14px;
}
.card, .detail-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.card {
  padding: 16px;
}
.card.is-selected {
  border-color: var(--accent);
}
.card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 14px;
}
.card h3 {
  font-size: 1.08rem;
  line-height: 1.35;
  margin-bottom: 10px;
}
.snippets {
  padding-left: 18px;
  margin: 0 0 12px;
}
.snippets li { margin-bottom: 8px; }
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.tag {
  background: #eef2f6;
  color: #41505e;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}
.actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.action {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
  font-weight: 600;
}
.action[data-rating="important"] { color: var(--important); }
.action[data-rating="later"] { color: var(--later); }
.action[data-rating="known"] { color: var(--known); }
.action[data-rating="irrelevant"] { color: var(--irrelevant); }
.action.is-active {
  border-color: currentColor;
  background: #f8fafc;
}
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.card a, .detail-card a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.detail-card {
  padding: 18px;
  position: sticky;
  top: 16px;
}
.detail-card.hidden, .hidden { display: none; }
.detail-empty {
  padding: 18px;
  background: rgba(255,255,255,0.7);
  border: 1px dashed var(--border);
  border-radius: 18px;
}
.empty {
  padding: 22px;
  text-align: center;
  background: #fff;
  border-radius: 18px;
  border: 1px dashed var(--border);
}
@media (min-width: 960px) {
  .layout {
    grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.9fr);
    align-items: start;
  }
  .actions {
    grid-template-columns: repeat(4, 1fr);
  }
}
