/* ==========================================================================
   feed.css — Waarning live feed presentation layer (/warnings/live/)
   --------------------------------------------------------------------------
   Pairs with feed.js. Styles only the live feed + warning detail surfaces and
   is scoped to the feed root so the home / cockpit `.feed-panel` styles in
   site.css are never touched.

   Root (one of, preferably on <main> or a wrapper inside .shell):
     <main class="feed-page" data-feed data-scope="global" data-page="1">
   or
     <div data-feed data-scope="local"> ... </div>

   Design tokens come from frontend/assets/site.css (--paper, --ink, --rust,
   --p0..--p4, --display, --sans, --mono, --radius, --shadow). This file adds
   only feed-scoped variables:
     --feed-top            sticky offset below the sticky site topbar
     --feed-card-min       minimum card width in the responsive grid
     --feed-heat           attention-bar fill, set inline by PHP or feed.js

   Class / data-attribute contract (also documented at the top of feed.js):
     [data-feed]                     root; data-scope=global|local is required
     .feed-toolbar                   sticky toolbar (contains the form)
     [data-feed-form]                the GET form
     [data-scope-set=global|local]   scope switch (submit button, radio or link)
     [data-near-me]                  geolocation button
     [data-place-label]              current place text (textContent only)
     [data-radius-output]            human "250 km" output
     [data-clear-search]             clear-search button
     [data-feed-set="name:value"]    optional non-form filter control
     [data-feed-unset="name"]        optional chip-as-button
     [data-clear-all]                clear every transient filter
     [data-feed-status]              polite live region
     [data-feed-error]              JS error box (role=alert)
     [data-feed-results]             results container (aria-busy managed)
     [data-feed-loading]             optional loading block, shown by JS
     [data-feed-empty]               server empty state
     [data-feed-error-state]         server error/no-data state
     [data-heat][data-score][data-max] attention meter
     [data-feed-age]                 <time datetime> enhanced to relative age
     .feed-card[data-priority=P0..P4] result card
     .feed-chip[data-facet][data-value] facet/active chip (anchor is fine)
     .feed-pagination               page links
     .feed-detail                    detail page article

   Personalisation — added by feed.js at runtime, documented in the layer at
   the end of this file. None of it exists without JavaScript:
     .feed-tools / .feed-you / .feed-tool   For you · Views · ? controls
     .feed-you-status                       mode line inside the sticky toolbar
     .feed-you-panel                        what is followed, or the explainer
     .feed-you-empty                        "nothing on this page matches"
     .feed-follow / .feed-star              follow star beside a facet chip
     .feed-views / .feed-views__*           named local views
     .feed-help / .feed-help__*             keyboard shortcut sheet
     .feed-card__new / .feed-new-count      NEW from real lastVisit data
     .feed-card.is-focused                  keyboard focus ring
     .feed-empty__filters                   per-filter empty state

   No JavaScript is required for layout: the form is a normal GET form and all
   chips/pagination are links. JS only adds geolocation, auto-submit, relative
   ages, meters, loading/error feedback and the personalisation layer.
   ========================================================================== */

/* ---------- root ---------- */
:where(.feed-page, .feed, [data-feed]) {
  --feed-top: 84px;
  --feed-card-min: 304px;
  --feed-line: var(--line);
  --feed-line-strong: var(--line-strong);
  position: relative;
  width: 100%;
  min-width: 0;
  padding-bottom: clamp(42px, 7vw, 76px);
  font-family: var(--sans);
}

:where(.feed-page, .feed, [data-feed]):not(body) {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: clamp(14px, 2.8vw, 24px);
}

/* Detail pages do not need the feed wrapper. */
.feed-detail-page {
  --feed-top: 84px;
  width: 100%;
  max-width: var(--max);
  min-width: 0;
  margin-inline: auto;
  padding-inline: clamp(14px, 2.8vw, 24px);
  padding-bottom: clamp(42px, 7vw, 76px);
}

/* Any feed-scoped [hidden] must win over display rules below. */
:where(.feed-page, .feed, [data-feed]) [hidden],
.feed-detail-page [hidden] {
  display: none !important;
}

/* ---------- hero ---------- */
.feed-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(260px, .88fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: end;
  padding: clamp(8px, 2vw, 22px) 0 clamp(18px, 3vw, 26px);
  border-bottom: 1px solid var(--feed-line);
  min-width: 0;
}

.feed-hero h1 {
  font: 600 clamp(40px, 6.2vw, 74px)/.94 var(--display);
  letter-spacing: -.055em;
  margin: 0 0 14px;
  max-width: 16ch;
  color: var(--ink);
  overflow-wrap: break-word;
}

.feed-hero h1 em {
  font-style: normal;
  color: var(--rust);
}

.feed-lede {
  margin: 0;
  max-width: 64ch;
  font-size: clamp(13px, 1.5vw, 15.5px);
  line-height: 1.62;
  color: var(--ink-2);
}

.feed-hero__note {
  border-left: 2px solid var(--rust);
  padding: 2px 0 2px 15px;
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
  min-width: 0;
}

.feed-hero__note b {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font: 700 9px/1.5 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ---------- sticky toolbar ---------- */
.feed-toolbar {
  position: sticky;
  top: var(--feed-top);
  z-index: 34;
  margin: clamp(14px, 2.4vw, 20px) 0 0;
  background: rgba(248, 242, 227, .96);
  border: 1px solid var(--feed-line-strong);
  border-radius: 17px;
  box-shadow: 0 12px 34px rgba(49, 38, 20, .11);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: box-shadow .18s ease, border-color .18s ease;
  min-width: 0;
}

.feed-toolbar.is-stuck {
  box-shadow: 0 20px 52px rgba(49, 38, 20, .20);
  border-color: rgba(23, 35, 29, .48);
}

.feed-toolbar:focus-within {
  border-color: rgba(23, 35, 29, .55);
}

/* A local view is deliberately obvious: rust edge + tinted place row. */
[data-scope="local"] .feed-toolbar {
  border-color: rgba(183, 71, 42, .52);
}

[data-scope="local"] .feed-toolbar.is-stuck {
  box-shadow: 0 20px 52px rgba(142, 50, 29, .22);
}

.feed-form {
  display: block;
  padding: 10px 12px 12px;
  min-width: 0;
}

.feed-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

/* ---------- scope switch ---------- */
.feed-scope {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: none;
  padding: 3px;
  background: var(--paper-3);
  border: 1px solid var(--feed-line);
  border-radius: 10px;
  min-width: 0;
}

.feed-scope button,
.feed-scope a {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 8px 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-2);
  font: 700 8.5px/1 var(--mono);
  letter-spacing: .09em;
  text-transform: uppercase;
  white-space: nowrap;
}

