:root {
  --bg: #eceef1;
  --surface: #f7f8fa;
  --surface-2: #e2e5e9;
  --border: #d8dce1;
  --text: #1d2228;
  --muted: #69727d;
  --read: #8a929c;
  --accent: #2563d8;
  --accent-soft: #dbe6fa;
  --danger: #c43c3c;
  --ok: #2b8a57;
  --shadow: 0 1px 2px rgba(20, 30, 45, .05);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #101317;
  --surface: #181c22;
  --surface-2: #232830;
  --border: #2a3038;
  --text: #e5e8ec;
  --muted: #8f99a5;
  --read: #6b747f;
  --accent: #6d9cff;
  --accent-soft: #1d2a44;
  --danger: #ef6b6b;
  --ok: #4cc38a;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Segoe UI", sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
  min-height: 100vh;
}
a { color: inherit; }
button { font: inherit; color: inherit; }

/* header */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top);
}
.bar {
  max-width: 760px; margin: 0 auto;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px 8px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; letter-spacing: .01em; text-decoration: none; }
.brand img { width: 26px; height: 26px; border-radius: 7px; }
.count {
  font-size: 12px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); border-radius: 999px; padding: 1px 9px;
}
.count:empty { display: none; }
.spacer { flex: 1; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 0;
  background: transparent; display: grid; place-items: center; cursor: pointer;
  color: var(--muted);
}
.icon-btn:active { background: var(--surface-2); }
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn.spin svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.chips {
  max-width: 760px; margin: 0 auto;
  display: flex; gap: 6px; overflow-x: auto; padding: 0 14px 10px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--border); background: var(--surface);
  border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--muted);
  white-space: nowrap; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

/* menu */
.menu {
  position: absolute; right: 12px; top: calc(52px + env(safe-area-inset-top));
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,.14); padding: 6px; min-width: 200px; z-index: 20;
}
.menu[hidden] { display: none; }
.menu button, .menu a {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  padding: 10px 12px; border-radius: 8px; font-size: 14px; text-decoration: none; cursor: pointer;
}
.menu button:active, .menu a:active { background: var(--surface-2); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 6px; }

/* list */
main { max-width: 760px; margin: 0 auto; padding: 10px 12px 24px; }
.notice {
  margin: 8px 2px 12px; padding: 10px 14px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent); font-size: 13px; text-align: center; cursor: pointer;
  border: 0; width: calc(100% - 4px);
}
.notice[hidden] { display: none; }
.list { list-style: none; margin: 0; padding: 0; }
.day {
  font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .04em;
  padding: 14px 6px 6px;
}
.day:first-child { padding-top: 4px; }
.item {
  position: relative;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  margin-bottom: 8px; box-shadow: var(--shadow);
}
.item a {
  display: block; padding: 11px 14px 12px 26px; text-decoration: none;
}
.item a:active { background: var(--surface-2); border-radius: 12px; }
.meta { display: flex; gap: 8px; align-items: baseline; font-size: 12px; color: var(--muted); margin-bottom: 3px; min-width: 0; }
.meta time { flex: none; font-variant-numeric: tabular-nums; }
.site { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title { font-size: 15.5px; line-height: 1.45; font-weight: 600; overflow-wrap: anywhere; }
.dot {
  position: absolute; left: 11px; top: 17px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
}
.item.read .dot { display: none; }
.item.read .title { font-weight: 400; color: var(--read); }
.item.read { background: transparent; box-shadow: none; }

.empty { text-align: center; color: var(--muted); padding: 48px 16px; font-size: 14px; }

/* pagination */
.pager { display: flex; justify-content: center; align-items: center; gap: 6px; margin: 18px 0 8px; flex-wrap: wrap; }
.pager button {
  min-width: 38px; height: 38px; padding: 0 10px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.pager button[aria-current="page"] { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.pager button:disabled { opacity: .35; cursor: default; }
.pager .gap { color: var(--muted); padding: 0 2px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 4px 0 16px; }
.foot a { color: var(--muted); }

/* skeleton */
.sk { height: 66px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); margin-bottom: 8px; opacity: .6; }

/* admin */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.panel h2 { font-size: 15px; margin: 0 0 10px; }
.field { display: block; width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 16px; margin-bottom: 8px; }
.btn { border: 0; border-radius: 10px; padding: 11px 16px; background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; font-size: 15px; }
.btn.ghost { background: var(--surface-2); color: var(--text); }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid var(--border); padding: 7px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.msg { font-size: 13px; margin-top: 8px; min-height: 1em; }
.msg.err { color: var(--danger); }
.msg.ok { color: var(--ok); }
.feed { border-top: 1px solid var(--border); padding: 12px 0; display: flex; gap: 10px; align-items: flex-start; }
.feed:first-of-type { border-top: 0; }
.feed .info { flex: 1; min-width: 0; }
.feed .name { font-weight: 600; }
.feed .url { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.feed .stat { font-size: 12px; color: var(--muted); margin-top: 2px; }
.feed .stat.err { color: var(--danger); }

:root[data-theme="dark"] .btn:not(.ghost):not(.danger) { color: #0b1220; }
