/* Watchtower: dark, plain, mostly links. All colors are the variables below. */
:root {
  --bg: #141414;
  --panel: #1a1a1a;
  --text: #a9a69c;
  --dim: #6f6d66;
  --line: #262626;
  --link: #8aa4b8;
  --link-hover: #b3c6d4;
  --visited: #8a7f99;
  --hot: #b59a5c;
  --down: #b36b62;
  --focus: #8aa4b8;
  --sans: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* Anything clickable that is not a headline looks like a link too. */
.btn, .tabs button, .chip, .ic, .link, .notice button, .toast button {
  border: 0; background: none; padding: 0; height: auto; width: auto; border-radius: 0;
  color: var(--link); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.btn:hover, .tabs button:hover, .chip:hover, .ic:hover, .link:hover, .notice button:hover { color: var(--link-hover); }
.btn[disabled] { opacity: .5; cursor: progress; }

/* header */
.top { border-bottom: 1px solid var(--line); background: var(--bg); }
.top-inner { max-width: 760px; margin: 0 auto; padding: 14px 16px 0; display: flex; align-items: baseline; gap: 18px; }
.top-inner.sub { padding: 10px 16px 12px; gap: 18px; flex-wrap: wrap; }
.brand { color: var(--text); text-decoration: none; font-weight: 400; font-size: 1rem; }
.brand svg { display: none; }
.search { flex: 1; min-width: 0; }
.search input { width: 100%; height: 34px; padding: 0 2px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--text); font: inherit; font-size: 0.95rem; }
.search input:focus { border-bottom-color: var(--link); outline: none; }
.search input::placeholder { color: var(--dim); }

.tabs { display: flex; gap: 16px; }
.tabs button { font-size: 0.95rem; }
.tabs button[aria-selected="true"] { color: var(--text); text-decoration: none; font-weight: 400; }
.count { color: var(--dim); font-weight: 400; }

.sources { display: flex; gap: 14px; flex-wrap: wrap; }
.chip { font-size: 0.85rem; color: var(--text); text-decoration: none; }
.chip:hover { color: var(--link-hover); text-decoration: underline; }
.chip[aria-pressed="false"] { color: var(--dim); text-decoration: line-through; }
.chip.down { color: var(--down); text-decoration: underline; }

/* content */
main { max-width: 760px; margin: 0 auto; padding: 4px 16px 72px; }
.notice { margin: 14px 0 0; padding: 0 0 0 10px; border-left: 2px solid var(--down); color: var(--down); font-size: 0.9rem; }
.notice button { color: var(--down); margin-left: 8px; }
.notice button:disabled { opacity: 0.55; cursor: default; text-decoration: none; }
.meta { margin: 16px 0 6px; font-size: 0.8rem; color: var(--dim); min-height: 1.2em; }
.list { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: 5.6rem minmax(0, 1fr); column-gap: 14px; padding: 9px 0; }
.src { display: flex; flex-direction: column; font-size: 0.78rem; line-height: 1.35; padding-top: 3px; color: var(--dim); }
.src-name { color: var(--dim); font-weight: 400; }
.body { min-width: 0; }
.hl { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; font-size: 1rem; line-height: 1.4; font-weight: 400; overflow-wrap: anywhere; }
.hl:visited { color: var(--visited); }
.hl:hover { color: var(--link-hover); text-decoration-thickness: 2px; }
.why { margin: 2px 0 0; font-size: 0.78rem; color: var(--hot); }
.acts { grid-column: 2; display: flex; gap: 14px; margin-top: 2px; }
.ic { font-size: 0.78rem; color: var(--dim); text-decoration: none; padding: 2px 0; }
.ic:hover { color: var(--text); text-decoration: underline; }
.ic svg { display: none; }
.ic.up::after { content: "more"; }
.ic.down::after { content: "less"; }
.ic.save::after { content: "save"; }
.ic.x::after { content: "remove"; }
.ic[aria-pressed="true"] { color: var(--hot); text-decoration: underline; }
.ic.up[aria-pressed="true"]::after { content: "more \2713"; }
.ic.down[aria-pressed="true"]::after { content: "less \2713"; }
.ic.save[aria-pressed="true"]::after { content: "saved"; }
.empty { margin: 48px 0; color: var(--dim); }

/* toast */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; align-items: baseline; gap: 14px; max-width: calc(100% - 32px); padding: 9px 14px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 0.88rem; z-index: 20; }