.feed-scope button::before,
.feed-scope a::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .55;
  flex: none;
}

.feed-scope button:hover,
.feed-scope a:hover {
  background: rgba(23, 35, 29, .07);
  color: var(--ink);
}

.feed-scope [aria-pressed="true"],
.feed-scope [aria-current="page"],
.feed-scope .is-active {
  background: var(--ink);
  color: var(--paper-2);
}

.feed-scope [data-scope-set="local"][aria-pressed="true"],
.feed-scope [data-scope-set="local"][aria-current="page"],
.feed-scope [data-scope-set="local"].is-active {
  background: var(--rust);
  color: #fff8ec;
}

.feed-scope [aria-pressed="true"]::before,
.feed-scope [aria-current="page"]::before,
.feed-scope .is-active::before {
  opacity: 1;
}

/* ---------- near me ---------- */
.feed-near {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: none;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--rust);
  border-radius: 9px;
  background: var(--rust);
  color: #fff8ec;
  font: 700 8.5px/1 var(--mono);
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.feed-near:hover {
  background: var(--rust-dark);
  border-color: var(--rust-dark);
}

.feed-near svg {
  width: 14px;
  height: 14px;
  flex: none;
}

.feed-near[aria-busy="true"],
.feed-near.is-busy {
  opacity: .68;
  cursor: progress;
}

/* ---------- search ---------- */
.feed-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 230px;
  min-width: 0;
  min-height: 38px;
  padding: 0 5px 0 10px;
  background: #fffaf0;
  border: 1px solid var(--feed-line);
  border-radius: 9px;
}

.feed-search:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(23, 35, 29, .08);
}

.feed-search > svg {
  width: 14px;
  height: 14px;
  flex: none;
  margin-right: 6px;
  color: var(--muted);
}

.feed-search input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 9px 2px;
  font: 500 12.5px/1.4 var(--sans);
  color: var(--ink);
}

.feed-search input::placeholder {
  color: #8d917f;
}

.feed-search [data-clear-search] {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(23, 35, 29, .09);
  color: var(--ink-2);
  font: 700 12px/1 var(--sans);
}

.feed-search [data-clear-search]:hover {
  background: rgba(23, 35, 29, .16);
  color: var(--ink);
}

/* ---------- sort ---------- */
.feed-sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  min-width: 0;
}

.feed-sort > span,
.feed-sort > label {
  font: 700 7.5px/1 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- generic toolbar controls ---------- */
.feed-form > :is(select, input[type="search"], input[type="text"], input[type="number"]),
.feed-bar > :is(select, input[type="search"], input[type="text"], input[type="number"]),
.feed-sort > select,
.feed-field > :is(select, input[type="search"], input[type="text"], input[type="number"]) {
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--feed-line);
  border-radius: 9px;
  background: var(--paper-2);
  color: var(--ink);
  font: 600 11.5px/1 var(--sans);
}

.feed-form select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 27px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2317231d' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 10px 6px;
  cursor: pointer;
}

.feed-form > :is(select, input[type="search"], input[type="text"], input[type="number"]):focus-visible,
.feed-bar > :is(select, input[type="search"], input[type="text"], input[type="number"]):focus-visible,
.feed-field > :is(select, input[type="search"], input[type="text"], input[type="number"]):focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 1px;
}

.feed-apply {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  border-radius: 9px;
  background: var(--ink);
  color: var(--paper-2);
  font: 700 8.5px/1 var(--mono);
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.feed-apply:hover {
  background: var(--ink-2);
}

/* ---------- place / radius row ---------- */
.feed-place-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 14px;
  margin-top: 8px;
  min-width: 0;
}

.feed-place {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  min-width: 0;
  max-width: 100%;
  font: 600 8.5px/1.4 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

.feed-place svg {
  width: 12px;
  height: 12px;
  flex: none;
  color: var(--rust);
}

.feed-place b,
.feed-place [data-place-label] {
  min-width: 0;
  max-width: 44ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-weight: 700;
}

.feed-place .feed-radius,
.feed-place [data-radius-output] {
  color: var(--teal);
  font-weight: 700;
  white-space: nowrap;
}

.feed-scope-note {
  display: none;
  align-items: center;
  gap: 6px;
  margin: 0;
  min-width: 0;
  font: 600 8.5px/1.4 var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--rust-dark);
}

.feed-scope-note::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--rust);
  box-shadow: 0 0 0 3px rgba(183, 71, 42, .12);
}

[data-scope="local"] .feed-scope-note {
  display: inline-flex;
}

.feed-radius-hint {
  margin: 0;
  font: 500 9px/1.5 var(--mono);
  color: var(--muted);
}

/* ---------- facet controls ---------- */
.feed-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 7px;
  margin-top: 9px;
  min-width: 0;
}

.feed-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.feed-field > span,
.feed-field > label {
  font: 700 7.5px/1 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.feed-field :is(select, input[type="search"], input[type="text"], input[type="number"]) {
  width: 100%;
  background: var(--paper-2);
  font-size: 11px;
}

.feed-field--wide {
  grid-column: span 2;
}

.feed-field--radius {
  justify-content: flex-end;
}

.feed-range {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 36px;
  padding: 0 8px;
  border: 1px solid var(--feed-line);
  border-radius: 8px;
  background: var(--paper-2);
}

.feed-range input[type="range"] {
  flex: 1 1 auto;
  width: 100%;
  min-width: 40px;
  height: 22px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--rust);
  cursor: pointer;
}

.feed-range output,
.feed-range [data-radius-output] {
  flex: none;
  min-width: 47px;
  text-align: right;
  font: 700 8.5px/1 var(--mono);
  color: var(--ink);
  white-space: nowrap;
}

/* Optional <details> filter disclosure: keeps the mobile toolbar short
   without breaking the no-JS form. */
