:root {
  color-scheme: dark;
  --bg: #0f1216;
  --card: #171b21;
  --border: #262c34;
  --text: #e4e7eb;
  --muted: #8a94a3;
  --accent: #5ec2a3;
  --failed: #ef6461;
  --failed-bg: #241615;
}

* { box-sizing: border-box; }

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

header {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

header h1 {
  font-size: 1.1rem;
  margin: 0;
}

header h1 a {
  color: var(--text);
  text-decoration: none;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent);
}

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

.add-page {
  max-width: 560px;
  margin: 4rem auto 0;
  padding: 0 1.25rem;
}

.add-form {
  display: flex;
  gap: 0.5rem;
}

.add-form input[type="url"] {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 1rem;
}

.add-form button {
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #0f1216;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
}

.add-form button:hover {
  opacity: 0.9;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.9rem;
}

.card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.card h2 a {
  color: var(--text);
  text-decoration: none;
}

.card h2 a:hover {
  color: var(--accent);
}

.meta {
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 0.5rem;
}

.summary {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text);
}

.tags {
  margin-top: 0.6rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.tag {
  background: #1c2129;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.75rem;
}

.badge-failed {
  color: var(--failed);
  background: var(--failed-bg);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.75rem;
}

.actions {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.actions form {
  display: inline;
}

.actions button, .actions a.button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: none;
}

.actions button:hover, .actions a.button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.key-points {
  margin: 0.75rem 0;
  padding-left: 1.1rem;
}

.key-points li {
  margin-bottom: 0.3rem;
  font-size: 0.92rem;
}

.full-text {
  margin-top: 1rem;
  white-space: pre-wrap;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
}

.empty {
  color: var(--muted);
  text-align: center;
  margin-top: 3rem;
}
