:root {
  --bg: #ffffff;
  --fg: #1a1a1a;
  --fg-dim: #6b6b6b;
  --accent: #000000;
  --border: #d8d8d8;
  --error: #c62828;
  --font: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
}

html[data-theme="dark"] {
  --bg: #0b0d0f;
  --fg: #e8e8e8;
  --fg-dim: #8a8f98;
  --accent: #ffffff;
  --border: #2a2e33;
  --error: #ff6b6b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: var(--fg);
  text-decoration: none;
}
a:hover { color: var(--accent); text-decoration: underline; }

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 20px 40px;
}

/* ---------- boot screen ---------- */
#boot-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  font-family: var(--font);
}
#boot-screen.hidden { display: none; }
#boot-text { font-size: 16px; white-space: pre; }

/* ---------- header ---------- */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 14px;
}
.top-bar-left { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.logo { color: var(--fg); font-weight: bold; }
.counters { color: var(--fg-dim); font-size: 12px; }
.top-bar-right { display: flex; align-items: center; gap: 14px; font-size: 13px; }
#theme-toggle {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
#theme-toggle:hover { border-color: var(--accent); }

.breadcrumbs {
  color: var(--fg-dim);
  font-size: 12px;
  margin-bottom: 14px;
}

/* ---------- feed ---------- */
.feed { display: flex; flex-direction: column; gap: 16px; }
.news-item {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 12px;
  outline: none;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}
.news-item:focus,
.news-item.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.news-line { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.ts { color: var(--fg-dim); font-size: 12px; }
.arrow { color: var(--accent); }
.news-title { font-weight: bold; color: var(--fg); }
.news-title:hover { color: var(--accent); }
.news-text { margin: 0; color: var(--fg); white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.news-title { overflow-wrap: anywhere; word-break: break-word; min-width: 0; }
.news-item.filtered-out { display: none; }
.empty { color: var(--fg-dim); }

.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin: 22px 0;
  font-size: 13px;
}
.pager-current { color: var(--fg-dim); }

.back-link { font-size: 13px; }

/* ---------- footer / cmdline ---------- */
.bottom-bar {
  position: sticky;
  bottom: 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 20px;
}
.cmdline { display: flex; align-items: center; gap: 8px; }
.prompt { color: var(--accent); }
#cmd-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg);
  font-family: var(--font);
  font-size: 13px;
}
#cmd-input::placeholder { color: var(--fg-dim); }
.cursor {
  color: var(--accent);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- admin ---------- */
.admin-wrap { max-width: 640px; }
.admin-title { color: var(--accent); }
.admin-header { display: flex; justify-content: space-between; align-items: baseline; }
.logout-link { font-size: 13px; }
.admin-section { margin-top: 24px; }
.admin-section h2 { font-size: 15px; color: var(--fg-dim); border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.admin-form, .admin-edit-form { display: flex; flex-direction: column; gap: 10px; }
.admin-form label, .admin-edit-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--fg-dim); }
input[type="text"], input[type="password"], textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--fg);
  font-family: var(--font);
  padding: 8px;
  border-radius: 3px;
  font-size: 13px;
}
textarea { resize: vertical; }
button {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 6px 14px;
  border-radius: 3px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  width: fit-content;
}
button:hover { background: var(--accent); color: var(--bg); }
button.danger { border-color: var(--error); color: var(--error); }
button.danger:hover { background: var(--error); color: var(--bg); }

.admin-search { display: flex; gap: 8px; align-items: center; margin: 10px 0 14px; }
.admin-list { display: flex; flex-direction: column; gap: 14px; }
.admin-item {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.admin-item-title { font-weight: bold; }
.admin-item-meta { font-size: 11px; color: var(--fg-dim); }
.admin-item-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.error { color: var(--error); }