details.feed-filters {
  display: block;
  margin-top: 8px;
}

details.feed-filters > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--feed-line);
  border-radius: 8px;
  background: var(--paper-2);
  font: 700 8px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-2);
  cursor: pointer;
  list-style: none;
}

details.feed-filters > summary::-webkit-details-marker {
  display: none;
}

details.feed-filters > summary::after {
  content: "+";
  font: 700 12px/1 var(--mono);
  color: var(--rust);
}

details.feed-filters[open] > summary::after {
  content: "−";
}

details.feed-filters > summary:hover {
  border-color: var(--ink);
}

details.feed-filters > .feed-filters__grid,
details.feed-filters > .feed-filters-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 7px;
  margin-top: 7px;
  min-width: 0;
}

.feed-filters-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--feed-line);
  border-radius: 8px;
  background: var(--paper-2);
  font: 700 8px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.feed-filters-toggle[aria-expanded="true"] {
  border-color: var(--ink);
  color: var(--ink);
}

.feed-filters-toggle b {
  color: var(--rust);
}

/* ---------- active chips ---------- */
.feed-active {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 9px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px dotted var(--feed-line);
  min-width: 0;
}

.feed-active__label {
  flex: none;
  font: 700 7.5px/1 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.feed-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.feed-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  min-height: 25px;
  padding: 4px 8px;
  border: 1px solid var(--feed-line);
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-2);
  font: 600 8.5px/1.2 var(--mono);
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.feed-chip b,
.feed-chip .feed-chip__count {
  color: var(--muted);
  font-weight: 700;
}

.feed-chip:hover {
  border-color: var(--rust);
  color: var(--rust);
}

.feed-chip__x {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(23, 35, 29, .08);
  font: 700 10px/1 var(--sans);
  color: var(--ink-2);
}

.feed-chip:hover .feed-chip__x {
  background: rgba(183, 71, 42, .13);
  color: var(--rust-dark);
}

.feed-chip--active,
.feed-chip[aria-current="true"],
.feed-chip.is-active {
  border-color: rgba(183, 71, 42, .45);
  background: rgba(183, 71, 42, .08);
  color: var(--rust-dark);
}

.feed-chip[data-priority="P0"],
.feed-chip[data-value="P0"] {
  border-left: 3px solid var(--p0);
}

.feed-chip[data-priority="P1"],
.feed-chip[data-value="P1"] {
  border-left: 3px solid var(--p1);
}

.feed-chip[data-priority="P2"],
.feed-chip[data-value="P2"] {
  border-left: 3px solid var(--p2);
}

.feed-chip[data-priority="P3"],
.feed-chip[data-value="P3"] {
  border-left: 3px solid var(--p3);
}

.feed-chip[data-priority="P4"],
.feed-chip[data-value="P4"] {
  border-left: 3px solid var(--p4);
}

.feed-clear {
  margin-left: auto;
  flex: none;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--rust);
  font: 700 8px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.feed-clear:hover {
  color: var(--ink);
}

.feed-chip-empty {
  font: 600 8.5px/1.4 var(--mono);
  color: var(--soft);
  letter-spacing: .03em;
}

/* Facet groups with counts, if PHP renders them as a scan row. */
.feed-facets {
  display: grid;
  gap: 5px;
  margin-top: 9px;
  min-width: 0;
}

.feed-facet {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
}

.feed-facet__label {
  flex: none;
  width: 62px;
  padding-top: 6px;
  font: 700 7px/1 var(--mono);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}

.feed-facet__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

/* ---------- status + JS error ---------- */
.feed-status {
  margin: 8px 0 0;
  font: 600 9px/1.5 var(--mono);
  color: var(--teal);
}

.feed-status:empty {
  display: none;
}

.feed-error {
  margin: 8px 0 0;
  padding: 9px 11px;
  border: 1px solid rgba(183, 71, 42, .45);
  border-left: 3px solid var(--rust);
  border-radius: 8px;
  background: rgba(183, 71, 42, .06);
  color: var(--rust-dark);
  font-size: 11.5px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

/* ---------- results header ---------- */
.feed-results-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 5px 16px;
  margin: clamp(18px, 2.6vw, 24px) 0 9px;
  min-width: 0;
}

.feed-results-head p {
  margin: 0;
  font: 600 8.5px/1.5 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

.feed-results-head b {
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
}

.feed-results-head .feed-updated {
  color: var(--soft);
  text-transform: none;
  letter-spacing: .02em;
}

.feed-results-head .feed-updated a {
  color: var(--teal);
}

/* ---------- cards ---------- */
.feed-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--feed-card-min)), 1fr));
  gap: 7px;
  align-items: stretch;
  min-width: 0;
}

.feed-card {
  --p: var(--p4);
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 11px 13px 10px;
  background: var(--paper-2);
  border: 1px solid var(--feed-line);
  border-left: 4px solid var(--p);
  border-radius: 13px;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.feed-card[data-priority="P0"],
.feed-card[data-p="P0"],
.feed-card.P0 { --p: var(--p0); }
.feed-card[data-priority="P1"],
.feed-card[data-p="P1"],
.feed-card.P1 { --p: var(--p1); }
.feed-card[data-priority="P2"],
.feed-card[data-p="P2"],
.feed-card.P2 { --p: var(--p2); }
.feed-card[data-priority="P3"],
.feed-card[data-p="P3"],
.feed-card.P3 { --p: var(--p3); }
.feed-card[data-priority="P4"],
.feed-card[data-p="P4"],
.feed-card.P4 { --p: var(--p4); }

.feed-card:hover {
  border-color: rgba(23, 35, 29, .42);
  border-left-color: var(--p);
  box-shadow: 0 14px 34px rgba(49, 38, 20, .13);
  transform: translateY(-1px);
}

.feed-card:focus-within {
  border-color: var(--ink);
}

.feed-card__head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
  min-width: 0;
}

.feed-card .pri,
.feed-pri {
  display: inline-grid;
  place-items: center;
  flex: none;
  min-width: 28px;
  height: 19px;
  padding: 0 5px;
  border-radius: 3px;
  background: var(--p);
  color: #fff;
  font: 800 8.5px/1 var(--mono);
  letter-spacing: .04em;
}