/* topics sheet */
dialog { border: 0; border-left: 1px solid var(--line); padding: 0; background: var(--panel); color: var(--text); width: min(420px, 100vw); max-height: 100dvh; height: 100dvh; margin: 0 0 0 auto; }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
.sheet { padding: 18px 20px 32px; display: flex; flex-direction: column; gap: 24px; }
.sheet-head { display: flex; align-items: baseline; justify-content: space-between; }
.sheet h2 { margin: 0; font-size: 1.2rem; }
.sheet h3 { margin: 0 0 8px; font-size: 0.95rem; color: var(--dim); font-weight: 600; }
.follow-form { display: flex; gap: 14px; align-items: baseline; }
.follow-form input { flex: 1; min-width: 0; height: 34px; padding: 0 2px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--text); font: inherit; font-size: 0.95rem; }
.follow-form input:focus { border-bottom-color: var(--link); outline: none; }
.topic-list { list-style: none; margin: 0; padding: 0; }
.topic { display: flex; align-items: baseline; gap: 12px; padding: 6px 0; }
.topic-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.topic-sub { display: block; font-size: 0.78rem; color: var(--dim); }
.score { min-width: 2em; text-align: center; font-variant-numeric: tabular-nums; font-size: 0.85rem; color: var(--dim); }
.hint { margin: 0; font-size: 0.85rem; color: var(--dim); }
.link { font-size: 0.85rem; padding: 6px 0; }
.link.danger { color: var(--down); }

@media (max-width: 620px) {
  .top-inner { padding-left: 12px; padding-right: 12px; }
  .row { grid-template-columns: minmax(0, 1fr); }
  .src { flex-direction: row; gap: 8px; padding: 0 0 2px; }
  .acts { grid-column: 1; }
}
/* Wide screens: two headline columns, filled left to right across each row.
   Narrow screens keep the single column above, in the same order. */
@media (min-width: 900px) {
  .top-inner, main { max-width: 1160px; }
  .list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; align-items: start; }
  .list > .group { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }

/* search extras */
.meta-row { display: flex; align-items: baseline; gap: 4px 16px; flex-wrap: wrap; }
.meta-row .meta { margin-right: 0; }
#follow-search { font-size: 0.82rem; padding: 0; margin-top: 12px; }
#follow-search[aria-pressed="true"] { color: var(--hot); text-decoration: none; }
.group { padding: 16px 0 6px; border-top: 1px solid var(--line); margin-top: 8px; color: var(--dim); font-size: 0.82rem; }
.search input::-webkit-search-cancel-button { filter: grayscale(1) opacity(.45); }

/* learned topics: which votes taught each one */
.from { margin-top: 2px; font-size: 0.78rem; color: var(--dim); }
.from summary { cursor: pointer; color: var(--dim); }
.from summary:hover { color: var(--text); }
.from ul { margin: 4px 0 2px; padding-left: 14px; }
.from li { margin: 2px 0; overflow-wrap: anywhere; }
.from q { color: var(--text); }
.legacy { margin-top: 14px; display: grid; gap: 4px; justify-items: start; }

