:root {
  --bg: #f6f7f9; --card: #fff; --text: #14161a; --muted: #6b7280; --line: #e5e7eb;
  --accent: #2563eb; --red: #d92d20; --red-bg: #fde8e7; --amber: #b54708; --amber-bg: #fef0c7; --new: #16a34a; --chip: #eef0f3;
  --world: #2563eb; --ukraine: #a16207; --ai: #7c3aed; --tech: #0f766e; --quakes: #c2410c; --place: #0369a1; --theme: #be185d;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1115; --card: #171a21; --text: #e8eaed; --muted: #9aa1ab; --line: #262a33;
    --accent: #6ea8fe; --red: #ff6b61; --red-bg: #3a1714; --amber: #fdb022; --amber-bg: #3a2a0c; --new: #4ade80; --chip: #222631;
    --world: #6ea8fe; --ukraine: #facc15; --ai: #a78bfa; --tech: #2dd4bf; --quakes: #fb923c; --place: #7dd3fc; --theme: #f472b6; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; text-decoration: none; }
.sticky { position: sticky; top: 0; z-index: 2; background: var(--bg); }
.top { display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); background: var(--bg); }
.brand { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--new); }
.dot.off { background: var(--red); }
.status { color: var(--muted); font-size: 13px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 16px 10px;
  background: var(--bg); scrollbar-width: none; border-bottom: 1px solid var(--line); }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; border: 0; border-radius: 999px; padding: 7px 13px; background: var(--chip); color: var(--text);
  font: inherit; font-size: 14px; cursor: pointer; }
.tabs button.on { background: var(--text); color: var(--bg); }
.tabs .count { margin-left: 5px; font-size: 12px; color: var(--red); font-weight: 700; }
.tabs button.on .count { color: inherit; }
.list { max-width: 760px; margin: 0 auto; padding: 10px 16px 24px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
/* Story type color: a stripe down the left edge and the first tag. Red edge for the most important. */
.card { --c: var(--muted); box-shadow: inset 3px 0 0 var(--c); }
.c-world { --c: var(--world); } .c-ukraine { --c: var(--ukraine); } .c-ai { --c: var(--ai); }
.c-tech { --c: var(--tech); } .c-quakes { --c: var(--quakes); }
.card.urgent { border-color: var(--red); box-shadow: inset 4px 0 0 var(--red); }
.card.fresh .title::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--new); margin-right: 7px; vertical-align: 2px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.badge { font-size: 11px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; padding: 2px 7px;
  border-radius: 5px; background: var(--chip); color: var(--muted); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.upd { color: var(--accent); }
.title { font-weight: 600; font-size: 16px; display: block; }
.row { display: flex; gap: 12px; align-items: flex-start; }
.body { flex: 1; min-width: 0; }
/* One picture size everywhere: 4:3, cropped to fill. Layers: letter, then logo, then picture on top. */
.thumb { flex: none; width: 128px; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--chip);
  display: grid; place-items: center; border: 1px solid var(--line); }
