:root {
  color-scheme: dark;
  --bg: #0f1620;
  --card: #182233;
  --border: #263349;
  --text: #e8edf5;
  --muted: #8fa0b8;
  --accent: #2a8ad9;
}

* { box-sizing: border-box; }

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

#login-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
}

#login-view h1 { margin: 0 0 8px; font-size: 22px; }
#login-view p { color: var(--muted); margin: 0 0 16px; max-width: 320px; }

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

header .tabs { display: flex; gap: 8px; }

header button.tab {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 15px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

header button.tab.active { color: var(--text); background: var(--card); }

header .logout {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}

main { max-width: 640px; margin: 0 auto; padding: 12px 16px 80px; }

.hidden { display: none !important; }

.post-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
}

.post-card .meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.post-card .post-image {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 8px;
}

.post-card .text {
  white-space: pre-wrap;
  font-size: 15px;
  line-height: 1.4;
  margin-bottom: 8px;
}

.post-card a.open-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
}

#load-more {
  width: 100%;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  cursor: pointer;
  margin-top: 8px;
}

.channel-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 8px;
}

.channel-row .remove {
  background: none;
  border: none;
  color: #e06868;
  cursor: pointer;
  font-size: 14px;
}

#add-channel-form {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

#add-channel-form input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 15px;
}

#add-channel-form button {
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: white;
  font-size: 15px;
  cursor: pointer;
}

.empty-state { color: var(--muted); text-align: center; padding: 40px 12px; }