.feed-card .pri.P0 { background: var(--p0); }
.feed-card .pri.P1 { background: var(--p1); }
.feed-card .pri.P2 { background: var(--p2); }
.feed-card .pri.P3 { background: var(--p3); }
.feed-card .pri.P4 { background: var(--p4); }

.feed-card__cat,
.feed-cat {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 700 7.5px/1 var(--mono);
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}

.feed-card__age {
  margin-left: auto;
  flex: none;
  font: 600 7.5px/1 var(--mono);
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--soft);
  white-space: nowrap;
}

.feed-card__age time {
  font: inherit;
  color: inherit;
}

.feed-card__title,
.feed-card > h2,
.feed-card > h3 {
  margin: 0 0 4px;
  font: 600 clamp(16.5px, 2vw, 19.5px)/1.14 var(--display);
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}

.feed-card__title a,
.feed-card > h2 a,
.feed-card > h3 a {
  color: var(--ink);
}

.feed-card__title a:hover,
.feed-card > h2 a:hover,
.feed-card > h3 a:hover {
  color: var(--rust);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.feed-card__summary,
.feed-card > p {
  margin: 0 0 7px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.feed-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-top: auto;
  padding-top: 0;
  min-width: 0;
  font: 600 7.5px/1.4 var(--mono);
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--soft);
}

.feed-card__meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-card__meta b {
  color: var(--ink);
  font-weight: 700;
}

.feed-card__meta .feed-card__source {
  color: var(--ink-2);
}

.feed-card__meta .feed-card__distance {
  color: var(--teal);
  font-weight: 700;
}

.feed-card__meta .feed-card__country {
  color: var(--muted);
}

.feed-card__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dotted var(--feed-line);
  min-width: 0;
}

/* ---------- attention heat bar ---------- */
.feed-heat {
  display: grid;
  gap: 3px;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 250px;
}

.feed-heat__label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font: 700 7px/1.2 var(--mono);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}

.feed-heat__label b {
  color: var(--ink);
  font-weight: 700;
}

.feed-heat__label small {
  font: inherit;
  color: var(--soft);
  letter-spacing: .03em;
}

.feed-heat__track {
  position: relative;
  display: block;
  height: 5px;
  border-radius: 3px;
  background: rgba(23, 35, 29, .12);
  overflow: hidden;
}

.feed-heat__track::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(90deg, transparent 0 8px, rgba(239, 230, 212, .62) 8px 9px);
}

.feed-heat__fill {
  display: block;
  height: 100%;
  width: max(var(--heat, 0%), 4px);
  border-radius: 3px;
  background: var(--p, var(--rust));
  transition: width .35s ease;
}

.feed-heat[data-heat-level="low"] .feed-heat__fill {
  opacity: .7;
}

.feed-card__open,
.feed-open {
  flex: none;
  padding: 2px 0;
  color: var(--rust);
  font: 700 7.5px/1 var(--mono);
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.feed-card__open:hover,
.feed-open:hover {
  color: var(--ink);
}

.feed-card__open span,
.feed-open span {
  display: inline-block;
  transition: transform .15s ease;
}

.feed-card__open:hover span,
.feed-open:hover span {
  transform: translateX(2px);
}

/* ---------- empty / error / loading states ---------- */
.feed-state {
  margin: 10px 0;
  padding: clamp(20px, 4vw, 34px) clamp(16px, 3vw, 26px);
  border: 1px dashed var(--feed-line-strong);
  border-radius: 14px;
  background: rgba(248, 242, 227, .62);
  text-align: center;
  color: var(--muted);
  min-width: 0;
}

.feed-state h2,
.feed-state b.feed-state__title {
  display: block;
  margin: 0 0 6px;
  font: 600 clamp(20px, 3vw, 26px)/1.1 var(--display);
  letter-spacing: -.02em;
  color: var(--ink);
}

.feed-state p {
  margin: 0 auto 9px;
  max-width: 58ch;
  font-size: 12.5px;
  line-height: 1.62;
}

.feed-state p:last-child {
  margin-bottom: 0;
}

.feed-state a {
  color: var(--rust);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.feed-empty {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.feed-error-state {
  border-style: solid;
  border-color: rgba(183, 71, 42, .45);
  border-left: 4px solid var(--rust);
  background: rgba(183, 71, 42, .055);
  text-align: left;
  color: var(--rust-dark);
}

.feed-error-state h2 {
  color: var(--rust-dark);
}

.feed-local-missing {
  border-style: solid;
  border-color: rgba(194, 122, 30, .5);
  border-left: 4px solid var(--amber);
  background: rgba(194, 122, 30, .06);
  text-align: left;
}

.feed-local-missing h2 {
  color: var(--ink);
}

.feed-local-missing .feed-local-missing__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.feed-local-missing .btn {
  flex: 0 1 auto;
}

.feed-loading {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 8px;
  margin: 10px 0;
}

.feed-skel {
  height: 172px;
  border: 1px solid var(--feed-line);
  border-radius: 13px;
  background:
    linear-gradient(100deg, rgba(248, 242, 227, .4) 20%, rgba(255, 250, 240, .85) 40%, rgba(248, 242, 227, .4) 60%) 0 0 / 220% 100%,
    var(--paper-3);
  animation: feed-shimmer 1.25s linear infinite;
}

.feed-loading__note {
  grid-column: 1 / -1;
  margin: 0;
  font: 600 9px/1.5 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

@keyframes feed-shimmer {
  from { background-position: 120% 0, 0 0; }
  to { background-position: -120% 0, 0 0; }
}

/* JS injects this if the page has no [data-feed-progress]. */
.feed-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 90;
  height: 3px;
  pointer-events: none;
  background: rgba(183, 71, 42, .12);
}

.feed-progress i {
  display: block;
  width: 38%;
  height: 100%;
  background: var(--rust);
  animation: feed-progress 1.1s ease-in-out infinite;
}

@keyframes feed-progress {
  0% { transform: translateX(-105%); }
  100% { transform: translateX(370%); }
}

[data-feed].is-loading [data-feed-results] {
  opacity: .5;
  pointer-events: none;
  transition: opacity .15s ease;
}

/* ---------- pagination ---------- */
.feed-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  margin: clamp(20px, 3vw, 28px) 0 4px;
  min-width: 0;
}

.feed-pagination a,
.feed-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 9px;
  border: 1px solid var(--feed-line);
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--ink-2);
  font: 700 9px/1 var(--mono);
  letter-spacing: .03em;
  white-space: nowrap;
}

