:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --border: #2d3a4d;
  --text: #e6edf3;
  --muted: #8b9cb3;
  --accent: #58a6ff;
  --agent: #a371f7;
  --ok: #3fb950;
  --danger: #f85149;
  font-family: "SF Pro Text", "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: 4rem;
}

a {
  color: var(--accent);
}

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

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.logo {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

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

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

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem;
}

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

.card h1,
.card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.82rem;
}

.hint {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 1rem;
}

.hidden {
  display: none !important;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: 400px;
}

label {
  font-size: 0.85rem;
  color: var(--muted);
}

input,
textarea,
select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0.5rem 0.65rem;
  font: inherit;
  width: 100%;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

.btn {
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 6px;
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
}

.btn.primary {
  background: var(--accent);
  border-color: transparent;
  color: #0f1419;
  font-weight: 600;
}

.btn.ghost {
  background: transparent;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.err {
  color: var(--danger);
  font-size: 0.88rem;
  margin-top: 0.5rem;
}

.space-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.space-list li {
  border-bottom: 1px solid var(--border);
}

.space-list a {
  display: block;
  padding: 0.85rem 0;
  text-decoration: none;
  color: var(--text);
}

.space-list a:hover {
  color: var(--accent);
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #212d3f;
  color: var(--muted);
  margin-right: 0.35rem;
}

.badge.summary {
  background: #23863633;
  color: var(--ok);
}

.badge.action_item {
  background: #a371f733;
  color: var(--agent);
}

.badge.machine {
  border: 1px solid var(--agent);
  color: var(--agent);
}

.post-item {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.post-item:last-child {
  border-bottom: none;
}

.post-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.post-title {
  font-weight: 600;
  margin: 0 0 0.35rem;
}

.thread {
  margin-top: 1rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--border);
}

.cmt {
  margin-bottom: 0.85rem;
  font-size: 0.92rem;
}

.cmt-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
}

.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.65rem 1.2rem;
  border-radius: 8px;
  font-size: 0.9rem;
  z-index: 100;
  max-width: 90vw;
}

.toolbar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

@media (max-width: 480px) {
  .top .nav .link {
    display: none;
  }
}
