:root {
  --bg: #f6f4f1; --card: #fff; --text: #1d1b26; --muted: #6b6775; --line: #e4e0da;
  --accent: #b86b0f; --accent-text: #fff; --error: #b3261e; --ok: #2e7d32;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1b26; --card: #262433; --text: #ece9f2; --muted: #a39fb0; --line: #353244;
    --accent: #f2b35b; --accent-text: #1d1b26; --error: #f28b82; --ok: #81c995;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
a { color: var(--accent); }
main { max-width: 44rem; margin: 0 auto; padding: 0 12px 48px; }
.muted { color: var(--muted); }

.top {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top)); margin-top: calc(-1 * env(safe-area-inset-top));
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.top nav { display: flex; align-items: center; gap: 16px; }
.top nav a { color: var(--muted); text-decoration: none; font-weight: 600; }
.top nav a.on { color: var(--text); }

.tabs { display: flex; gap: 8px; margin: 12px 0; }
.tabs a {
  padding: 6px 14px; border-radius: 999px; text-decoration: none; color: var(--muted);
  border: 1px solid var(--line); font-weight: 600; font-size: .9rem;
}
.tabs a.on { background: var(--text); color: var(--bg); border-color: var(--text); }

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.card .hit { display: flex; gap: 12px; padding: 12px 14px; color: inherit; text-decoration: none; }
.card .body { flex: 1; min-width: 0; }
.card .meta { margin: 0 0 4px; font-size: .8rem; color: var(--muted); }
.card .source { font-weight: 600; }
.card h2 { margin: 0; font-size: 1.02rem; line-height: 1.3; overflow-wrap: anywhere; }
.card .desc {
  margin: 6px 0 0; font-size: .9rem; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card .thumb {
  flex: none; width: 88px; height: 88px; object-fit: cover; border-radius: 8px; background: var(--line);
}
.card.read h2 { color: var(--muted); font-weight: 500; }
.card.unread .meta::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); margin-right: 6px; vertical-align: 1px;
}
.readers { display: flex; padding: 0 14px 10px; }
.readers .avatar + .avatar { margin-left: -6px; }

.avatar {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: hsl(var(--hue) 55% 45%); color: #fff; font-weight: 700; font-size: .9rem;
}
.avatar.small { width: 24px; height: 24px; font-size: .7rem; border: 2px solid var(--card); }

.more, button {
  display: block; width: 100%; margin: 16px 0 0; padding: 12px; border: 0; border-radius: 10px;
  background: var(--accent); color: var(--accent-text); font: inherit; font-weight: 700;
  text-align: center; text-decoration: none; cursor: pointer;
}
button.secondary { background: transparent; color: var(--text); border: 1px solid var(--line); }
.empty { text-align: center; color: var(--muted); margin-top: 48px; }

.login, .panel { max-width: 24rem; margin: 10vh auto 0; display: grid; gap: 14px; }
.panel { margin-top: 24px; }
.login h1, .panel h1 { margin: 0; }
.login p, .panel p { margin: 0; }
label { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; }
input:not([type=checkbox]) {
  font: inherit; padding: 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--text);
}
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; font-size: 1rem; }
label.check input { width: 20px; height: 20px; margin-top: 2px; }
.error { color: var(--error); font-weight: 600; }
.ok { color: var(--ok); font-weight: 600; }
.card .meta time { white-space: nowrap; }