.feed-pagination a:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: #fffaf0;
}

.feed-pagination [aria-current="page"],
.feed-pagination .is-current {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper-2);
}

.feed-pagination .feed-page-gap,
.feed-pagination .feed-pagination__gap {
  min-width: 20px;
  border: 0;
  background: transparent;
  color: var(--soft);
}

.feed-pagination .feed-page-prev,
.feed-pagination .feed-page-next {
  padding: 0 12px;
}

.feed-pagination [aria-disabled="true"] {
  opacity: .38;
  pointer-events: none;
}

/* ---------- method note / footnotes ---------- */
.feed-method {
  margin: clamp(16px, 2.4vw, 22px) 0 0;
  padding: 10px 12px;
  border: 1px solid var(--feed-line);
  border-radius: 10px;
  background: rgba(248, 242, 227, .68);
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--muted);
}

.feed-method summary {
  cursor: pointer;
  font: 700 8px/1.5 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.feed-method summary:hover {
  color: var(--rust);
}

.feed-method p {
  margin: 7px 0 0;
  max-width: 92ch;
  overflow-wrap: anywhere;
}

.feed-method code {
  font-family: var(--mono);
  font-size: .94em;
  color: var(--ink-2);
}

.feed-note {
  margin: clamp(16px, 2.4vw, 22px) 0 0;
  max-width: 96ch;
  font-size: 10.5px;
  line-height: 1.65;
  color: var(--muted);
}

.feed-note a {
  color: var(--rust);
  font-weight: 700;
}

.feed-updated-note {
  font: 600 8px/1.5 var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--soft);
}

/* ---------- detail page ---------- */
.feed-detail {
  --p: var(--p4);
  position: relative;
  width: 100%;
  max-width: 940px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px);
  background: var(--paper-2);
  border: 1px solid var(--feed-line-strong);
  border-top: 5px solid var(--p);
  border-radius: 20px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.feed-detail[data-priority="P0"] { --p: var(--p0); }
.feed-detail[data-priority="P1"] { --p: var(--p1); }
.feed-detail[data-priority="P2"] { --p: var(--p2); }
.feed-detail[data-priority="P3"] { --p: var(--p3); }
.feed-detail[data-priority="P4"] { --p: var(--p4); }

.feed-detail .kicker {
  margin: 0 0 10px;
}

.feed-detail h1 {
  margin: 0 0 12px;
  font: 600 clamp(32px, 5.2vw, 56px)/.98 var(--display);
  letter-spacing: -.045em;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.feed-detail__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 0 0 16px;
  font: 600 8.5px/1.5 var(--mono);
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
}

.feed-detail__meta b {
  color: var(--ink);
  font-weight: 700;
}

.feed-detail__summary {
  margin: 0 0 18px;
  max-width: 72ch;
  font-size: clamp(14px, 1.8vw, 17px);
  line-height: 1.72;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.feed-detail__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  margin: 18px 0;
  border: 1px solid var(--feed-line);
  border-radius: 12px;
  background: var(--feed-line);
  overflow: hidden;
}

.feed-detail__facts > div {
  min-width: 0;
  padding: 10px 12px;
  background: var(--paper);
}

.feed-detail__facts dt,
.feed-detail__facts .feed-fact__label {
  margin: 0;
  font: 700 7px/1.3 var(--mono);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}

.feed-detail__facts dd,
.feed-detail__facts .feed-fact__value {
  margin: 3px 0 0;
  font: 600 12px/1.45 var(--sans);
  color: var(--ink);
  overflow-wrap: anywhere;
}

