/* Bend Hub: clean light news-site look, mobile first. */
:root {
  --bg: #ffffff;
  --paper: #f7f8fa;
  --ink: #14161a;
  --muted: #565d69;
  --faint: #8a919d;
  --rule: #e6e9ee;
  --accent: #0b5cad;
  --accent-ink: #ffffff;
  --good: #1f9d6b;
  --bad: #c0392b;
  --warn-bg: #fff4d6;
  --warn-ink: #5c3d00;
  --shadow: 0 10px 40px rgba(16, 24, 40, .16);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --notice-bg: #e8f1fc;
  --notice-ink: #0b3a6b;
  --kl: 36%;
  --scale: 1;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; font-size: calc(100% * var(--scale)); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 1rem/1.5 var(--sans); -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}
body.lock { overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
.aurora { display: none; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3 { margin: 0; }

/* ---------- Top of page ---------- */
.mast { border-bottom: 1px solid var(--rule); }
.util {
  display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap;
  padding: 8px 0; font-size: .78rem; color: var(--muted); border-bottom: 1px solid var(--rule);
}
.util a { color: var(--muted); font-weight: 600; }
.u-wx { color: var(--ink) !important; }
.u-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.rss { border: 1px solid var(--rule); border-radius: 4px; padding: 0 7px; font-size: .7rem; letter-spacing: .06em; }
.live { display: inline-flex; align-items: center; gap: 6px; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 25%, transparent); animation: pulse 2.4s ease-in-out infinite; }
.live.busy i { background: var(--accent); animation-duration: .8s; }
@keyframes pulse { 50% { opacity: .35; } }
.logo-row { padding: 16px 0 14px; display: flex; align-items: baseline; gap: 6px 18px; flex-wrap: wrap; }
.logo { font-family: var(--serif); font-size: clamp(2rem, 7vw, 3.1rem); line-height: 1; letter-spacing: -.02em; font-weight: 800; }
.logo a { color: var(--ink); text-decoration: none; }
.tagline { margin: 0; color: var(--muted); font-size: .9rem; }
@media (max-width: 639px) { .tagline { display: none; } .logo-row { padding: 10px 0 8px; } .util { font-size: .74rem; } .alert { padding: 9px 12px; font-size: .85rem; } .alert strong { flex: 1 1 100%; } }

.navbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(12px); backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.cats { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 12px; }
.cats::-webkit-scrollbar { display: none; }
.cats a {
  flex: none; padding: 13px 10px 11px; font-size: .92rem; font-weight: 650; color: var(--muted);
  border-bottom: 3px solid transparent; white-space: nowrap; text-decoration: none;
}
.cats a small { margin-left: 5px; font-size: .7rem; color: var(--faint); font-weight: 600; }
.cats a:hover { color: var(--ink); }
.cats a.on { color: var(--ink); border-bottom-color: hsl(var(--h, 215) 70% 45%); }
.cats a:first-child.on { border-bottom-color: var(--ink); }

.subnav { display: flex; gap: 10px 14px; flex-wrap: wrap; align-items: center; padding: 12px 0 4px; }
.seg { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; align-items: center; max-width: 100%; }
.seg::-webkit-scrollbar { display: none; }
.seg > a, .seg > .chipbtn, .seg summary {
  flex: none; padding: 6px 13px; border-radius: 999px; font-size: .84rem; font-weight: 600;
  color: var(--muted); border: 1px solid var(--rule); background: transparent; cursor: pointer; list-style: none; text-decoration: none;
}
.seg summary::-webkit-details-marker { display: none; }
.seg > a.on, .seg > .chipbtn.on, .seg summary.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.seg > a:hover { color: var(--ink); border-color: var(--faint); }
details.pick { position: relative; flex: none; }
.pop {
  position: absolute; z-index: 40; left: 0; top: calc(100% + 8px); width: 250px; padding: 14px;
  background: var(--bg); border: 1px solid var(--rule); border-radius: 12px; box-shadow: var(--shadow);
}
.pop label { margin-top: 0; }
.pop-act { display: flex; gap: 8px; margin: 12px 0 0; }
.search { flex: 1 1 100%; }
@media (min-width: 640px) { .search { flex: 1 1 200px; max-width: 320px; margin-left: auto; } }
.search input { border-radius: 999px; padding: 8px 16px; font-size: .9rem; background: var(--paper); }

/* ---------- Alerts + weather ---------- */
.page { padding-top: 6px; }
.alert { margin: 12px 0 0; padding: 11px 14px; border-radius: 10px; background: var(--warn-bg); color: var(--warn-ink); font-size: .9rem; display: flex; gap: 6px 12px; flex-wrap: wrap; border-left: 5px solid #e0a100; }
.now { margin: 14px 0 6px; border: 1px solid var(--rule); border-radius: 14px; background: var(--paper); padding: 14px; display: grid; gap: 12px; }
.now-main { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; }
.now-icon { font-size: 2.4rem; line-height: 1; }
@media (min-width: 640px) { .now-icon { font-size: 3rem; } }
.now-temp { font-family: var(--serif); font-size: 2.3rem; font-weight: 700; line-height: 1; }
.now-temp small { font-size: 1rem; color: var(--muted); margin-left: 2px; }
.now-sub { font-size: .85rem; color: var(--muted); margin-top: 3px; }
.aqi { display: inline-flex; align-items: baseline; gap: 8px; padding: 6px 14px; border-radius: 999px; font-size: .78rem; color: #111; background: #bfe8cf; }
.aqi b { font-size: 1.15rem; font-family: var(--serif); }
.aqi em { font-style: normal; font-weight: 700; }
@media (min-width: 640px) { .aqi { margin-left: auto; } }
.aqi-mod { background: #fbe9a6; } .aqi-sens { background: #fdcf9c; } .aqi-bad { background: #f6a9a0; } .aqi-vbad { background: #d9a4d6; }
.days { display: grid; grid-template-columns: repeat(6, minmax(64px, 1fr)); gap: 6px; overflow-x: auto; }
.day-c { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 10px; background: var(--bg); border: 1px solid var(--rule); font-size: .8rem; min-width: 64px; }
.dn { font-weight: 700; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.di { font-size: 1.4rem; }
.dt i { font-style: normal; color: var(--faint); }
.dr { font-size: .7rem; color: var(--accent); font-weight: 650; }

/* ---------- Layout ---------- */
.layout { display: grid; gap: 8px 40px; margin-top: 4px; }
.main { min-width: 0; }
.side { min-width: 0; }
@media (min-width: 920px) {
  .layout { grid-template-columns: minmax(0, 1fr) 320px; }
}
.section {
  margin: 22px 0 10px; padding-bottom: 8px; border-bottom: 2px solid var(--ink);
  font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 800;
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
}
.section span { font-weight: 600; letter-spacing: .02em; text-transform: none; color: var(--muted); font-size: .8rem; }
.day { margin: 26px 0 0; font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 800; }

/* ---------- Stories ---------- */
.kicker { font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: hsl(var(--h, 215) 70% var(--kl)); margin-bottom: 4px; }
.meta { margin-top: 7px; font-size: .78rem; color: var(--muted); display: flex; gap: 4px 10px; flex-wrap: wrap; align-items: center; }
.meta .src { font-weight: 700; color: var(--ink); }
.meta .when::before { content: "·"; margin-right: 10px; color: var(--faint); }
.meta .full { font-size: .66rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--rule); color: var(--accent); }
.sum { margin: 6px 0 0; font-size: .95rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
a.t { color: var(--ink); text-decoration: none; }
a.t:hover { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
h3 a.t { font-family: var(--serif); font-weight: 700; letter-spacing: -.01em; }

.item { display: flex; gap: 16px; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.item h3 { font-size: 1.15rem; line-height: 1.25; }
.item .txt { min-width: 0; flex: 1; }
.thumb { flex: none; width: 112px; height: 84px; border-radius: 8px; object-fit: cover; background: var(--paper); }
@media (min-width: 640px) { .thumb { width: 168px; height: 112px; } .item h3 { font-size: 1.28rem; } }

.top-stories { display: grid; gap: 18px; padding: 6px 0 4px; border-bottom: 1px solid var(--rule); margin-bottom: 4px; }
.hero { display: grid; gap: 12px; }
.hero-img { width: 100%; aspect-ratio: 16 / 9; max-height: 420px; object-fit: cover; border-radius: 12px; background: var(--paper); }
.hero h3 { font-size: clamp(1.5rem, 5.4vw, 2.15rem); line-height: 1.15; }
.hero .sum { font-size: 1.02rem; -webkit-line-clamp: 4; }
.sub { display: flex; gap: 14px; padding-top: 16px; border-top: 1px solid var(--rule); }
.sub h3 { font-size: 1.08rem; line-height: 1.25; }
.sub > div { min-width: 0; flex: 1; }
.sub-img { order: 2; flex: none; width: 96px; height: 72px; border-radius: 8px; object-fit: cover; background: var(--paper); }
@media (min-width: 640px) {
  .top-stories { grid-template-columns: 1fr 1fr; }
  .hero { grid-column: 1 / -1; }
  .sub { border-top: 1px solid var(--rule); }
  .sub-img { width: 120px; height: 84px; }
}

/* ---------- Sidebar ---------- */
.events, .links { list-style: none; margin: 0; padding: 0; }
.events li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.events a, .events span.t { color: var(--ink); font-weight: 650; font-size: .95rem; line-height: 1.3; }
.events a:hover { color: var(--accent); }
.events .meta { margin-top: 3px; }
.badge { flex: none; width: 48px; text-align: center; border: 1px solid var(--rule); border-radius: 8px; padding: 4px 0; background: var(--paper); line-height: 1.1; align-self: flex-start; }
.badge span { display: block; font-size: .62rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #c0392b; }
.badge b { font-family: var(--serif); font-size: 1.25rem; }
.links li { border-bottom: 1px solid var(--rule); }
.links a { display: block; padding: 11px 0; font-size: .92rem; font-weight: 600; }
.side-note { font-size: .88rem; color: var(--muted); margin: 8px 0 0; }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 26px 0 0; font-size: .85rem; color: var(--muted); }
.empty { padding: 36px 8px; text-align: center; color: var(--muted); }
.spinner { width: 26px; height: 26px; margin: 0 auto 12px; border-radius: 50%; border: 3px solid var(--rule); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.site-foot { margin: 36px 0 28px; padding-top: 16px; border-top: 1px solid var(--rule); color: var(--faint); font-size: .78rem; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.site-foot a { color: var(--muted); }
.newpill {
  position: fixed; left: 50%; transform: translateX(-50%); top: 64px; z-index: 45; border: 0; cursor: pointer;
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font: 650 .88rem var(--sans); box-shadow: var(--shadow);
}

/* ---------- Story preview panel ---------- */
.sheet { position: fixed; inset: 0; z-index: 60; }
.sheet[hidden] { display: none; }
.sheet-bg { position: absolute; inset: 0; background: rgba(8, 10, 14, .5); opacity: 0; transition: opacity .18s; }
.sheet.open .sheet-bg { opacity: 1; }
.sheet-box {
  position: absolute; left: 0; right: 0; bottom: 0; height: 92dvh; max-height: 100dvh;
  background: var(--bg); color: var(--ink); border-radius: 18px 18px 0 0; display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .2s ease-out; outline: none; box-shadow: var(--shadow);
}
.sheet.open .sheet-box { transform: none; }
.sheet-bar { display: flex; align-items: center; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--rule); }
.sheet-bar::before { content: ""; position: absolute; left: 50%; top: 6px; width: 38px; height: 4px; margin-left: -19px; border-radius: 4px; background: var(--rule); }
.grow { flex: 1; }
.icon-btn { width: 44px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: var(--ink); font-size: 1.4rem; cursor: pointer; }
.icon-btn:hover:not(:disabled) { background: var(--paper); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.sheet-scroll { overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.sheet-box.loading .sheet-scroll { opacity: .35; }
.sh-img { display: block; width: 100%; max-height: 340px; object-fit: cover; background: var(--paper); }
.sh-in { padding: 18px 20px 8px; max-width: 700px; margin: 0 auto; }
.sh-in h2 { font-family: var(--serif); font-size: clamp(1.45rem, 5vw, 2rem); line-height: 1.2; letter-spacing: -.01em; }
.sh-body { margin-top: 16px; font-family: var(--serif); font-size: 1.1rem; line-height: 1.7; }
.sh-body p { margin: 0 0 1em; }
.sh-note { font-size: .8rem; color: var(--muted); border-top: 1px solid var(--rule); padding-top: 12px; margin: 18px 0; }
@media (min-width: 800px) {
  .sheet-box { left: auto; width: 680px; height: 100dvh; border-radius: 0; transform: translateX(100%); }
  .sheet-bar::before { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- Buttons and form fields (also used by the admin pages) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  padding: 9px 18px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  font: 650 .9rem var(--sans); text-decoration: none; min-height: 38px;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn.ghost:hover { border-color: var(--faint); }
.btn.danger { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--rule)); }
.btn.small { padding: 5px 12px; font-size: .8rem; min-height: 32px; }
.btn.big { width: 100%; margin: 6px 0 18px; min-height: 46px; font-size: 1rem; }
label { display: block; margin: 12px 0 4px; font-size: .78rem; font-weight: 700; color: var(--muted); }
input, select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--rule); background: var(--bg); color: var(--ink);
  font: inherit; font-size: 16px; /* 16px stops phones zooming in on focus */
}
input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------- Admin ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--rule); margin-bottom: 8px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mark { width: 40px; height: 40px; border-radius: 10px; background: var(--ink); color: var(--bg); display: grid; place-items: center; font: 800 1.2rem var(--serif); flex: none; }
.brand h1 { font-family: var(--serif); font-size: 1.5rem; line-height: 1.1; }
.brand h1 a { color: var(--ink); text-decoration: none; }
.tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card { padding: 18px; margin: 14px 0; border: 1px solid var(--rule); border-radius: 12px; background: var(--paper); }
.card h2 { font-family: var(--serif); }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.flash { padding: 12px 16px; border-radius: 10px; margin: 14px 0; font-size: .92rem; white-space: pre-line; }
.flash.ok { background: color-mix(in srgb, var(--good) 16%, var(--bg)); border: 1px solid color-mix(in srgb, var(--good) 40%, var(--rule)); }
.flash.err { background: color-mix(in srgb, var(--bad) 14%, var(--bg)); border: 1px solid color-mix(in srgb, var(--bad) 40%, var(--rule)); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .row, .row3 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 9px; align-items: center; font-weight: 550; color: var(--ink); font-size: .9rem; margin: 8px 0 0; }
.hint { color: var(--muted); font-size: .8rem; margin: 4px 0 0; }
.src { display: flex; justify-content: space-between; gap: 10px 14px; align-items: center; flex-wrap: wrap; padding: 14px 0; border-top: 1px solid var(--rule); }
.src:first-of-type { border-top: 0; }
.src .info { min-width: 0; flex: 1 1 300px; }
.src .url { font-size: .76rem; color: var(--faint); word-break: break-all; margin-top: 2px; }
.src .acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.src form.inline { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.src input[type=text], .src input:not([type]) { width: 150px; padding: 6px 10px; font-size: .84rem; }
.src select { width: auto; padding: 5px 9px; font-size: .84rem; }
.src .check { font-size: .82rem; margin: 0; }
.pill { font-size: .66rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--rule); text-transform: uppercase; letter-spacing: .05em; vertical-align: middle; color: var(--muted); }
.pill.ok { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, var(--rule)); }
.pill.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--rule)); }
.pill.off { color: var(--faint); }
.sugg { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin-top: 10px; }
.sugg .card { margin: 0; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; background: var(--bg); }
.sugg .nm { font-weight: 700; font-size: .93rem; }
pre.log { background: var(--bg); border: 1px solid var(--rule); border-radius: 8px; padding: 12px; font-size: .78rem; overflow-x: auto; white-space: pre-wrap; word-break: break-word; margin: 10px 0 0; }
details.fold > summary { cursor: pointer; font-weight: 700; color: var(--ink); list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: "＋"; color: var(--muted); }
details.fold[open] > summary::after { content: "－"; }
.login-box { max-width: 400px; margin: 9vh auto 0; padding: 26px; }


/* ---------- Public extras ---------- */
.notice { margin: 14px 0 0; padding: 12px 16px; border-radius: 10px; background: var(--notice-bg); color: var(--notice-ink); border-left: 5px solid var(--accent); font-weight: 600; font-size: .95rem; }
.notice a { color: inherit; text-decoration: underline; margin-left: 6px; }
.t.read { color: var(--faint); }
h3 a.t.read { color: var(--faint); }
.pinned-box { margin-bottom: 4px; }
.pinned-box .kicker::before { content: "★ "; }
.popular { list-style: none; margin: 0; padding: 0; counter-reset: pop; }
.popular li { counter-increment: pop; display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.popular li::before { content: counter(pop); font: 800 1.25rem var(--serif); color: var(--faint); width: 22px; flex: none; text-align: center; }
.popular a { font-weight: 650; font-size: .93rem; line-height: 1.3; color: var(--ink); }
.popular a:hover { color: var(--accent); }
.util button.link, .link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.link-btn:hover { color: var(--ink); text-decoration: underline; }
.saved-list { list-style: none; margin: 0; padding: 0; }
.saved-list li { display: flex; gap: 10px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.saved-list a { font-family: var(--serif); font-weight: 700; color: var(--ink); line-height: 1.3; }
.saved-list .x { margin-left: auto; flex: none; }
.sh-actions { display: flex; gap: 8px; margin: 0 0 12px; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: .88rem; font-weight: 600; z-index: 80; box-shadow: var(--shadow); }
.star-on { color: #d99100; }
.admin-bar { background: var(--ink); color: var(--bg); font-size: .78rem; padding: 6px 0; }
.admin-bar a { color: var(--bg); font-weight: 700; margin-right: 14px; }

/* ---------- Admin dashboard ---------- */
body.adm { background: var(--paper); }
.adm-wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.adm-top { background: var(--bg); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 20; }
.adm-top .adm-wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.adm-top .brand div { display: flex; flex-direction: column; line-height: 1.15; }
.adm-top .brand small { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.adm-grid { display: grid; gap: 16px; padding-top: 16px; padding-bottom: 60px; }
.adm-nav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.adm-nav::-webkit-scrollbar { display: none; }
.adm-nav a { flex: none; padding: 8px 14px; border-radius: 999px; font-weight: 650; font-size: .88rem; color: var(--muted); background: var(--bg); border: 1px solid var(--rule); text-decoration: none; position: relative; }
.adm-nav a.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.adm-nav .dot { position: absolute; top: 5px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.adm-main { min-width: 0; }
.adm-h { font-family: var(--serif); font-size: 1.7rem; margin: 4px 0 14px; letter-spacing: -.01em; }
.lead { color: var(--muted); margin: -4px 0 14px; max-width: 62ch; }
@media (min-width: 860px) {
  .adm-grid { grid-template-columns: 190px minmax(0, 1fr); gap: 32px; }
  .adm-nav { flex-direction: column; position: sticky; top: 76px; align-self: start; overflow: visible; }
  .adm-nav a { border-radius: 8px; border-color: transparent; background: transparent; }
  .adm-nav a:hover { background: var(--bg); }
  .adm-nav a.on { background: var(--ink); }
}
body.adm .card { background: var(--bg); }
body.adm .card h2 { font-size: 1.15rem; margin: 0 0 8px; }
body.adm .card h2 small { font: 500 .8rem var(--sans); }
body.adm hr { border: 0; border-top: 1px solid var(--rule); margin: 18px 0; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile { background: var(--bg); border: 1px solid var(--rule); border-radius: 12px; padding: 14px 16px; }
.tile b { display: block; font: 700 1.7rem/1.1 var(--serif); }
.tile b small { font-size: 1rem; color: var(--faint); }
.tile span { font-size: .78rem; color: var(--muted); }
.tile.warn { border-color: color-mix(in srgb, var(--bad) 50%, var(--rule)); background: #fff5f3; }
.tile.warn b { color: var(--bad); }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 130px; padding-top: 8px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.bar i { display: block; width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; opacity: .85; }
.bar:hover i { opacity: 1; }
.bar span { font-size: .66rem; color: var(--faint); }
.two { display: grid; gap: 14px; }
@media (min-width: 760px) { .two { grid-template-columns: 1fr 1fr; } }
.mini { display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: .9rem; }
.mini:last-child { border-bottom: 0; }
.mini .n { flex: none; min-width: 34px; text-align: center; font: 700 1rem var(--serif); background: var(--paper); border-radius: 8px; padding: 2px 6px; }
.seg2 { display: flex; gap: 6px; flex-wrap: wrap; }
.seg2 a { padding: 5px 13px; border-radius: 999px; border: 1px solid var(--rule); font-size: .84rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.seg2 a.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.inline-search { display: flex; gap: 6px; margin: 0 0 10px; }
.inline-search input { width: 220px; max-width: 100%; padding: 6px 12px; font-size: .9rem; border-radius: 999px; }
.bulkbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.bulkbar select { width: auto; padding: 6px 10px; font-size: .88rem; }
.bulkbar .check { margin: 0; }
body.adm .src { align-items: flex-start; }
.pick-box { padding-top: 2px; }
.src details.edit { flex: 1 1 100%; margin-top: 2px; }
.src details.edit summary { cursor: pointer; font-size: .82rem; font-weight: 700; color: var(--accent); list-style: none; }
.src details.edit summary::-webkit-details-marker { display: none; }
.src details.edit[open] { background: var(--paper); border-radius: 10px; padding: 12px 14px; }
.editform label { margin-top: 8px; }
.editform .row { align-items: end; }
.sg { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 10px; margin: 0; font-weight: 400; color: var(--ink); font-size: .9rem; cursor: pointer; background: var(--bg); }
.sg input { margin-top: 3px; flex: none; }
.sg:hover { border-color: var(--faint); }
.sugg { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
details.fold { border-top: 1px solid var(--rule); padding: 12px 0; }
details.fold:first-of-type { border-top: 0; }
.narrow { max-width: 420px; }
ul.plain { margin: 8px 0 0; padding-left: 20px; color: var(--muted); font-size: .92rem; }
ul.plain li { margin: 4px 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
body.adm textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; line-height: 1.5; }
body.adm code { background: var(--paper); padding: 1px 6px; border-radius: 5px; font-size: .85em; }
body.adm-login { background: var(--paper); }
.login-box { background: var(--bg); }


/* ================= Visitor themes & preferences (saved in the visitor's browser) ================= */
html[data-theme="dark"] {
  --bg: #111317; --paper: #1a1d23; --ink: #eceef2; --muted: #a8aeb9; --faint: #7a8190; --rule: #2a2e37;
  --accent: #7db3ff; --accent-ink: #0b1220; --warn-bg: #3a2e0b; --warn-ink: #ffe3a1;
  --notice-bg: #14283f; --notice-ink: #cfe3ff; --kl: 72%; --shadow: 0 10px 40px rgba(0, 0, 0, .6); color-scheme: dark;
}
html[data-theme="sepia"] {
  --bg: #f6efdd; --paper: #efe5cb; --ink: #3a2e1c; --muted: #6d5c40; --faint: #988762; --rule: #dfd2b1;
  --accent: #8a4b12; --accent-ink: #fff; --warn-bg: #f7e2a8; --warn-ink: #4d3500; --notice-bg: #ecdcb4; --notice-ink: #4d3a15; --kl: 30%;
}
html[data-theme="ocean"] {
  --bg: #f2f8fc; --paper: #e5f0f8; --ink: #0e2a3d; --muted: #45627b; --faint: #7a93a9; --rule: #d1e2ee;
  --accent: #0a6cb4; --accent-ink: #fff; --notice-bg: #d9ecfa; --notice-ink: #0a3d66;
}
html[data-theme="forest"] {
  --bg: #f3f8f3; --paper: #e6f1e7; --ink: #1a2b1d; --muted: #4a6150; --faint: #7d9582; --rule: #d3e4d5;
  --accent: #2b7a30; --accent-ink: #fff; --notice-bg: #dcefdd; --notice-ink: #1b4a1f;
}
html[data-theme="contrast"] {
  --bg: #fff; --paper: #fff; --ink: #000; --muted: #111; --faint: #222; --rule: #000;
  --accent: #0000d0; --accent-ink: #fff; --warn-bg: #ffe14d; --warn-ink: #000; --notice-bg: #fff; --notice-ink: #000; --kl: 24%;
}
html[data-theme="contrast"] .item, html[data-theme="contrast"] .now, html[data-theme="contrast"] .day-c { border-color: #000; }
html[data-theme="contrast"] a { text-decoration: underline; }
html[data-theme="contrast"] .notice { border: 2px solid #000; }

/* accent colours */
html[data-accent="red"] { --accent: #c62828; --accent-ink: #fff; }
html[data-accent="green"] { --accent: #2e7d32; --accent-ink: #fff; }
html[data-accent="purple"] { --accent: #6a1b9a; --accent-ink: #fff; }
html[data-accent="orange"] { --accent: #d84315; --accent-ink: #fff; }
html[data-theme="dark"][data-accent="red"] { --accent: #ff8a80; --accent-ink: #1a0a08; }
html[data-theme="dark"][data-accent="green"] { --accent: #81c784; --accent-ink: #08140a; }
html[data-theme="dark"][data-accent="purple"] { --accent: #d1a3f0; --accent-ink: #160a1f; }
html[data-theme="dark"][data-accent="orange"] { --accent: #ffab91; --accent-ink: #1f0e08; }

/* text size, headline font, density */
html[data-size="0"] { --scale: .92; }
html[data-size="2"] { --scale: 1.12; }
html[data-size="3"] { --scale: 1.26; }
html[data-font="sans"] h3 a.t, html[data-font="sans"] .logo, html[data-font="sans"] .sh-in h2, html[data-font="sans"] .sh-body, html[data-font="sans"] .now-temp { font-family: var(--sans); }
html[data-font="sans"] .sh-body { line-height: 1.65; }
html[data-density="compact"] .sum, html[data-density="compact"] .hero .sum { display: none; }
html[data-density="compact"] .item { padding: 10px 0; }
html[data-density="compact"] .thumb { width: 84px; height: 62px; }
html[data-density="compact"] .item h3 { font-size: 1.05rem; }
html[data-density="compact"] .day { margin-top: 16px; }
html[data-density="compact"] .hero-img { max-height: 240px; }

/* sections the visitor switched off */
html[data-hide~="weather"] .now, html[data-hide~="weather"] .u-wx { display: none; }
html[data-hide~="events"] .side-events { display: none; }
html[data-hide~="popular"] .side-popular { display: none; }
html[data-hide~="links"] .side-links { display: none; }
html[data-hide~="images"] .thumb, html[data-hide~="images"] .hero-img, html[data-hide~="images"] .sub-img, html[data-hide~="images"] .sh-img { display: none; }
[data-hidden-by-me] { display: none !important; }

/* customize panel */
.cz h2 { font-family: var(--serif); font-size: 1.6rem; }
.cz fieldset { border: 0; margin: 20px 0 0; padding: 0; }
.cz legend { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; color: var(--muted); padding: 0; margin-bottom: 8px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { border: 1px solid var(--rule); background: var(--bg); color: var(--ink); border-radius: 999px; padding: 7px 14px; font: 600 .88rem var(--sans); cursor: pointer; min-height: 38px; }
.opt[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 10px; }
.theme-b { border: 2px solid var(--rule); border-radius: 12px; padding: 8px; background: var(--bg); cursor: pointer; font: 600 .8rem var(--sans); color: var(--ink); text-align: center; }
.theme-b[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.theme-b i { display: block; height: 34px; border-radius: 8px; margin-bottom: 6px; border: 1px solid rgba(0, 0, 0, .12); }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--rule); cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--ink); }
.cz .check { margin: 6px 0; }
.cz .catgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 14px; }
.muted-list { list-style: none; padding: 0; margin: 6px 0 0; }
.muted-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--rule); font-size: .9rem; }
.cz-foot { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--rule); display: flex; gap: 8px; flex-wrap: wrap; }
.hidden-note { margin: 12px 0 0; font-size: .85rem; color: var(--muted); }

/* ---- Source health + preview ---- */
.pill.warn { color: #9a6700; border-color: color-mix(in srgb, #bf8700 50%, var(--rule)); background: #fff8e5; }
.tile.bad { border-color: color-mix(in srgb, var(--bad) 50%, var(--rule)); background: #fff5f3; }
.strip { display: flex; gap: 2px; margin-top: 7px; height: 14px; align-items: flex-end; }
.strip i { flex: 0 0 6px; height: 100%; border-radius: 2px; background: var(--good); opacity: .85; }
.strip i.bad { background: var(--bad); }
.hint.why { color: var(--bad); margin-top: 4px; }
h3.sub { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 16px 0 4px; }
.mini .n.ev { font-size: .9rem; min-width: 28px; }
.mini .n.ev.good { color: var(--good); }
.mini .n.ev.bad { color: var(--bad); }
.pasterow { display: flex; gap: 8px; }
.pasterow input { flex: 1; min-width: 0; }
.preview .pv-head { display: flex; gap: 16px; align-items: center; margin-bottom: 8px; }
.preview .score { flex: none; width: 74px; height: 74px; border-radius: 50%; display: grid; place-content: center; text-align: center; border: 4px solid var(--rule); font-family: var(--serif); line-height: 1; }
.preview .score b { font-size: 1.6rem; }
.preview .score small { font-size: .7rem; color: var(--muted); }
.preview .score.ok { border-color: var(--good); }
.preview .score.warn { border-color: #bf8700; }
.preview .score.bad { border-color: var(--bad); }
.hint.note { margin: 2px 0; }
@media (max-width: 560px) { .pasterow { flex-direction: column; } .preview .pv-head { align-items: flex-start; } }

/* ---- Unread + search ---- */
.nw { display: inline-block; margin-left: 6px; min-width: 18px; padding: 1px 6px; border-radius: 999px; background: var(--accent, #d4380d); color: #fff; font: 700 .68rem/1.5 var(--sans, system-ui); text-align: center; vertical-align: 1px; }
.nw[hidden] { display: none; }
.item.is-new .t::before, .hero.is-new .t::before, .sub.is-new .t::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent, #d4380d); margin-right: 8px; vertical-align: 2px; }
.hide-read { display: none !important; }
.seg > .chipbtn { font-family: inherit; cursor: pointer; }
.seg > .chipbtn[hidden] { display: none; }
.hint.why.warn { color: #9a6700; }
.q-note { margin: 0 0 14px; font-size: .92rem; color: var(--muted); }

/* ---- Clusters, trending, emergency ---- */
details.also { margin: 8px 0 0; font-size: .82rem; }
details.also summary { cursor: pointer; color: var(--accent, #0b5cab); font-weight: 600; list-style: none; }
details.also summary::-webkit-details-marker { display: none; }
details.also ul { margin: 6px 0 0; padding: 0; list-style: none; border-left: 2px solid var(--rule); }
details.also li { padding: 4px 0 4px 10px; }
details.also a, details.also span { color: var(--ink); text-decoration: none; }
details.also a:hover { text-decoration: underline; }
details.also b { color: var(--muted); font-weight: 700; margin-right: 4px; }
.trending { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 14px; font-size: .84rem; }
.trending span { font-weight: 800; text-transform: uppercase; letter-spacing: .07em; font-size: .7rem; color: var(--muted); }
.trending a { padding: 3px 11px; border-radius: 999px; border: 1px solid var(--rule); color: var(--ink); text-decoration: none; font-weight: 600; }
.trending a:hover { border-color: var(--ink); }
.emergency { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; background: #b42318; color: #fff; padding: 12px 16px; border-radius: 10px; margin: 0 0 12px; text-decoration: none; }
.emergency b { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; background: rgba(255,255,255,.2); padding: 2px 8px; border-radius: 999px; }
.emergency span { font-weight: 700; flex: 1 1 240px; }
.emergency em { font-style: normal; font-size: .8rem; opacity: .9; }

/* ---- Secondary pages: calendar, map, forms ---- */
.mini-mast .logo-row { padding: 12px 0; align-items: center; justify-content: space-between; }
.logo.small { font-size: 1.7rem; }
.pagenav { display: flex; gap: 4px; flex-wrap: wrap; }
.pagenav a { padding: 6px 12px; border-radius: 999px; font-size: .86rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.pagenav a.on, .pagenav a:hover { background: var(--ink); color: var(--bg); }
.sub-main { padding-top: 18px; max-width: 880px; }
.pg-h { font-family: var(--serif); font-size: 1.8rem; margin: 0; }
.sub-h { font-family: var(--serif); font-size: 1.2rem; margin: 18px 0 8px; }
.cal-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-cats { margin: 0 0 14px; padding-bottom: 2px; }
.seg > .chipbtn { flex: none; }
.empty-note { color: var(--muted); padding: 20px 0; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 10px; font-family: var(--serif); font-size: 1.15rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.cal-dow { padding: 6px; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: var(--paper); text-align: center; }
.cal-cell { min-height: 96px; padding: 5px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--ink); overflow: hidden; position: relative; }
.cal-cell.empty { background: var(--paper); }
.cal-cell.has:hover { background: var(--paper); }
.cal-cell.today .cal-d { background: var(--ink); color: var(--bg); border-radius: 999px; padding: 0 7px; }
.cal-d { font-weight: 700; font-size: .84rem; align-self: flex-start; }
.cal-ev { font-size: .68rem; line-height: 1.25; background: color-mix(in srgb, var(--accent, #0b5cab) 12%, transparent); border-radius: 4px; padding: 1px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-more { font-size: .68rem; color: var(--muted); }
.cal-n { display: none; }
@media (max-width: 640px) {
  .cal-cell { min-height: 52px; align-items: center; }
  .cal-ev, .cal-more { display: none; }
  .cal-n { display: inline-block; min-width: 20px; text-align: center; font-size: .7rem; font-weight: 800; background: var(--accent, #0b5cab); color: #fff; border-radius: 999px; }
}
.ev-list { list-style: none; margin: 0; padding: 0; }
.ev { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.ev .badge { flex: none; width: 46px; text-align: center; border: 1px solid var(--rule); border-radius: 8px; padding: 3px 0; line-height: 1.1; }
.ev .badge span { display: block; font-size: .64rem; font-weight: 800; text-transform: uppercase; color: var(--bad); }
.ev .badge b { font-family: var(--serif); font-size: 1.2rem; }
.ev-t a, .ev-t span { font-weight: 700; color: var(--ink); text-decoration: none; }
.ev-t a:hover { text-decoration: underline; }
.map { height: 460px; border-radius: 10px; border: 1px solid var(--rule); z-index: 0; }
@media (max-width: 640px) { .map { height: 340px; } }
.map-note { margin: 8px 0 14px; }
.map-list { list-style: none; margin: 0; padding: 0; }
.map-list li { padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: .92rem; }
.map-list a, .map-list span { color: var(--ink); text-decoration: none; }
.map-list small { color: var(--muted); }
.chipbtn.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
#map-cats .chipbtn.on { background: hsl(var(--h), 60%, 40%); border-color: hsl(var(--h), 60%, 40%); color: #fff; }

/* ---- Follow topics ---- */
.hide-nomatch { display: none !important; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-size: .8rem; font-weight: 600; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--rule); background: transparent; color: var(--muted); cursor: pointer; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.fol-form { display: flex; gap: 6px; margin-bottom: 8px; }
.fol-form input { flex: 1; min-width: 0; }
.item.is-follow .t, .hero.is-follow .t, .sub.is-follow .t { text-decoration: underline; text-decoration-color: var(--accent, #0b5cab); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.foot-links a { color: var(--muted); }

/* ---- Public forms, sponsors ---- */
.lede { color: var(--muted); max-width: 60ch; margin: 6px 0 16px; }
.pubform { display: grid; gap: 12px; max-width: 520px; }
.pubform label { display: grid; gap: 4px; font-size: .86rem; font-weight: 600; }
.pubform input, .pubform select, .pubform textarea { font: inherit; padding: 9px 11px; border: 1px solid var(--rule); border-radius: 8px; background: var(--bg); color: var(--ink); }
.pubform .row { display: flex; gap: 10px; } .pubform .row label { flex: 1; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sub-main .flash { margin: 8px 0 14px; padding: 10px 14px; border-radius: 8px; }
.sub-main .flash.ok { background: #e8f6ee; color: #14633f; } .sub-main .flash.err { background: #fdecea; color: #8c1f13; }
.sponsor { display: block; border: 1px solid var(--rule); border-radius: 10px; padding: 12px 14px; margin: 0 0 16px; text-decoration: none; color: var(--ink); background: var(--paper); }
.sponsor small { display: block; font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--faint); margin-bottom: 4px; }
.sponsor strong { display: block; font-family: var(--serif); font-size: 1.05rem; }
.sponsor span { display: block; color: var(--muted); font-size: .88rem; margin-top: 2px; }
.sponsor img { display: block; max-width: 100%; max-height: 90px; margin: 0 0 8px; border-radius: 6px; }
.sponsor:hover strong { text-decoration: underline; }
.bars.hours { gap: 3px; }
.src.done { opacity: .6; }
.card > .acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