/* navigation row: tabs on the left, Report in the middle, sources and Refresh on the right */
.top-inner.sub { display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; }
.sub-right { justify-self: end; display: flex; gap: 18px; align-items: baseline; flex-wrap: wrap; justify-content: flex-end; }
/* Report looks like the view tabs: a link when you're elsewhere, plain text when you're on it */
.report-link { justify-self: center; font-size: 0.95rem; color: var(--link); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.report-link:hover { color: var(--link-hover); }
.report-link[aria-current="page"] { color: var(--text); text-decoration: none; }
@media (max-width: 620px) {
  .top-inner.sub { grid-template-columns: 1fr auto; row-gap: 10px; }
  .report-link { justify-self: end; }
  .sub-right { grid-column: 1 / -1; justify-self: stretch; justify-content: space-between; }
}

/* ---- 8-bit article preview: a pixel thought bubble ---- */
:root { --bub-bg: #f2e8cf; --bub-ink: #1b1914; --bub-dim: #5f584a; --bub-link: #1d4f8c; --bub-art: #cfe2bd; --bub-exc: #f0d58f; --bub-hl: #ebbcb2; }
.bubble { position: absolute; z-index: 30; width: min(440px, calc(100vw - 24px)); padding: 12px 16px 14px; background: var(--bub-bg); color: var(--bub-ink);
  font: 0.86rem/1.5 var(--sans); image-rendering: pixelated; outline: none;
  box-shadow: 0 -4px 0 0 var(--bub-ink), 0 4px 0 0 var(--bub-ink), -4px 0 0 0 var(--bub-ink), 4px 0 0 0 var(--bub-ink), 8px 8px 0 0 rgba(0, 0, 0, .55);
  animation: bubble-pop .2s steps(3, end) both; }
.bubble:focus-visible { box-shadow: 0 -4px 0 0 var(--focus), 0 4px 0 0 var(--focus), -4px 0 0 0 var(--focus), 4px 0 0 0 var(--focus), 8px 8px 0 0 rgba(0, 0, 0, .55); }
@keyframes bubble-pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.bubble-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.bubble-grip { display: none; }
.bubble-pub { flex: 1; min-width: 0; font-size: 0.72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--bub-dim); overflow-wrap: anywhere; }
.bubble-x { flex: none; width: 26px; height: 26px; border: 0; background: var(--bub-ink); color: var(--bub-bg); font: 700 1rem/1 var(--sans); cursor: pointer;
  box-shadow: 0 -2px 0 0 var(--bub-ink), 0 2px 0 0 var(--bub-ink), -2px 0 0 0 var(--bub-ink), 2px 0 0 0 var(--bub-ink); }
.bubble-x:hover { background: #3a362c; }
.bubble-title { margin: 0 0 8px; font-weight: 700; overflow-wrap: anywhere; }
.bubble-basis { display: inline-block; margin: 0 0 6px; padding: 1px 6px; font-size: 0.7rem; letter-spacing: .05em; text-transform: uppercase;
  box-shadow: 0 -2px 0 0 var(--bub-ink), 0 2px 0 0 var(--bub-ink), -2px 0 0 0 var(--bub-ink), 2px 0 0 0 var(--bub-ink); }
.basis-article { background: var(--bub-art); }
.basis-excerpt { background: var(--bub-exc); }
.basis-headline { background: var(--bub-hl); }
.bubble-note { margin: 2px 0 6px; font-size: 0.76rem; color: var(--bub-dim); }
.bubble-text p, p.bubble-text { margin: 0 0 6px; }
.bubble-empty { color: var(--bub-dim); }
.bubble-loading { margin: 4px 0 8px; color: var(--bub-dim); }
.bubble-loading::after { content: " \25AE"; animation: bubble-blink 1s steps(2, start) infinite; }
@keyframes bubble-blink { to { visibility: hidden; } }
.bubble-foot { margin-top: 8px; padding-top: 8px; border-top: 2px dashed var(--bub-dim); text-align: right; }
.bubble-read { color: var(--bub-link); font-size: 0.8rem; text-underline-offset: 3px; }
.bubble-read:hover { color: #0f3566; }
.bubble-read:visited { color: #5a3d7a; }
/* the "thought" dots between the headline and the bubble */
.bubble-trail { position: absolute; left: var(--trail-x, 24px); top: -32px; width: 30px; height: 28px; pointer-events: none; }
.bubble-trail i { position: absolute; background: var(--bub-bg); box-shadow: 0 -2px 0 0 var(--bub-ink), 0 2px 0 0 var(--bub-ink), -2px 0 0 0 var(--bub-ink), 2px 0 0 0 var(--bub-ink); }
.bubble-trail i:nth-child(1) { width: 4px; height: 4px; left: 0; top: 0; }
.bubble-trail i:nth-child(2) { width: 6px; height: 6px; left: 7px; top: 8px; }
.bubble-trail i:nth-child(3) { width: 10px; height: 10px; left: 16px; top: 17px; }
.bubble.above .bubble-trail { top: auto; bottom: -32px; transform: scaleY(-1); }
/* phones: a sheet along the bottom that fits the screen; tap outside, swipe down, × or Esc to close */
.bubble-scrim { position: fixed; inset: 0; z-index: 29; background: rgba(0, 0, 0, .55); }
.bubble.sheet-mode { position: fixed; left: 10px; right: 10px; bottom: 10px; top: auto; width: auto; max-height: min(78vh, 600px); overflow-y: auto; overscroll-behavior: contain;
  padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
.bubble.sheet-mode .bubble-trail { display: none; }
.bubble.sheet-mode .bubble-x { width: 40px; height: 40px; font-size: 1.3rem; }
.bubble.sheet-mode .bubble-grip { display: block; position: absolute; left: 50%; top: 5px; width: 36px; height: 4px; margin-left: -18px; background: var(--bub-dim); }
.bubble.sheet-mode .bubble-head { padding-top: 6px; }
.bubble.sheet-mode .bubble-read { display: inline-block; padding: 8px 0; font-size: 0.9rem; }
body.bubble-open { overflow: hidden; }

/* ---- Your Watchtower Report ---- */
.report { max-width: 760px; padding: 8px 0 24px; }
.report h1 { margin: 18px 0 4px; font-size: 1.35rem; font-weight: 700; color: var(--text); }
.rep-sub { margin: 0 0 12px; color: var(--dim); font-size: 0.85rem; }
.rep-thin { margin: 10px 0; padding: 8px 10px; border-left: 2px solid var(--hot); color: var(--hot); font-size: 0.88rem; }
.rep-sec { margin-top: 26px; }
.rep-sec h2 { margin: 0 0 10px; font-size: 1rem; font-weight: 700; color: var(--text); letter-spacing: .02em; }
.rep-list { margin: 0; padding-left: 22px; }
.rep-list > li { margin: 4px 0; }
.rep-list strong { color: var(--text); font-weight: 700; }
.rep-n, .rep-dim { color: var(--dim); font-size: 0.85rem; }
.rep-obs { margin: 0 0 16px; padding-left: 10px; border-left: 2px solid var(--line); }
.rep-doomscroll, .rep-lean, .rep-focus { border-left-color: var(--hot); }
.rep-head { margin: 0 0 2px; color: var(--text); }
.rep-why { margin: 2px 0 0; }
.rep-ev { margin: 2px 0 0; padding-left: 18px; font-size: 0.85rem; color: var(--dim); }
.rep-ev li { overflow-wrap: anywhere; }
.rep-cm { list-style: none; margin: 0; padding: 0; }
.rep-cm > li { margin: 0 0 14px; }
.rep-reason { margin: 2px 0 0; font-size: 0.85rem; color: var(--dim); }
.cm-none .rep-reason { color: var(--text); }

/* ---- retro price ticker: an LED strip under the Report row ---- */
:root { --led-bg: #0b0d0a; --led: #ffb000; --led-up: #7dff6a; --led-down: #ff5a4a; --led-dim: #4a3a12; }
.top-inner.tick-row { display: flex; justify-content: center; padding: 0 16px 12px; }
.ticker { width: min(560px, 100%); padding: 3px; background: var(--led-bg); image-rendering: pixelated;
  box-shadow: 0 -3px 0 0 #2b2b2b, 0 3px 0 0 #2b2b2b, -3px 0 0 0 #2b2b2b, 3px 0 0 0 #2b2b2b, 5px 5px 0 0 rgba(0, 0, 0, .5); }
.ticker-track { position: relative; height: 26px; overflow: hidden;
  /* LED dot grid and a faint scanline glow */
  background: radial-gradient(circle, rgba(255, 176, 0, .07) 1px, transparent 1.4px) 0 0 / 4px 4px, linear-gradient(rgba(255, 255, 255, .02), rgba(0, 0, 0, .25)); }
.ticker-run { position: absolute; left: 0; top: 0; display: flex; gap: 34px; white-space: nowrap; height: 26px; align-items: center; will-change: transform;
  font: 700 0.86rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--led); text-shadow: 0 0 4px rgba(255, 176, 0, .6); }
.ticker.resting .ticker-run { visibility: hidden; }
.ticker.static .ticker-run { position: static; justify-content: center; flex-wrap: wrap; height: auto; min-height: 26px; padding: 4px 6px; row-gap: 4px; gap: 22px; }
.ticker.static .ticker-track { height: auto; }
.tick { border: 0; background: none; padding: 0; color: inherit; font: inherit; letter-spacing: inherit; text-shadow: inherit; text-transform: inherit; cursor: pointer; }
.tick:hover .tick-sym, .tick:focus-visible .tick-sym { text-decoration: underline; text-underline-offset: 3px; }
.tick-up { color: var(--led-up); text-shadow: 0 0 4px rgba(125, 255, 106, .55); }
.tick-down { color: var(--led-down); text-shadow: 0 0 4px rgba(255, 90, 74, .55); }
.tick-off { color: var(--led-dim); text-shadow: none; }
.tick-note { color: var(--led-dim); text-shadow: none; font-weight: 400; }
.top-inner.tick-row { gap: 10px; align-items: center; }
.tick-row .ticker { min-width: 0; }
.tick-edit { flex: none; width: 32px; height: 32px; border: 0; padding: 0; cursor: pointer; background: var(--led-bg); color: var(--led);
  font: 700 1.1rem/1 var(--sans); text-shadow: 0 0 4px rgba(255, 176, 0, .6);
  box-shadow: 0 -3px 0 0 #2b2b2b, 0 3px 0 0 #2b2b2b, -3px 0 0 0 #2b2b2b, 3px 0 0 0 #2b2b2b, 5px 5px 0 0 rgba(0, 0, 0, .5); }
.tick-edit:hover, .tick-edit:focus-visible { color: var(--led-up); text-shadow: 0 0 5px rgba(125, 255, 106, .7); }
.tick-edit:active { transform: translate(2px, 2px); box-shadow: 0 -3px 0 0 #2b2b2b, 0 3px 0 0 #2b2b2b, -3px 0 0 0 #2b2b2b, 3px 0 0 0 #2b2b2b, 2px 2px 0 0 rgba(0, 0, 0, .5); }
#ticker[hidden] + .tick-edit { display: none; }
@media (max-width: 620px) { .top-inner.tick-row { padding: 0 12px 10px; } .ticker-run { font-size: 0.8rem; } }
/* ticker settings rows: order buttons read "earlier" / "later" */
.ic.ic-up::after { content: "earlier"; }
.ic.ic-down::after { content: "later"; }
.ic:disabled { opacity: .35; cursor: default; text-decoration: none; }
#tick-list { margin: 6px 0 4px; }

/* ---- floating donate button (bottom right) ---- */
.donate { position: fixed; right: 18px; bottom: 18px; z-index: 15; display: flex; flex-direction: column; align-items: flex-end; gap: 14px; pointer-events: none; }
.donate > * { pointer-events: auto; }
.donate-btn { border: 0; padding: 8px 12px; cursor: pointer; background: var(--led-bg); color: var(--led); font: 700 0.8rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase;
  text-shadow: 0 0 4px rgba(255, 176, 0, .6);
  box-shadow: 0 -3px 0 0 #2b2b2b, 0 3px 0 0 #2b2b2b, -3px 0 0 0 #2b2b2b, 3px 0 0 0 #2b2b2b, 5px 5px 0 0 rgba(0, 0, 0, .5); }
.donate-btn:hover, .donate-btn:focus-visible, .donate-btn[aria-expanded="true"] { color: var(--led-up); text-shadow: 0 0 5px rgba(125, 255, 106, .7); }
.donate-btn:active { transform: translate(2px, 2px); }
.donate-card { width: min(300px, calc(100vw - 36px)); padding: 12px 14px 14px; background: var(--bub-bg); color: var(--bub-ink); font: 0.84rem/1.5 var(--sans);
  box-shadow: 0 -4px 0 0 var(--bub-ink), 0 4px 0 0 var(--bub-ink), -4px 0 0 0 var(--bub-ink), 4px 0 0 0 var(--bub-ink), 8px 8px 0 0 rgba(0, 0, 0, .55);
  animation: bubble-pop .2s steps(3, end) both; }
.donate-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.donate-title { margin: 0; font-weight: 700; }
.donate-hint { margin: 6px 0 10px; color: var(--bub-dim); }
.donate-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.donate-list li { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.donate-app { min-width: 5.5em; font-size: 0.72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--bub-dim); }
.donate-list a { color: var(--bub-link); font-weight: 700; }
.donate-copy { margin-left: auto; border: 0; background: none; padding: 0; color: var(--bub-dim); font: inherit; font-size: 0.76rem; text-decoration: underline; cursor: pointer; }
.donate-copy:hover { color: var(--bub-ink); }
@media (max-width: 620px) { .donate { right: 12px; bottom: 12px; } .toast { bottom: 62px; } }
@media (prefers-reduced-motion: reduce) { .donate-card { animation: none; } }