.feed-detail__source {
  margin: 18px 0 0;
  padding: 13px 14px;
  border: 1px solid var(--feed-line);
  border-left: 3px solid var(--teal);
  border-radius: 10px;
  background: rgba(47, 111, 104, .05);
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.feed-detail__source b {
  color: var(--ink);
  font: 700 8px/1.4 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.feed-detail__source a {
  color: var(--rust);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.feed-detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
}

.feed-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 16px 0 0;
  color: var(--rust);
  font: 700 8.5px/1 var(--mono);
  letter-spacing: .07em;
  text-transform: uppercase;
}

.feed-back:hover {
  color: var(--ink);
}

.feed-related {
  margin-top: clamp(24px, 4vw, 38px);
}

.feed-related h2 {
  margin: 0 0 9px;
  font: 600 24px/1.05 var(--display);
  letter-spacing: -.03em;
}

.feed-related .feed-results {
  --feed-card-min: 250px;
}

.feed-coords {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .02em;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .feed-hero {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .feed-hero h1 {
    max-width: 20ch;
  }
}

@media (max-width: 980px) {
  :where(.feed-page, .feed, [data-feed]) {
    --feed-top: 72px;
  }

  .feed-detail-page {
    --feed-top: 72px;
  }

  .feed-toolbar {
    border-radius: 15px;
  }

  .feed-results {
    --feed-card-min: 288px;
  }
}

@media (max-width: 760px) {
  .feed-form {
    padding: 9px 9px 10px;
  }

  .feed-bar {
    gap: 6px;
  }

  .feed-search {
    flex: 1 1 100%;
    order: -1;
  }

  .feed-scope {
    flex: 1 1 auto;
  }

  .feed-scope button,
  .feed-scope a {
    flex: 1 1 auto;
  }

  .feed-near {
    flex: 0 0 auto;
  }

  .feed-sort {
    flex: 1 1 140px;
  }

  .feed-sort select {
    flex: 1 1 auto;
    width: 100%;
  }

  .feed-apply {
    flex: 0 0 auto;
  }

  .feed-filters {
    grid-template-columns: 1fr 1fr;
  }

  .feed-filters-toggle {
    display: inline-flex;
  }

  .feed-field--wide,
  .feed-field--radius {
    grid-column: 1 / -1;
  }

  .feed-results {
    grid-template-columns: 1fr;
  }

  .feed-results-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .feed-card {
    padding: 11px 12px 10px;
  }

  .feed-heat {
    max-width: none;
  }

  .feed-detail {
    border-radius: 16px;
    border-top-width: 4px;
  }

  .feed-detail__facts {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  :where(.feed-page, .feed, [data-feed]) {
    --feed-top: 68px;
    padding-bottom: 46px;
  }

  .feed-page .feed-form,
  .feed .feed-form,
  [data-feed] .feed-form {
    padding: 8px;
  }

  .feed-hero {
    padding-top: 4px;
  }

  .feed-hero h1 {
    font-size: clamp(36px, 11.5vw, 46px);
    letter-spacing: -.05em;
  }

  .feed-toolbar {
    margin-top: 12px;
    border-radius: 13px;
  }

  .feed-scope {
    width: 100%;
    flex: 1 1 100%;
  }

  .feed-near {
    flex: 1 1 100%;
    min-height: 40px;
  }

  .feed-sort {
    flex: 1 1 100%;
  }

  .feed-sort > span {
    min-width: 34px;
  }

  .feed-filters {
    grid-template-columns: 1fr;
  }

  .feed-field--wide,
  .feed-field--radius {
    grid-column: 1;
  }

  .feed-place {
    width: 100%;
  }

  .feed-place b,
  .feed-place [data-place-label] {
    max-width: 100%;
    flex: 1 1 auto;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .feed-active {
    align-items: flex-start;
  }

  .feed-clear {
    margin-left: 0;
    padding: 6px 0;
  }

  .feed-card__age {
    font-size: 7px;
  }

  .feed-card__foot {
    flex-wrap: wrap;
    gap: 7px;
  }

  .feed-heat {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .feed-card__open {
    margin-left: auto;
  }

  .feed-pagination a,
  .feed-pagination span {
    min-width: 34px;
    height: 34px;
    padding: 0 7px;
    font-size: 8.5px;
  }

  .feed-detail {
    padding: 18px 15px;
  }

  .feed-detail__facts {
    grid-template-columns: 1fr;
  }

  .feed-detail__actions .btn {
    flex: 1 1 auto;
  }

  .feed-facet {
    flex-direction: column;
    gap: 3px;
  }

  .feed-facet__label {
    width: auto;
    padding-top: 0;
  }
}

/* Very narrow fallback (still no horizontal scroll). */
@media (max-width: 370px) {
  .feed-near {
    width: 100%;
  }

  .feed-sort {
    width: 100%;
  }

  .feed-form :is(select, input[type="search"], input[type="text"], input[type="number"]) {
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .feed-card,
  .feed-heat__fill,
  .feed-card__open span,
  .feed-open span,
  .feed-toolbar {
    transition: none;
  }

  .feed-skel,
  .feed-progress i {
    animation: none;
  }
}

@media print {
  .feed-toolbar,
  .feed-navigation,
  .feed-card__open {
    display: none !important;
  }

  .feed-card {
    break-inside: avoid;
    box-shadow: none;
  }
}

/* V4 situation support: many notices, one card. */
.feed-card__support{font:700 7px/1.2 var(--mono,ui-monospace,monospace);letter-spacing:.04em;text-transform:uppercase;color:var(--rust,#b7472a);white-space:nowrap}
.feed-card__source + .feed-card__support{margin-left:4px}

/* ==========================================================================
   Personalisation layer — added by feed.js only
   --------------------------------------------------------------------------
   None of this exists until feed.js runs, so a visitor without JavaScript
   never sees a control that cannot work and the server-rendered toolbar,
   facets and cards keep their shape. Every count shown here is computed
   from cards already on the page or from the URL. Nothing is invented.
   ========================================================================== */

/* The mode is visible twice: on the toggle and as a rule on the sticky
   toolbar, so a filtered feed never looks like a feed without matches. */
[data-for-you="true"] .feed-toolbar {
  border-color: rgba(183, 71, 42, .5);
}

[data-for-you="true"] .feed-toolbar.is-stuck {
  box-shadow: 0 20px 52px rgba(142, 50, 29, .22);
}

/* ---------- toolbar tools: For you · Views · ? ---------- */
.feed-tools {
  display: inline-flex;
  align-items: stretch;
  gap: 6px;
  flex: 0 0 auto;
  min-width: 0;
}

.feed-you,
.feed-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--feed-line-strong);
  border-radius: 9px;
  background: var(--paper-2);
  color: var(--ink-2);
  font: 700 8.5px/1 var(--mono);
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
}

.feed-you:hover,
.feed-tool:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: #fffaf0;
}

.feed-you__mark,
.feed-tool__mark {
  display: inline-grid;
  place-items: center;
  width: 13px;
  height: 13px;
  flex: none;
  color: var(--rust);
}

.feed-you__mark svg,
.feed-tool__mark svg {
  width: 13px;
  height: 13px;
}

.feed-tool--icon {
  width: 34px;
  padding: 0;
  font: 700 12px/1 var(--mono);
  color: var(--muted);
}

.feed-you[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper-2);
}

.feed-you[aria-pressed="true"] .feed-you__mark {
  color: var(--paper-2);
}

.feed-you[aria-pressed="true"] .feed-you__mark svg {
  fill: currentColor;
}

.feed-tool.is-open {
  border-color: var(--ink);
  color: var(--ink);
  background: #fffaf0;
}

.feed-you:focus-visible,
.feed-tool:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 1px;
}

/* compact state line inside the sticky toolbar */
.feed-you-status {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 8px 0 0;
  min-width: 0;
  font: 600 8.5px/1.4 var(--mono);
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--rust-dark);
}

.feed-you-status::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--rust);
  box-shadow: 0 0 0 3px rgba(183, 71, 42, .12);
}

/* ---------- follow star next to a facet chip ---------- */
.feed-follow {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.feed-star {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--feed-line);
  border-radius: 50%;
  background: var(--paper-2);
  color: var(--soft);
  cursor: pointer;
  transition: color .12s ease, border-color .12s ease, background .12s ease;
}

.feed-star__mark {
  display: inline-grid;
  place-items: center;
  width: 12px;
  height: 12px;
}

.feed-star svg {
  width: 12px;
  height: 12px;
  fill: none;
}

.feed-star:hover {
  color: var(--rust);
  border-color: rgba(183, 71, 42, .45);
  background: rgba(183, 71, 42, .07);
}

.feed-star.is-following,
.feed-star[aria-pressed="true"] {
  color: var(--rust-dark);
  border-color: rgba(183, 71, 42, .5);
  background: rgba(183, 71, 42, .12);
}