.thumb > * { grid-area: 1 / 1; }
.thumb b { font-size: 22px; font-weight: 700; color: var(--muted); }
.thumb .logo { width: 40px; height: 40px; border-radius: 8px; background: var(--card); object-fit: contain; }
.thumb .pic { width: 100%; height: 100%; object-fit: cover; place-self: stretch; background: var(--chip); }
.ico { width: 16px; height: 16px; border-radius: 4px; vertical-align: -3px; margin-right: 6px; object-fit: contain; background: #fff; }
.outlet { display: inline-flex; align-items: center; }
.icos { display: inline-flex; margin-right: 6px; }
.icos .ico { margin-right: -4px; border-radius: 50%; box-shadow: 0 0 0 2px var(--card); }
.icos .ico:last-child { margin-right: 0; }
@media (max-width: 600px) {
  .thumb { width: 96px; }
  .thumb .logo { width: 32px; height: 32px; }
}
.title:hover { color: var(--accent); }
.latest { margin-top: 4px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary { margin-top: 4px; font-size: 14px; color: var(--muted); overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.meta { margin-top: 8px; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.meta button { border: 0; background: none; color: var(--accent); font: inherit; padding: 0; cursor: pointer; }
.srcs { margin: 8px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.srcs li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.srcs li:last-child { border-bottom: 0; }
.srcs b { font-weight: 600; margin-right: 6px; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }
.more { text-align: center; padding-bottom: 32px; }
.more button { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 10px;
  padding: 10px 18px; font: inherit; cursor: pointer; }
.login { max-width: 340px; margin: 18vh auto 0; padding: 0 16px; display: flex; flex-direction: column; gap: 12px; }
.login input, .login button { font: inherit; font-size: 16px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); }
.login button { background: var(--text); color: var(--bg); border: 0; cursor: pointer; font-weight: 600; }
.login .err { color: var(--red); min-height: 1.4em; margin: 0; font-size: 14px; }

[hidden] { display: none !important; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 8px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.seg { display: inline-flex; background: var(--chip); border-radius: 999px; padding: 2px; }
.seg button { border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; padding: 5px 11px;
  border-radius: 999px; cursor: pointer; }
.seg button.on { background: var(--card); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.tagfilter { border: 0; border-radius: 999px; padding: 6px 11px; background: var(--accent); color: #fff; font: inherit;
  font-size: 13px; font-weight: 600; cursor: pointer; }
.score { min-width: 24px; height: 22px; padding: 0 6px; border-radius: 6px; display: inline-flex; align-items: center;
  justify-content: center; font-size: 13px; font-weight: 800; }
.s-hi { background: var(--red); color: #fff; }
.s-mid { background: var(--amber-bg); color: var(--amber); }
.s-low { background: var(--chip); color: var(--accent); }
.s-min { background: var(--chip); color: var(--muted); }
.tag { border: 0; font: inherit; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px;
  background: var(--chip); color: var(--muted); cursor: pointer; }
.tag { --tc: var(--muted); background: color-mix(in srgb, var(--tc) 14%, transparent); color: var(--tc); }
.tag.t-cat { --tc: var(--c); }
.tag.t-co { --tc: var(--ai); } .tag.t-place { --tc: var(--place); } .tag.t-theme { --tc: var(--theme); }
.tag.t-break { background: var(--red); color: #fff; } .tag.t-model { background: var(--ai); color: #fff; }
.tag:hover { filter: brightness(1.15); }
.tag.on { box-shadow: 0 0 0 2px var(--tc); }
.tag.t-break.on, .tag.t-model.on { box-shadow: 0 0 0 2px var(--text); }
.badges { align-items: center; }
.meta .act { margin-left: auto; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; color: var(--muted);
  font-size: 13px; }
.meta .act:hover { color: var(--text); }
.card.leaving { opacity: .35; transition: opacity .15s; }
.panel { margin-bottom: 26px; }
.panel h2 { font-size: 18px; margin: 8px 0 6px; }
.panel h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 18px 0 4px; }
.muted { color: var(--muted); font-weight: 400; }
.bad { color: var(--red); font-weight: 600; }
.srclist, .plain { list-style: none; margin: 0; padding: 0; }
.src { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.sdot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--new); margin-top: 7px; }
.sdot.bad { background: var(--red); }
.sbody { min-width: 0; }
.sname { font-weight: 600; }
.skind { font-weight: 400; font-size: 12px; color: var(--muted); margin-left: 4px; }
.surl { display: block; font-size: 12px; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.smeta { font-size: 12px; color: var(--muted); }
.serr { font-size: 12px; color: var(--red); word-break: break-word; }
.plain li { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
/* Phone alerts panel */
.steps { padding-left: 20px; margin: 8px 0; } .steps li { margin: 4px 0; }
.steps a { color: var(--accent); font-weight: 600; }
.steps code, .panel code { background: var(--chip); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.akey { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.akey input { flex: 1 1 220px; min-width: 0; font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--text); }
.abtn, .akey button { display: inline-block; border: 0; border-radius: 10px; padding: 10px 14px; background: var(--text);
  color: var(--bg); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.alink { border: 0; background: none; color: var(--muted); font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }
.arow { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--chip); margin: 4px 0 8px; }
.seg button { border: 0; border-radius: 999px; padding: 6px 12px; background: none; color: var(--text); font: inherit; cursor: pointer; }
.seg button.on { background: var(--text); color: var(--bg); }
.amsg { font-weight: 600; } .small { font-size: 13px; }
