/* Micronews - single stylesheet, no framework, no build step. */

:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-2: #f0f2f5;
  --text: #1b1b1f;
  --muted: #5f6570;
  --line: #dfe3e8;
  --accent: #0067c0;
  --accent-soft: #e5f0fb;
  --danger: #b32d2e;
  --danger-soft: #fdeaea;
  --warn: #9a6100;
  --ok: #107c10;
  --radius: 10px;
  --maxw: 900px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181c;
    --panel: #1e2126;
    --panel-2: #262a31;
    --text: #e8eaed;
    --muted: #9aa1ac;
    --line: #313641;
    --accent: #4ca3ff;
    --accent-soft: #17293d;
    --danger: #ff8a8a;
    --danger-soft: #3a1f21;
    --warn: #ffc95c;
    --ok: #6fd66f;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}

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

/* ---------------------------------------------------------------- chrome */

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 16px;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand {
  display: flex; align-items: center; gap: 9px;
  font-weight: 650; font-size: 16px; color: var(--text);
}
.brand:hover { text-decoration: none; }
.logo {
  width: 16px; height: 16px; flex: none;
  background:
    linear-gradient(#f25022 0 0) 0 0 / 7px 7px no-repeat,
    linear-gradient(#7fba00 0 0) 9px 0 / 7px 7px no-repeat,
    linear-gradient(#00a4ef 0 0) 0 9px / 7px 7px no-repeat,
    linear-gradient(#ffb900 0 0) 9px 9px / 7px 7px no-repeat;
}
.topnav { display: flex; gap: 16px; font-size: 14px; }

main { max-width: var(--maxw); margin: 0 auto; padding: 18px 16px 40px; }

.footer {
  max-width: var(--maxw); margin: 0 auto; padding: 0 16px 30px;
  color: var(--muted); font-size: 12px; display: flex; gap: 6px;
}

/* ---------------------------------------------------------------- search */

.searchbar { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.searchbar input[type=search] {
  flex: 1; min-width: 0; padding: 10px 12px; font-size: 15px;
  color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.searchbar input[type=search]:focus {
  outline: 2px solid var(--accent); outline-offset: -1px;
}
.searchbar button {
  padding: 10px 16px; font-size: 14px; font-weight: 600; cursor: pointer;
  color: #fff; background: var(--accent);
  border: none; border-radius: var(--radius);
}
.clear { font-size: 13px; color: var(--muted); }

.stats {
  display: flex; flex-wrap: wrap; gap: 14px;
  font-size: 13px; color: var(--muted); margin-bottom: 12px;
}
.stats strong { color: var(--text); }

/* ----------------------------------------------------------------- chips */

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip {
  padding: 5px 11px; font-size: 13px; border-radius: 999px;
  color: var(--muted); background: var(--panel);
  border: 1px solid var(--line); white-space: nowrap;
}
.chip:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.on.alert { background: var(--danger); border-color: var(--danger); color: #fff; }
.chip.small { font-size: 12px; padding: 3px 9px; }
.chip .ct { opacity: .6; font-size: 11px; }

.tagbox { margin-bottom: 14px; }
.tagbox summary {
  cursor: pointer; font-size: 13px; color: var(--muted);
  padding: 4px 0; user-select: none;
}

.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px;
  align-items: center; justify-content: space-between;
  padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px;
}
.toolbar-actions { display: flex; gap: 14px; align-items: center; }
.linkbtn {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--accent); font: inherit;
}
.linkbtn:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ----------------------------------------------------------------- items */

.items { list-style: none; margin: 6px 0 0; padding: 0; }

.item {
  padding: 14px 16px; margin-bottom: 10px;
  background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.item.read { opacity: .58; }
.item.action { border-left: 3px solid var(--danger); }

.item-head { display: flex; gap: 10px; align-items: flex-start; }
.item-title {
  flex: 1; font-size: 15.5px; font-weight: 600; line-height: 1.4;
  color: var(--text);
}
.item-title:hover { color: var(--accent); }

.star {
  flex: none; background: none; border: none; cursor: pointer;
  font-size: 17px; line-height: 1; padding: 2px 4px;
  color: var(--line);
}
.star:hover { color: var(--warn); }
.star.on { color: #f0a30a; }

.item-meta {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  margin-top: 5px; font-size: 12.5px; color: var(--muted);
}
.item-meta .src { font-weight: 600; color: var(--muted); }
.rmstatus {
  padding: 1px 7px; border-radius: 999px;
  background: var(--panel-2); font-size: 11.5px;
}

.item-summary {
  margin: 8px 0 0; font-size: 14px; color: var(--muted); line-height: 1.5;
}

.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.tag {
  padding: 2px 8px; font-size: 11.5px; border-radius: 4px;
  color: var(--muted); background: var(--panel-2);
}
.tag:hover { text-decoration: none; color: var(--accent); }
.tag.danger { background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.tag.phase { background: var(--accent-soft); color: var(--accent); }

.empty {
  padding: 30px 16px; text-align: center; color: var(--muted);
  background: var(--panel); border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.pager { display: flex; justify-content: space-between; margin-top: 18px; font-size: 14px; }

/* --------------------------------------------------------------- sources */

h1 { font-size: 22px; margin: 0 0 6px; }

table.sources {
  width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 13.5px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
table.sources th, table.sources td {
  padding: 9px 11px; text-align: left; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.sources th {
  font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); background: var(--panel-2);
}
tr.s-disabled { opacity: .5; }

.dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 7px; background: var(--muted);
}
.dot.ok { background: var(--ok); }
.dot.failing { background: var(--danger); }
.dot.degraded { background: var(--warn); }
.dot.pending { background: var(--muted); }
.dot.disabled { background: var(--line); }
/* Hollow, so "working but contributing nothing" reads differently at a
   glance from the solid amber of a source that is actually erroring. */
.dot.stale {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--warn);
}

/* The cell that says a source is holding nothing. */
.sources td.warn { color: var(--warn); font-weight: 600; }

.err {
  margin-top: 4px; font-size: 12px; color: var(--danger);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.badge {
  display: inline-block; padding: 1px 6px; margin-left: 5px;
  font-size: 11px; border-radius: 4px;
  background: var(--accent-soft); color: var(--accent);
}
.badge.warn { background: var(--danger); color: #fff; }
.live { color: var(--ok); }

code {
  padding: 1px 5px; border-radius: 4px; background: var(--panel-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px;
}

/* ---------------------------------------------------------------- mobile */

@media (max-width: 620px) {
  main { padding: 14px 12px 30px; }
  .topbar { padding: 10px 12px; }
  .topnav { gap: 12px; font-size: 13.5px; }
  .item { padding: 12px 13px; }
  .item-title { font-size: 15px; }
  .stats { gap: 10px; font-size: 12.5px; }
  table.sources { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ------------------------------------------------------- topic filtering */

.tagbox summary strong { color: var(--accent); font-weight: 600; }

.tagfilter {
  width: 100%; max-width: 320px; margin: 8px 0 4px;
  padding: 6px 10px; font-size: 13px;
  color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.tagfilter:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.taggroup { margin: 10px 0 4px; }
.taggroup h3 {
  margin: 0 0 6px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}
.taggroup[hidden] { display: none; }
.chip[hidden] { display: none; }

.tagfilter-empty { font-size: 13px; color: var(--muted); margin: 8px 0 0; }

/* ------------------------------------------------------- roadmap changes */

.chip.on.change { background: var(--warn); border-color: var(--warn); color: #241a00; }

.changelist { list-style: none; margin: 9px 0 0; padding: 0; }

.change {
  display: inline-block; margin: 0 6px 4px 0; padding: 3px 9px;
  font-size: 12.5px; font-weight: 600; border-radius: 5px;
  background: var(--panel-2); color: var(--text);
  border-left: 3px solid var(--muted);
}
.change-delayed        { border-left-color: var(--warn); color: var(--warn); }
.change-cancelled      { border-left-color: var(--danger); color: var(--danger); }
.change-accelerated,
.change-shipped        { border-left-color: var(--ok); color: var(--ok); }
.change-status-changed,
.change-revised        { border-left-color: var(--accent); color: var(--accent); }

/* --------------------------------------------------------- update notice */

.updatebar {
  position: sticky; top: 52px; z-index: 15;
  display: block; margin: 0 0 10px; padding: 8px 14px;
  font-size: 13.5px; font-weight: 600; text-align: center;
  color: #fff; background: var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 1px 6px rgb(0 0 0 / .18);
}
.updatebar:hover { text-decoration: none; filter: brightness(1.08); }
.updatebar[hidden] { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .updatebar { animation: updatebar-in .18s ease-out; }
  @keyframes updatebar-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: none; }
  }
}

/* Folded duplicates: the roadmap ships one entry per surface, so a headline
   can arrive several times. Collapsed by default, every original reachable. */
.dupes { margin: .35rem 0 0; font-size: .85rem; }
.dupes > summary {
  cursor: pointer;
  color: var(--muted);
  padding: .15rem 0;
}
.dupes > summary:hover { color: var(--text); }
.dupes > ul {
  list-style: none;
  margin: .3rem 0 0;
  padding: 0 0 0 .9rem;
  border-left: 2px solid var(--line);
}
.dupes > ul > li { margin: .35rem 0; }
.dupes .item-summary { margin: .2rem 0 0; }

/* --------------------------------------------------------- hidden topics */

.chipset { display: inline-flex; align-items: stretch; }
.chipset[hidden] { display: none; }
.chipset .chip { border-top-right-radius: 0; border-bottom-right-radius: 0; }

.chip-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; padding: 0 7px; margin-left: -1px;
  font-size: 14px; font-weight: 600; line-height: 1;
  color: var(--muted); background: var(--panel);
  border: 1px solid var(--line); border-radius: 0 999px 999px 0;
}
.chip-toggle:hover { text-decoration: none; color: var(--danger); border-color: var(--danger); }
.chip-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.chipset.is-hidden .chip { text-decoration: line-through; opacity: .55; }
.chipset.is-hidden .chip-toggle,
.chipset.is-hidden .chip-toggle:hover { color: var(--accent); border-color: var(--accent); }

.hiddennote { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.hiddennote strong { color: var(--text); font-weight: 600; }