.feed-star.is-following svg,
.feed-star[aria-pressed="true"] svg {
  fill: currentColor;
}

.feed-star:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 2px;
}

/* Touch pointers get a real target: chips and stars grow together, and the
   small round icon buttons inside the panels reach 40 px. */
@media (pointer: coarse) {
  .feed-chip {
    min-height: 32px;
  }

  .feed-star {
    width: 32px;
    height: 32px;
  }

  .feed-star__mark,
  .feed-star svg {
    width: 14px;
    height: 14px;
  }

  .feed-views__close,
  .feed-views__del {
    width: 40px;
    height: 40px;
  }

  .feed-help__close {
    width: 40px;
    height: 40px;
  }

  .feed-you-panel__jump {
    min-height: 40px;
  }

  .feed-views__name,
  .feed-views__save-btn {
    min-height: 40px;
    height: 40px;
  }
}

/* ---------- "For you" panel (outside the sticky card, on purpose) ------ */
.feed-you-panel {
  margin: 9px 0 0;
  padding: 12px 14px 13px;
  border: 1px solid rgba(183, 71, 42, .38);
  border-left: 3px solid var(--rust);
  border-radius: 13px;
  background: rgba(248, 242, 227, .9);
  min-width: 0;
}

.feed-you-panel__title {
  margin: 0 0 4px;
  font: 700 8px/1.4 var(--mono);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--rust-dark);
}

.feed-you-panel__copy,
.feed-you-panel__count {
  margin: 0 0 8px;
  max-width: 72ch;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-2);
}

.feed-you-panel__count {
  color: var(--ink);
  font-weight: 600;
}

.feed-you-panel__chips {
  margin: 0 0 8px;
}

.feed-you-panel__note {
  margin: 0;
  font: 500 9px/1.55 var(--mono);
  color: var(--muted);
}

.feed-you-panel__jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  margin: 0 0 8px;
  padding: 0 11px;
  border: 1px solid var(--rust);
  border-radius: 8px;
  background: transparent;
  color: var(--rust-dark);
  font: 700 8px/1 var(--mono);
  letter-spacing: .07em;
  text-transform: uppercase;
  cursor: pointer;
}

.feed-you-panel__jump:hover {
  background: rgba(183, 71, 42, .08);
}

.feed-follow-chip {
  cursor: pointer;
}

.feed-follow-chip:hover {
  border-color: var(--rust);
  color: var(--rust-dark);
}

.feed-follow-chip .feed-chip__x {
  margin-left: 1px;
}

/* ---------- "nothing on this page matches" ---------- */
.feed-you-empty {
  border-style: solid;
  border-color: rgba(183, 71, 42, .4);
  border-left: 4px solid var(--rust);
  background: rgba(183, 71, 42, .05);
}

.feed-you-empty h2 {
  color: var(--rust-dark);
}

.feed-you-empty__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-top: 12px;
}

.feed-you-empty__actions .btn {
  flex: 0 1 auto;
}

/* ---------- saved views ---------- */
.feed-views {
  margin: 9px 0 0;
  padding: 11px 12px 12px;
  border: 1px solid var(--feed-line-strong);
  border-radius: 12px;
  background: #fffaf0;
  min-width: 0;
}

.feed-views__head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.feed-views__title {
  flex: none;
  font: 700 8.5px/1.3 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink);
}

.feed-views__note {
  flex: 1 1 auto;
  min-width: 0;
  font: 600 7.5px/1.3 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

.feed-views__close,
.feed-views__del {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(23, 35, 29, .08);
  color: var(--ink-2);
  font: 700 12px/1 var(--sans);
  cursor: pointer;
}

.feed-views__close:hover {
  background: rgba(23, 35, 29, .16);
  color: var(--ink);
}

.feed-views__list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 2px;
  min-width: 0;
  max-height: 190px;
  overflow-y: auto;
}

.feed-views__item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 4px 6px;
  border-radius: 7px;
}

.feed-views__item:hover {
  background: rgba(23, 35, 29, .05);
}

.feed-views__link {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font: 600 11.5px/1.4 var(--sans);
  text-decoration: underline;
  text-decoration-color: rgba(183, 71, 42, .4);
  text-underline-offset: 2px;
}

.feed-views__link:hover {
  color: var(--rust);
}

.feed-views__when {
  flex: none;
  font: 600 7.5px/1 var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}

.feed-views__del {
  width: 24px;
  height: 24px;
  border: 1px solid var(--feed-line);
  background: transparent;
  color: var(--muted);
}

.feed-views__del:hover {
  border-color: var(--rust);
  color: var(--rust);
  background: rgba(183, 71, 42, .08);
}

.feed-views__empty {
  padding: 4px 2px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}

.feed-views__save {
  display: flex;
  gap: 6px;
  margin-top: 9px;
  min-width: 0;
}

.feed-views__name {
  flex: 1 1 auto;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--feed-line);
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--ink);
  font: 600 11.5px/1 var(--sans);
}

.feed-views__name:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 1px;
}

.feed-views__save-btn {
  flex: none;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper-2);
  font: 700 8px/1 var(--mono);
  letter-spacing: .07em;
  text-transform: uppercase;
  cursor: pointer;
}

.feed-views__save-btn:hover {
  background: var(--ink-2);
}

.feed-views__limit {
  margin: 8px 0 0;
  font: 500 8.5px/1.5 var(--mono);
  color: var(--muted);
}

/* ---------- NEW badge + "N new" line ---------- */
.feed-card[data-new="true"] {
  background:
    linear-gradient(180deg, rgba(183, 71, 42, .05), rgba(183, 71, 42, 0) 58%),
    var(--paper-2);
}

.feed-card__new {
  flex: none;
  display: inline-grid;
  place-items: center;
  height: 16px;
  padding: 0 5px;
  border-radius: 3px;
  background: var(--rust);
  color: #fff8ec;
  font: 800 7px/1 var(--mono);
  letter-spacing: .09em;
  text-transform: uppercase;
}

.feed-new-count {
  display: inline-block;
  margin-left: .55em;
  padding-left: .62em;
  border-left: 1px solid var(--line-strong);
  color: var(--rust-dark);
}

/* ---------- keyboard focus on a card ---------- */
.feed-card.is-focused {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px rgba(183, 71, 42, .32), 0 14px 34px rgba(49, 38, 20, .13);
}

.feed-card.is-focused .feed-card__title a,
.feed-card.is-focused .feed-card__open {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* ---------- per-filter empty state ---------- */
.feed-empty__filters {
  margin: 12px auto 0;
  max-width: 640px;
  padding-top: 10px;
  border-top: 1px dotted var(--feed-line-strong);
}

.feed-empty__filters-label {
  margin: 0 0 7px;
  font: 700 7.5px/1.5 var(--mono);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}

.feed-empty__filters .feed-chips {
  justify-content: center;
}

/* ---------- keyboard shortcut sheet ---------- */
.feed-help {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 35, 29, .44);
}

.feed-help__card {
  width: min(440px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 18px 18px 14px;
  border: 1px solid var(--feed-line-strong);
  border-radius: 16px;
  background: var(--paper-2);
  box-shadow: var(--shadow);
}

.feed-help__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.feed-help__title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font: 600 22px/1.05 var(--display);
  letter-spacing: -.03em;
  color: var(--ink);
}

.feed-help__close {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(23, 35, 29, .08);
  color: var(--ink-2);
  font: 700 13px/1 var(--sans);
  cursor: pointer;
}

.feed-help__close:hover {
  background: rgba(23, 35, 29, .16);
  color: var(--ink);
}

.feed-help__keys {
  display: grid;
  gap: 4px;
  margin: 0;
}

.feed-help__row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  padding: 5px 0;
  border-top: 1px dotted var(--feed-line);
}

.feed-help__row:first-child {
  border-top: 0;
}

.feed-help__combo {
  display: inline-flex;
  gap: 4px;
  flex: none;
  width: 64px;
  margin: 0;
}

.feed-help__combo kbd {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 1px solid var(--feed-line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--paper);
  font: 700 9px/1 var(--mono);
  color: var(--ink);
}

.feed-help__what {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-2);
}

.feed-help__note {
  margin: 10px 0 0;
  font: 500 9px/1.55 var(--mono);
  color: var(--muted);
}

/* Every panel above is toggled with [hidden]; the class rules must not win. */
.feed-help[hidden],
.feed-you-panel[hidden],
.feed-you-status[hidden],
.feed-you-empty[hidden],
.feed-views[hidden],
.feed-tools[hidden] {
  display: none !important;
}

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .feed-tools {
    flex: 1 1 100%;
  }

  .feed-you {
    flex: 1 1 auto;
  }

  .feed-tool {
    flex: 1 1 auto;
  }

  .feed-tool--icon {
    flex: 0 0 40px;
    width: 40px;
  }
}

@media (max-width: 520px) {
  .feed-you-panel {
    padding: 11px 12px 12px;
    border-radius: 12px;
  }

  .feed-you-panel__copy,
  .feed-you-panel__count {
    font-size: 11.5px;
  }

  .feed-views {
    padding: 10px;
  }

  .feed-views__save {
    flex-wrap: wrap;
  }

  .feed-views__name {
    flex: 1 1 100%;
  }

  .feed-views__save-btn {
    flex: 1 1 100%;
    min-height: 38px;
  }

  .feed-help {
    padding: 12px;
  }

  .feed-help__card {
    padding: 15px 14px 12px;
  }

  .feed-help__combo {
    width: 56px;
  }

  .feed-new-count {
    display: block;
    margin: 3px 0 0;
    padding: 0;
    border-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .feed-you,
  .feed-tool,
  .feed-star,
  .feed-views__link {
    transition: none;
  }
}

@media print {
  .feed-tools,
  .feed-you-status,
  .feed-you-panel,
  .feed-you-empty,
  .feed-views,
  .feed-star,
  .feed-help,
  .feed-card__new,
  .feed-new-count {
    display: none !important;
  }
}


/* --- compact personalisation chrome (integration pass) ------------------- */
/* The follow star lives inside the facet pill instead of a separate empty
   circle, and the three personalisation buttons match the toolbar height. */
.feed-follow {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
}
.feed-follow > .feed-chip {
  padding-right: 21px;
}
.feed-follow > .feed-star {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  opacity: .45;
}
.feed-follow > .feed-star:hover,
.feed-follow > .feed-star:focus-visible,
.feed-follow > .feed-star[aria-pressed="true"] {
  opacity: 1;
  background: rgba(183, 71, 42, .12);
}
.feed-follow > .feed-star__mark,
.feed-follow > .feed-star svg {
  width: 11px;
  height: 11px;
}

.feed-bar .feed-you,
.feed-bar .feed-tool {
  font-size: 0;
  letter-spacing: 0;
  width: 34px;
  height: 34px;
  min-width: 34px;
  flex: 0 0 34px;
  padding: 0;
  border-radius: 8px;
}
.feed-bar .feed-you__label,
.feed-bar .feed-tool__label {
  display: none;
}
.feed-bar .feed-tool--icon {
  font-size: 12px;
}
@media (max-width: 760px) {
  .feed-bar .feed-you,
  .feed-bar .feed-tool {
    width: 32px;
    height: 32px;
    min-width: 32px;
    flex-basis: 32px;
  }
}


/* Mobile toolbar: search first, then scope + near me, then the utility row.
   The three personalisation icons sit with Filters/Apply rather than alone. */
@media (max-width: 620px) {
  .feed-bar { row-gap: 6px; }
  .feed-search { order: 0; flex: 1 0 100%; }
  .feed-scope { order: 1; flex: 1 1 auto; }
  .feed-near { order: 2; flex: 0 0 auto; }
  .feed-sort { order: 3; flex: 1 1 100%; }
  .feed-tools { order: 4; display: flex; gap: 6px; }
  .feed-you, .feed-tool { order: 4; }
  .feed-filters-toggle { order: 5; flex: 1 1 auto; }
  .feed-apply { order: 6; flex: 0 0 auto; }
  .feed-tool--icon { display: none; }
  .feed-search input { font-size: 12px; }
}

.feed-bar .feed-tools{display:flex;align-items:center;gap:6px;flex:none}


/* One For-you message is enough: the panel carries the state and the count,
   the toolbar line and the extra explainer just add noise. */
.feed-you-status,
.feed-you-inline-note {
  display: none !important;
}
