/* ============================================================
   Newswire Wireframes — shared styles
   Gray-box aesthetic so layout & hierarchy are easy to judge
   ============================================================ */

:root {
  --bg: #f4f4f2;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --line: #c8c8c4;
  --line-strong: #1a1a1a;
  --accent: #2c4a6e;
  --accent-soft: #e8eef5;
  --wire: #9a9a96;
  --radius: 2px;
  --max: 1200px;
  --gap: 1.25rem;
  --font: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-display: "IBM Plex Serif", Georgia, "Times New Roman", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  display: block;
}

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

a:hover {
  text-decoration: underline;
}

button,
input,
select {
  font: inherit;
}

/* ----- Utility labels (wireframe annotations) ----- */
.wf-label {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--wire);
  margin-bottom: 0.35rem;
}

.wf-box {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.wf-box--solid {
  border-style: solid;
}

.wf-placeholder {
  background: repeating-linear-gradient(
    -45deg,
    #ececea,
    #ececea 8px,
    #e2e2de 8px,
    #e2e2de 16px
  );
  border: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  min-height: 120px;
}

/* ----- Shell ----- */
.site-header {
  background: var(--surface);
  border-bottom: 2px solid var(--line-strong);
  position: sticky;
  top: 0;
  z-index: 300;
  overflow: visible;
}

.site-header__top {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.5rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: nowrap;
}

.site-logo {
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  text-decoration: none;
}

.site-logo img {
  display: block;
  height: 3.9rem;
  width: auto;
  max-width: min(22rem, 48vw);
  object-fit: contain;
  object-position: left center;
}

.site-logo:hover {
  text-decoration: none;
  opacity: 0.85;
}

.site-logo span {
  color: var(--accent);
}

.header-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.search-form {
  display: flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
}

.search-form input {
  border: 0;
  background: transparent;
  padding: 0.4rem 0.65rem;
  min-width: 10rem;
  outline: none;
}

.search-form button {
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--surface);
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
}

.search-form button:hover {
  background: var(--accent-soft);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius);
  text-decoration: none;
}

.btn:hover {
  background: var(--accent-soft);
  text-decoration: none;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn--primary:hover {
  background: #1f3550;
  color: #fff;
}

.btn--ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.nav-main {
  border-top: 1px solid var(--line);
  background: var(--surface);
  position: relative;
  z-index: 310;
  overflow: visible;
}

.nav-main__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 0.75rem;
  display: flex;
  align-items: stretch;
  gap: 0.15rem;
  /* IMPORTANT: overflow must stay visible or absolute submenus are clipped */
  overflow: visible;
  flex-wrap: wrap;
  width: 100%;
  box-sizing: border-box;
}

/* Far right of menu bar — separate from location items */
.nav-places {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  padding: 0.7rem 0.85rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  border-left: 1px solid var(--line);
  align-self: stretch;
}

.nav-places:hover {
  background: var(--accent-soft);
  border-bottom-color: var(--accent);
  text-decoration: none;
}

/* Location item + topic submenu */
.nav-item {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  flex-shrink: 0;
}

.nav-item__link {
  display: flex;
  align-items: center;
  padding: 0.7rem 0.35rem 0.7rem 0.7rem;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

/* Main items with no dropdown (Sports, SciTech, Classifieds, Forum) */
.nav-item__link--solo {
  padding: 0.7rem 0.75rem;
  align-self: stretch;
}

.nav-item__link--solo:hover,
.nav-item__link--solo[aria-current="page"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.nav-item__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0.7rem 0.65rem 0.7rem 0.2rem;
  font-size: 0.7rem;
  line-height: 1;
  border-bottom: 2px solid transparent;
  min-width: 1.5rem;
}

.nav-item__toggle::after {
  content: "▾";
  font-size: 0.75rem;
}

.nav-item.is-open .nav-item__toggle::after {
  content: "▴";
}

.nav-item:hover .nav-item__link,
.nav-item:hover .nav-item__toggle,
.nav-item.is-open .nav-item__link,
.nav-item.is-open .nav-item__toggle,
.nav-item__link[aria-current="page"],
.nav-item:has(.nav-sub a[aria-current="page"]) .nav-item__link {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.nav-sub {
  display: none;
  position: absolute;
  top: calc(100% - 2px);
  left: 0;
  /* Horizontal strip of topic links */
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem;
  min-width: max-content;
  max-width: min(920px, 96vw);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 0 0 6px 6px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
  z-index: 400;
  padding: 0.4rem 0.5rem;
}

/* Open on hover, keyboard focus, or .is-open from click */
.nav-item:hover > .nav-sub,
.nav-item:focus-within > .nav-sub,
.nav-item.is-open > .nav-sub {
  display: flex;
}

.nav-sub a {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.75rem;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 0;
  background: #fff;
  border-radius: 999px;
}

.nav-sub a:hover,
.nav-sub a:focus,
.nav-sub a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
  outline: none;
}

/* Hamburger control (shown tablet + mobile) */
.nav-toggle {
  display: none;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
}

.nav-toggle__bar {
  display: block;
  width: 1.15rem;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

/* X animation when menu open */
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Tablet + phone: hamburger far left, collapsible nav */
@media (max-width: 1100px) {
  .site-header__top {
    flex-wrap: nowrap;
    gap: 0.65rem;
  }

  .nav-toggle {
    display: inline-flex;
    order: -1; /* far left */
    margin-right: 0;
  }

  .site-logo {
    order: 0;
    flex: 1 1 auto;
  }

  .site-logo img {
    height: 3.15rem;
    max-width: min(18rem, 42vw);
  }

  .header-meta {
    order: 1;
    margin-left: auto;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .nav-main {
    border-top: 0;
  }

  .nav-main.is-collapsed .nav-main__inner {
    display: none;
  }

  .nav-main:not(.is-collapsed) {
    border-top: 1px solid var(--line);
  }

  .nav-main__inner {
    flex-direction: column;
    align-items: stretch;
    overflow: visible;
    padding: 0.25rem 0 0.5rem;
    gap: 0;
  }

  .nav-places {
    margin-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    justify-content: flex-start;
    order: 99;
    width: 100%;
    padding: 0.85rem 1rem;
  }

  .nav-item {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    border-bottom: 1px solid var(--line);
  }

  .nav-item__link {
    flex: 1;
    border-bottom: 0;
    padding: 0.85rem 1rem;
  }

  .nav-item__link--solo {
    width: 100%;
    border-bottom: 1px solid var(--line);
    padding: 0.85rem 1rem;
  }

  .nav-item__toggle {
    border-bottom: 0;
    padding: 0.85rem 1rem;
    min-width: 2.75rem;
  }

  /* Vertical topic list under each location (touch-friendly) */
  .nav-sub {
    position: static;
    display: none;
    width: 100%;
    min-width: 0;
    max-width: none;
    border: 0;
    border-top: 1px solid var(--line);
    box-shadow: none;
    background: var(--bg);
    border-radius: 0;
    padding: 0.25rem 0 0.5rem;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
  }

  .nav-item:hover > .nav-sub,
  .nav-item:focus-within > .nav-sub {
    display: none;
  }

  .nav-item.is-open > .nav-sub {
    display: flex;
  }

  .nav-sub a {
    display: block;
    width: 100%;
    border-radius: 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    font-weight: 500;
    padding: 0.7rem 1rem 0.7rem 1.5rem;
  }

  .nav-sub a:last-child {
    border-bottom: 0;
  }

  .nav-sub a:hover,
  .nav-sub a:focus,
  .nav-sub a[aria-current="page"] {
    background: var(--accent-soft);
  }
}

/* ----- Layout ----- */
.page {
  flex: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  width: 100%;
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin: 0 0 0.25rem;
  letter-spacing: -0.02em;
}

.page-kicker {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.page-desc {
  color: var(--muted);
  margin: 0 0 1.5rem;
  max-width: 40rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--gap);
  align-items: start;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.section {
  margin-bottom: 2rem;
}

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 2px solid var(--line-strong);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.section__title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0;
}

.section__link {
  font-size: 0.8rem;
  font-weight: 600;
}

/* ----- Cards / story units ----- */
.story-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0.85rem;
  height: 100%;
}

.story-card__meta {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.story-card__meta .section-tag {
  color: var(--accent);
}

.story-card__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.3;
  margin: 0;
}

.story-card__title a {
  color: var(--ink);
  text-decoration: none;
}

.story-card__title a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.story-card__dek {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
  flex: 1;
}

.story-card__byline {
  font-size: 0.75rem;
  color: var(--muted);
}

/* Hero / lead story */
.lead {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--gap);
  background: var(--surface);
  border: 2px solid var(--line-strong);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.lead__media .wf-placeholder {
  min-height: 280px;
  height: 100%;
}

.lead__body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  justify-content: center;
}

.lead__title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.02em;
}

.lead__title a {
  color: var(--ink);
  text-decoration: none;
}

.lead__title a:hover {
  color: var(--accent);
}

.lead__dek {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0;
}

/* Horizontal list story */
.story-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0.75rem;
}

.story-row .wf-placeholder {
  min-height: 90px;
}

.story-row__title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  margin: 0 0 0.35rem;
  line-height: 1.3;
}

.story-row__title a {
  color: var(--ink);
  text-decoration: none;
}

.story-row__title a:hover {
  color: var(--accent);
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: 7rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1rem;
}

.panel__title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

.rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: rank;
}

.rank-list li {
  counter-increment: rank;
  display: grid;
  grid-template-columns: 1.5rem 1fr;
  gap: 0.5rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.rank-list li:last-child {
  border-bottom: 0;
}

.rank-list li::before {
  content: counter(rank);
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-display);
}

.rank-list a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  line-height: 1.3;
}

.rank-list a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.newsletter {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
}

.newsletter p {
  font-size: 0.85rem;
  margin: 0 0 0.75rem;
  color: var(--muted);
}

.newsletter form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.newsletter input {
  border: 1px solid var(--line-strong);
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius);
}

/* ----- Article page ----- */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 720px) 1fr;
  gap: 2rem;
  align-items: start;
}

.article-header {
  margin-bottom: 1.25rem;
}

.article-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0.35rem 0 0.75rem;
}

.article-dek {
  font-size: 1.15rem;
  color: var(--muted);
  margin: 0 0 1rem;
  line-height: 1.45;
}

.article-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.article-byline strong {
  color: var(--ink);
}

.article-hero .wf-placeholder {
  min-height: 360px;
}

.article-hero figcaption {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.article-body {
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 42rem;
}

.article-body p {
  margin: 0 0 1.15rem;
}

.article-body .drop-cap::first-letter {
  font-size: 3.2rem;
  float: left;
  line-height: 0.85;
  padding-right: 0.4rem;
  font-weight: 700;
  color: var(--accent);
}

.article-body blockquote {
  margin: 1.5rem 0;
  padding: 0.5rem 0 0.5rem 1.25rem;
  border-left: 3px solid var(--accent);
  font-style: italic;
  color: var(--muted);
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  text-decoration: none;
  border-radius: 999px;
}

.tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.share-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.share-bar .btn {
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
}

.share-bar--social {
  align-items: center;
  gap: 0.65rem;
}

.share-bar__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.share-bar__icons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.share-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.share-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.share-icon:hover {
  transform: translateY(-1px);
}

.share-icon--facebook { background: #1877f2; border-color: #1877f2; }
.share-icon--x { background: #111; border-color: #111; }
.share-icon--linkedin { background: #0a66c2; border-color: #0a66c2; }
.share-icon--whatsapp { background: #25d366; border-color: #25d366; }
.share-icon--telegram { background: #229ed9; border-color: #229ed9; }
.share-icon--truth { background: #541388; border-color: #541388; }
.share-icon--copy { background: #2c4a6e; border-color: #2c4a6e; }

/* Related */
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

/* Section listing / filters */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  align-items: center;
}

.filters label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 999px;
  color: var(--ink);
}

.chip:hover,
.chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.listing {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.listing-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1rem;
}

.listing-item .wf-placeholder {
  min-height: 130px;
}

.pagination {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  min-width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.pagination a:hover,
.pagination [aria-current="page"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

/* Search results */
.search-summary {
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.search-summary strong {
  color: var(--ink);
}

.result-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.result-item h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 0 0 0.35rem;
}

.result-item h3 a {
  color: var(--ink);
}

.result-item p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.highlight {
  background: #fff3a3;
  padding: 0 0.15em;
}

/* Tabs (wireframe demo) */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
}

.tabs button {
  border: 0;
  background: transparent;
  padding: 0.65rem 1rem;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tabs button[aria-selected="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-panel[hidden] {
  display: none;
}

/* Footer — compact pinned bar */
.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 250;
  background: var(--ink);
  color: #c8c8c4;
  margin: 0;
  padding: 0.45rem 1.25rem;
  border-top: 1px solid #333;
}

.site-footer__inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1rem;
}

.site-footer a {
  color: #e8e8e4;
  text-decoration: none;
  font-size: 0.8rem;
}

.site-footer a:hover {
  text-decoration: underline;
}

.site-footer h4 {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #888;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.site-footer__brand {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  white-space: nowrap;
}

.site-footer__tag {
  margin: 0;
  font-size: 0.78rem;
  color: #999;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.85rem;
  margin-left: auto;
}

.site-footer__copy {
  margin: 0;
  font-size: 0.72rem;
  color: #777;
  white-space: nowrap;
}

body {
  padding-bottom: 2.75rem;
}

/* Toast for wireframe interactions */
.toast {
  position: fixed;
  bottom: 3.5rem;
  right: 1.25rem;
  background: var(--ink);
  color: #fff;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
  max-width: 20rem;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ----- Responsive ----- */
@media (max-width: 900px) {
  .grid-2,
  .article-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .lead {
    grid-template-columns: 1fr;
  }

  .lead__media .wf-placeholder {
    min-height: 200px;
  }

  .grid-3,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .listing-item {
    grid-template-columns: 120px 1fr;
  }

  .site-footer__tag {
    display: none;
  }
}

@media (max-width: 560px) {
  .story-row {
    grid-template-columns: 100px 1fr;
  }

  .listing-item {
    grid-template-columns: 1fr;
  }

  .header-meta {
    width: auto;
    margin-left: auto;
    flex-wrap: nowrap;
  }

  .search-form {
    flex: 1;
  }

  .search-form input {
    min-width: 0;
    width: 100%;
  }

  .site-footer {
    padding: 0.4rem 0.75rem;
  }

  .site-footer__copy {
    width: 100%;
  }
}

/* ============================================================
   Feed (Facebook-style continuous scroll) + Portals
   ============================================================ */

:root {
  --ok: #1f6b3a;
  --ok-soft: #e6f4eb;
  --warn: #8a6d00;
  --warn-soft: #fff6d6;
  --danger: #8b1e1e;
  --danger-soft: #fce8e8;
  --info: #2c4a6e;
  --feed-max: 640px;
  --portal-sidebar: 240px;
}

/* ----- App chrome (reader feed + portals share pieces) ----- */
.portal-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.75rem;
}

.portal-switcher a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 600;
}

.portal-switcher a:hover,
.portal-switcher a[aria-current="page"] {
  color: var(--accent);
  border-color: var(--line);
  background: var(--accent-soft);
  text-decoration: none;
}

.header-user {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.header-signout {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  padding: 0.25rem 0.15rem;
}

.header-signout:hover {
  color: var(--accent);
  text-decoration: underline;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem 0.25rem 0.25rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.user-chip:hover {
  border-color: var(--accent);
  text-decoration: none;
  background: var(--accent-soft);
}

.user-chip__avatar {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent);
}

/* ----- Reader feed layout ----- */
.feed-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, var(--feed-max)) 280px;
  gap: 1.25rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.25rem;
  width: 100%;
  align-items: start;
}

/* No left location-feeds rail — center feed + optional right sidebar */
.feed-layout--no-left {
  grid-template-columns: minmax(0, var(--feed-max)) 280px;
  max-width: 960px;
  justify-content: center;
}

/* Desktop: left ads | cards fill leftover | right ads */
.feed-layout--ads {
  grid-template-columns: 300px minmax(0, 1fr) 300px;
  max-width: 1280px;
  justify-content: center;
}

.feed-main,
[data-feed],
.feed-post {
  width: 100%;
  max-width: none;
}

.ad-rail {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: var(--ad-stick-top, 1rem);
  align-self: start;
  z-index: 2;
  max-height: calc(100dvh - var(--ad-stick-top, 1rem) - 0.5rem);
  overflow: hidden;
}

.ad-slot {
  width: 300px;
  max-width: 100%;
  margin: 0 auto;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.ad-slot__label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wire);
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--line);
  background: #fafaf8;
}

/* IAB half page 300×600 (vertical) */
.ad-slot--300x600 .ad-slot__frame {
  width: 300px;
  height: 600px;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(
    -45deg,
    #ececea,
    #ececea 8px,
    #e2e2de 8px,
    #e2e2de 16px
  );
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 1rem;
  box-sizing: border-box;
}

.fake-ad {
  display: flex;
  flex-direction: column;
  width: 300px;
  max-width: 100%;
  color: #fff;
  text-decoration: none;
  background: #14202e;
}

.fake-ad:hover {
  text-decoration: none;
  color: #fff;
}

.fake-ad__photo {
  display: block;
  width: 100%;
  height: 340px;
  object-fit: cover;
  object-position: center;
  background-color: #9aa3ad;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
img.fake-ad__photo.lazy-media:not([src]),
img.fake-ad__photo.lazy-media[src=""] {
  min-height: 340px;
}

.fake-ad__photo--auto {
  background-position: center 35%;
}

.fake-ad__copy {
  display: block;
  padding: 0.9rem 1rem 1rem;
  background: #14202e;
}

.fake-ad__kicker {
  display: block;
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #d8e4f0;
}

.fake-ad__headline {
  display: block;
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.fake-ad__cta {
  display: inline-block;
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
}

/*
  Ads breakpoints:
  - Desktop (>1100px): left + right
  - Tablet (769–1100px): right only — drop the left column so cards grow
  - Phone (≤768px): no side ads — single column, no reserved ad track
*/
@media (max-width: 1100px) {
  .feed-layout--ads {
    grid-template-columns: minmax(0, 1fr) 300px;
    max-width: none;
    width: 100%;
  }

  .feed-layout--ads .ad-rail--left {
    display: none;
  }
}

/* Phone: hide all side ads; full-bleed story cards */
@media (max-width: 768px) {
  .site-header__top {
    padding: 0.5rem 0.75rem;
    flex-wrap: nowrap;
    gap: 0.5rem;
  }

  .header-meta {
    width: auto;
    flex: 1;
    min-width: 0;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 0.4rem;
  }

  .search-form input {
    min-width: 0;
    width: 7.5rem;
  }

  .site-logo img {
    height: 2.6rem;
    max-width: min(14rem, 42vw);
  }

  .feed-layout,
  .feed-layout--ads,
  .feed-layout--no-left {
    grid-template-columns: minmax(0, 1fr);
    max-width: none;
    width: 100%;
    padding: 0 0 2rem;
    gap: 0;
  }

  .feed-layout--ads .ad-rail,
  .feed-layout--ads .feed-rail {
    display: none;
  }

  .places-bar {
    padding: 0.85rem 1rem 0.35rem;
  }

  .places-bar .page-title {
    font-size: 1.35rem;
  }

  .places-bar__hint {
    display: none;
  }

  [data-feed] {
    gap: 0;
  }

  .feed-post {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-top: 0;
    border-bottom: 10px solid var(--bg);
  }

  .feed-post--ad {
    display: none;
  }

  .feed-post__avatar {
    display: none;
  }

  .feed-post__head {
    padding: 0.85rem 1rem 0.2rem;
    order: 2;
  }

  .feed-post__meta {
    flex-wrap: nowrap;
    overflow: hidden;
    white-space: nowrap;
  }

  .feed-post__body--headline {
    padding: 0.2rem 1rem 0.55rem;
    order: 3;
  }

  .feed-post__title {
    font-size: 1.45rem;
    line-height: 1.28;
    letter-spacing: -0.025em;
  }

  .feed-post__media,
  .feed-post__media-grid {
    order: 1;
    display: block;
  }

  .feed-post__media img,
  .feed-post__media-grid img {
    width: 100%;
    height: 52vw;
    min-height: 200px;
    max-height: 280px;
    object-fit: cover;
    display: block;
  }

  .feed-post__media-grid img:nth-child(n + 2) {
    display: none;
  }

  .feed-post__body--summary {
    padding: 0 1rem 0.85rem;
    order: 4;
  }

  .feed-post__excerpt {
    font-size: 1.05rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .feed-post__stats {
    padding: 0.7rem 1rem 1rem;
    order: 5;
    font-size: 0.88rem;
  }
}

.feed-rail {
  position: sticky;
  top: var(--ad-stick-top, 1rem);
  align-self: start;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: calc(100vh - var(--ad-stick-top, 1rem) - 0.5rem);
  overflow-x: hidden;
  overflow-y: auto;
}

.feed-rail .panel {
  margin: 0;
}

.feed-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* Full feed-column width, sits above the scroll */
.places-bar {
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}

.places-bar__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.65rem;
}

.places-bar__hint {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.places-bar__chips {
  margin-top: 0;
  width: 100%;
}

.topic-feed-head {
  margin-bottom: 0.25rem;
}

.topic-feed-head .page-title {
  margin-bottom: 0.35rem;
}

.feed-composer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.feed-composer__prompt {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 999px;
  padding: 0.65rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  display: block;
}

.feed-composer__prompt:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* Story post cards (social feed) */
[data-feed] {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.feed-post {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* In-feed sponsored / video ad card (every 3rd item) */
.feed-post--ad {
  border-color: #c8c8c4;
  background: #fafaf8;
}

.feed-post--ad .feed-post__sponsor {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 1rem 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.feed-post--ad .feed-post__sponsor-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
}

.feed-post--ad .feed-post__media--video .wf-placeholder {
  min-height: 280px;
  background: #1a1a1a;
  color: #c8c8c4;
  border-color: #333;
}

.feed-post--ad .feed-post__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 1rem 1rem;
}

.feed-post__head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1rem 0.5rem;
}

.feed-post__avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
}

.feed-post__who {
  flex: 1;
  min-width: 0;
}

.feed-post__name {
  font-weight: 700;
  font-size: 0.9rem;
  margin: 0;
  color: var(--ink);
}

.feed-post__name a {
  color: inherit;
  text-decoration: none;
}

.feed-post__name a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.feed-post__meta {
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  align-items: center;
}

.feed-post__meta .section-tag {
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.7rem;
}

.feed-post__body {
  padding: 0.25rem 1rem 0.75rem;
}

/* Card content order: headline → media → summary */
.feed-post__body--headline {
  padding: 0.15rem 1rem 0.65rem;
}

.feed-post__body--headline .feed-post__title {
  margin: 0;
}

.feed-post__body--summary {
  padding: 0.75rem 1rem 0.85rem;
}

.feed-post__body--summary .feed-post__excerpt {
  margin: 0;
}

.feed-post__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  line-height: 1.25;
  margin: 0 0 0.4rem;
  letter-spacing: -0.02em;
}

.feed-post__title a {
  color: var(--ink);
  text-decoration: none;
}

.feed-post__title a:hover {
  color: var(--accent);
}

.feed-post__excerpt {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.45;
}

.feed-post__media .wf-placeholder {
  min-height: 280px;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
}

.feed-post__media--video .wf-placeholder {
  min-height: 220px;
  position: relative;
}

.feed-post__media--video .wf-placeholder::after {
  content: "▶";
  position: absolute;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  padding-left: 0.15rem;
}

.feed-post__media-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

.feed-post__media-grid .wf-placeholder {
  min-height: 140px;
}

.feed-post__media-grid--2 .wf-placeholder {
  min-height: 200px;
}

/* Inline photos between story paragraphs */
.article-inline-photo {
  margin: 1.35rem 0 1.5rem;
}

.article-inline-photo .wf-placeholder {
  min-height: 240px;
}

.article-inline-photo figcaption {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.45rem;
}

.line-row--photo {
  align-items: stretch;
}

.line-photo {
  padding: 0.35rem 0.25rem 0.5rem;
  min-width: 0;
}

.line-photo__badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.line-photo__caption {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  outline: none;
  line-height: 1.4;
}

.line-photo__caption:focus {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 4px;
  padding: 0.2rem 0.35rem;
}

.feed-post__stats {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.feed-post__actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.feed-post__actions button {
  border: 0;
  background: transparent;
  padding: 0.65rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.feed-post__actions button:hover {
  background: var(--bg);
  color: var(--accent);
}

.feed-post__source {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--wire);
  padding: 0 1rem 0.65rem;
}

.badge-source {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
}

.badge-source--reporter {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.badge-source--citizen {
  background: #f3eef8;
  border-color: #6b4c9a;
  color: #6b4c9a;
}

.feed-loading,
.feed-end {
  text-align: center;
  padding: 1.25rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.feed-loading[hidden],
.feed-end[hidden] {
  display: none;
}

.section-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.section-pills a {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}

.section-pills a:hover,
.section-pills a.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}

/* ----- Portal shell ----- */
.portal-body {
  background: #ebebe8;
}

.portal-shell {
  display: grid;
  grid-template-columns: var(--portal-sidebar) 1fr;
  min-height: calc(100vh - 0px);
  flex: 1;
}

.portal-nav {
  background: var(--ink);
  color: #c8c8c4;
  padding: 1.25rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.portal-nav__brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  padding: 0.35rem 0.65rem 1rem;
  border-bottom: 1px solid #333;
  margin-bottom: 0.75rem;
}

.portal-nav__brand:hover {
  text-decoration: none;
  opacity: 0.9;
}

.portal-nav__brand span {
  color: #8eb4e0;
}

.portal-nav__role {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #777;
  padding: 0 0.65rem 0.5rem;
}

.portal-nav a {
  display: block;
  color: #d8d8d4;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius);
}

.portal-nav a:hover,
.portal-nav a[aria-current="page"] {
  background: #2a2a2a;
  color: #fff;
  text-decoration: none;
}

.portal-nav__foot {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid #333;
  font-size: 0.8rem;
}

.portal-nav__foot a {
  color: #999;
}

.portal-main {
  padding: 1.25rem 1.5rem 3rem;
  min-width: 0;
}

.portal-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.portal-topbar h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0;
  letter-spacing: -0.02em;
  flex: 1;
}

.portal-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.85rem 1rem;
}

.stat-card__value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  margin: 0 0 0.25rem;
}

.stat-card__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Status badges */
.status {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  white-space: nowrap;
}

.status--draft { background: #f0f0ee; color: var(--muted); }
.status--submitted { background: var(--accent-soft); color: var(--accent); border-color: #b8c9de; }
.status--in-review { background: var(--warn-soft); color: var(--warn); border-color: #e0c96a; }
.status--rework { background: #fde8d8; color: #9a4a12; border-color: #e0a070; }
.status--approved { background: var(--ok-soft); color: var(--ok); border-color: #9dccb0; }
.status--published { background: var(--ok-soft); color: var(--ok); border-color: #9dccb0; }
.status--rejected { background: var(--danger-soft); color: var(--danger); border-color: #e0a0a0; }

/* Data tables */
.data-table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: #fafaf8;
  white-space: nowrap;
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table tr:hover td {
  background: #fafaf8;
}

.data-table .story-title {
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.data-table .story-title:hover {
  color: var(--accent);
  text-decoration: underline;
}

.data-table .muted {
  color: var(--muted);
  font-size: 0.8rem;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* Forms */
.form-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.25rem;
  max-width: 720px;
}

.form-card--wide {
  max-width: none;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

.form-grid--2 {
  grid-template-columns: 1fr 1fr;
}

.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.field .hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0.3rem 0 0;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="url"],
.field input[type="password"],
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem;
  background: var(--surface);
  font: inherit;
}

.field textarea {
  min-height: 160px;
  resize: vertical;
  line-height: 1.5;
}

.field textarea.tall {
  min-height: 280px;
}

.field-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.field-check input {
  margin-top: 0.2rem;
}

.media-drop {
  border: 2px dashed var(--line);
  border-radius: 6px;
  padding: 1.5rem 1rem;
  text-align: center;
  background: var(--bg);
  cursor: pointer;
}

.media-drop:hover,
.media-drop.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.media-drop strong {
  display: block;
  margin-bottom: 0.25rem;
}

.media-drop span {
  font-size: 0.8rem;
  color: var(--muted);
}

.media-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.media-thumbs .thumb {
  width: 88px;
  height: 88px;
  border: 1px solid var(--line);
  background: repeating-linear-gradient(
    -45deg,
    #ececea,
    #ececea 6px,
    #e2e2de 6px,
    #e2e2de 12px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: var(--muted);
  font-weight: 600;
  position: relative;
}

.media-thumbs .thumb button {
  position: absolute;
  top: 2px;
  right: 2px;
  border: 0;
  background: var(--ink);
  color: #fff;
  width: 1.25rem;
  height: 1.25rem;
  font-size: 0.7rem;
  cursor: pointer;
  line-height: 1;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

/* Editor review workspace */
.review-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.25rem;
  align-items: start;
}

.review-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  align-items: center;
}

.review-toolbar .spacer {
  flex: 1;
}

.editor-canvas {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.25rem;
}

.editor-canvas [contenteditable="true"] {
  outline: 1px dashed transparent;
  border-radius: 2px;
  min-height: 1.2em;
}

.editor-canvas [contenteditable="true"]:hover {
  outline-color: var(--line);
}

.editor-canvas [contenteditable="true"]:focus {
  outline-color: var(--accent);
  background: #fafcff;
}

.editor-canvas h1[contenteditable] {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.editor-canvas .dek[contenteditable] {
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.editor-canvas .body[contenteditable] {
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.7;
  min-height: 200px;
}

.comment-thread {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.comment {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.75rem;
  font-size: 0.85rem;
}

.comment__meta {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.35rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.comment__body {
  margin: 0;
  line-height: 1.4;
}

.comment-compose textarea {
  width: 100%;
  min-height: 80px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.5rem;
  font: inherit;
  margin-bottom: 0.5rem;
}

/* Location preferences (ZIP, city, county, state, country) */
.loc-add {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 0.85rem 1rem;
  align-items: start;
  margin-bottom: 0.5rem;
}

.loc-add .field select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem;
  font: inherit;
  background: var(--surface);
}

.zip-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
}

.zip-add-row input {
  flex: 1;
  min-width: 8rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem;
  font: inherit;
}

.loc-groups {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1rem;
}

.loc-group__title {
  margin: 0 0 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.loc-group[hidden] {
  display: none;
}

.zip-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-height: 1.75rem;
}

.zip-chip-list--readonly {
  margin-top: 0;
}

.zip-chip,
.loc-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.35rem 0.55rem 0.35rem 0.55rem;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
}

.loc-chip__type {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  background: rgba(44, 74, 110, 0.12);
}

.zip-chip-list--readonly .zip-chip {
  padding: 0.3rem 0.55rem;
}

.zip-chip__remove {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.15rem;
  border-radius: 50%;
}

.zip-chip__remove:hover {
  background: rgba(44, 74, 110, 0.15);
}

.zip-empty {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.75rem 0 0;
}

.zip-empty[hidden] {
  display: none;
}

@media (max-width: 560px) {
  .loc-add {
    grid-template-columns: 1fr;
  }
}

/* Profile preferences */
.pref-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pref-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.pref-row:last-child {
  border-bottom: 0;
}

.pref-row h3 {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
}

.pref-row p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Toggle switch (wireframe) */
.toggle {
  position: relative;
  width: 2.75rem;
  height: 1.5rem;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle span {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s;
}

.toggle span::after {
  content: "";
  position: absolute;
  width: 1.1rem;
  height: 1.1rem;
  left: 0.2rem;
  top: 0.2rem;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s;
}

.toggle input:checked + span {
  background: var(--accent);
}

.toggle input:checked + span::after {
  transform: translateX(1.2rem);
}

/* Hub cards */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  max-width: 960px;
}

.hub-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.hub-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  text-decoration: none;
  color: inherit;
}

.hub-card h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0;
}

.hub-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  flex: 1;
}

.hub-card .hub-cta {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
}

/* Empty / compare callouts for reporter vs citizen */
.compare-note {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.compare-note .panel {
  margin: 0;
}

/* Responsive portals + feed (do not re-add ad columns here) */
@media (max-width: 1100px) {
  .feed-layout:not(.feed-layout--ads) {
    grid-template-columns: minmax(0, 1fr) 260px;
  }

  .feed-layout--no-left {
    grid-template-columns: minmax(0, 1fr) 260px;
  }
}

@media (max-width: 900px) {
  .portal-shell {
    grid-template-columns: 1fr;
  }

  .portal-nav {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
  }

  .portal-nav__brand {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0.35rem;
    width: 100%;
  }

  .portal-nav__role {
    width: 100%;
  }

  .portal-nav__foot {
    width: 100%;
    margin-top: 0.5rem;
  }

  .portal-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .review-layout,
  .feed-layout:not(.feed-layout--ads),
  .form-grid--2,
  .compare-note {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .portal-stats {
    grid-template-columns: 1fr 1fr;
  }

  .feed-post__media .wf-placeholder {
    min-height: 200px;
  }
}

/* Last-wins: phone must be one column even if earlier 1100px rules match */
@media (max-width: 768px) {
  .feed-layout,
  .feed-layout--ads,
  .feed-layout--no-left {
    grid-template-columns: minmax(0, 1fr);
  }

  .feed-layout--ads .ad-rail,
  .feed-layout--ads .feed-rail {
    display: none;
  }
}

/*
  Desktop/tablet feed: only the story column scrolls.
  Side ads stay pinned in their grid cells.
*/
@media (min-width: 769px) {
  html:has(#view-feed:not([hidden])),
  body.is-feed {
    height: 100%;
    overflow: hidden;
  }

  body:has(#view-feed:not([hidden])),
  body.is-feed {
    height: 100dvh;
    overflow: hidden;
  }

  body:has(#view-feed:not([hidden])) .site-header,
  body.is-feed .site-header {
    flex: 0 0 auto;
  }

  body:has(#view-feed:not([hidden])) #view-feed,
  body.is-feed #view-feed {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  body:has(#view-feed:not([hidden])) .feed-layout--ads,
  body.is-feed .feed-layout--ads {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    align-items: stretch;
  }

  body:has(#view-feed:not([hidden])) .feed-main,
  body.is-feed .feed-main {
    min-width: 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2rem;
  }

  body:has(#view-feed:not([hidden])) .ad-rail,
  body.is-feed .ad-rail {
    position: relative;
    top: auto;
    align-self: start;
    max-height: 100%;
    overflow: hidden;
  }

  body:has(#view-feed:not([hidden])) .ad-rail--left .fake-ad__photo,
  body.is-feed .ad-rail--left .fake-ad__photo {
    height: 180px;
  }

  body:has(#view-feed:not([hidden])),
  body.is-feed {
    padding-bottom: 2.75rem;
  }

  body:has(#view-feed:not([hidden])) .site-footer,
  body.is-feed .site-footer {
    display: block;
    flex: 0 0 auto;
  }
}

/* ============================================================
   Facebook-style discussion on article pages
   ============================================================ */

.discussion {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--line-strong);
  max-width: 40rem;
}

.discussion__signin {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.discussion__signin p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.discussion__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.discussion__head .section__title {
  margin: 0;
  font-size: 1.25rem;
}

.discussion__sort {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.discussion__sort select {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.3rem 0.45rem;
  background: var(--surface);
  font: inherit;
  font-size: 0.8rem;
}

.discussion__meta {
  margin: 0 0 1.15rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.discussion__compose {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
}

.discussion__compose-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.discussion__compose-fields {
  flex: 1;
  min-width: 0;
}

.discussion__compose textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem;
  font: inherit;
  resize: vertical;
  min-height: 4.5rem;
  line-height: 1.45;
}

.discussion__compose-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.emoji-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
}

.emoji-btn {
  border: 1px solid transparent;
  background: var(--bg);
  border-radius: 6px;
  padding: 0.2rem 0.35rem;
  font-size: 1.05rem;
  cursor: pointer;
  line-height: 1;
}

.emoji-btn:hover {
  border-color: var(--line);
  background: var(--accent-soft);
}

.discussion__thread {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.fbcomment {
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  gap: 0.5rem;
  align-items: start;
}

.fbcomment__avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.fbcomment__main {
  min-width: 0;
}

.fbcomment__bubble {
  background: #eef0f2;
  border-radius: 1.1rem;
  padding: 0.45rem 0.8rem 0.5rem;
  display: inline-block;
  max-width: 100%;
}

.fbcomment--deleted .fbcomment__bubble {
  background: transparent;
  padding-left: 0;
}

.fbcomment__author {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}

.fbcomment__text {
  margin: 0.1rem 0 0;
  font-size: 0.92rem;
  line-height: 1.4;
  white-space: pre-wrap;
}

.fbcomment__bubble .forum-topic__photo {
  display: block;
  margin: 0.4rem 0 0.45rem;
}

.fbcomment--deleted .fbcomment__text {
  color: var(--muted);
  font-style: italic;
}

.fbcomment__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.65rem;
  margin: 0.2rem 0 0 0.8rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.fbcomment__link {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.fbcomment__link:hover,
.fbcomment__link.is-on {
  color: var(--accent);
  text-decoration: underline;
}

.fbcomment__link--danger:hover {
  color: var(--danger);
}

.fbcomment__likecount {
  font-weight: 600;
  color: var(--ink);
}

.fbcomment__edited {
  font-style: italic;
}

.fbcomment__reacts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.35rem;
}

.fbcomment .reaction-picker {
  position: relative;
}

.fbcomment .reaction-picker__menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  width: 16.5rem;
  padding: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  z-index: 8;
}

.fbcomment .reaction-picker__menu[hidden] {
  display: none;
}

[data-tip] {
  position: relative;
}

[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  background: #1a1a1a;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.3;
  white-space: nowrap;
  padding: 0.28rem 0.45rem;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.08s ease;
  z-index: 20;
}

[data-tip]:hover::after,
[data-tip]:focus-visible::after {
  opacity: 1;
}

.fbcomment .reaction-picker__menu .reaction-plus {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 0.35rem 0.45rem;
  color: var(--accent);
  background: var(--accent-soft);
}

.emoji-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  max-width: 22rem;
}

.discussion--fb .emoji-btn {
  border: 1px solid transparent;
  background: var(--bg);
  border-radius: 6px;
  padding: 0.15rem 0.28rem;
  font-size: 1.05rem;
  cursor: pointer;
  line-height: 1;
}

.discussion--fb .emoji-btn:hover {
  border-color: var(--line);
  background: var(--accent-soft);
}

.fbcomment__replies {
  margin-top: 0.55rem;
  margin-left: 0.35rem;
  padding-left: 0.85rem;
  border-left: 2px solid #e4e6ea;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.fbcomment--d2 { margin-left: 0; }
.fbcomment--d3 { }
.fbcomment--d4 { }

.fbcomment .fbcomment {
  margin-top: 0;
}

@media (max-width: 560px) {
  .fbcomment {
    grid-template-columns: 1.85rem 1fr;
    gap: 0.4rem;
  }
  .fbcomment__avatar {
    width: 1.85rem;
    height: 1.85rem;
    font-size: 0.6rem;
  }
}

.rcomment {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
}

.rcomment--reply {
  margin-top: 0.65rem;
  background: var(--bg);
  border-style: dashed;
}

.rcomment__vote {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding-top: 0.15rem;
}

.rcomment__arrow {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.7rem;
  line-height: 1;
  padding: 0.15rem;
}

.rcomment__arrow:hover,
.rcomment__arrow.is-active {
  color: var(--accent);
}

.rcomment__arrow.is-active.is-down,
.rcomment__arrow.is-active[data-val="-1"] {
  color: var(--danger);
}

.rcomment__collapse {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0;
}

.rcomment__collapse:hover {
  color: var(--accent);
}

.rcomment.is-collapsed .rcomment__text,
.rcomment.is-collapsed .rcomment__reactions,
.rcomment.is-collapsed .rcomment__actions,
.rcomment.is-collapsed .rcomment__replies,
.rcomment.is-collapsed .rcomment__vote,
.rcomment.is-collapsed .rcomment__edit-form {
  display: none;
}

.rcomment.is-collapsed {
  grid-template-columns: 1fr;
  opacity: 0.75;
  padding: 0.4rem 0.65rem;
}

.rcomment--deleted .rcomment__text {
  color: var(--muted);
  font-style: italic;
}

.rcomment__kids {
  font-size: 0.7rem;
}

.rcomment__score {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink);
}

.rcomment__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.rcomment__author {
  font-weight: 700;
  color: var(--ink);
}

.rcomment__op {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
}

.rcomment__text {
  margin: 0 0 0.55rem;
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.rcomment__reactions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--ink);
}

.reaction-chip:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.reaction-chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.reaction-chip__emoji {
  font-size: 0.95rem;
  line-height: 1;
}

.reaction-chip__count {
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--muted);
}

.reaction-chip[aria-pressed="true"] .reaction-chip__count {
  color: var(--accent);
}

.reaction-picker {
  position: relative;
}

.reaction-picker__toggle {
  border: 1px dashed var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--muted);
}

.reaction-picker__toggle:hover,
.reaction-picker__toggle[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.reaction-picker__menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 4px);
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  padding: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  z-index: 5;
  min-width: 11rem;
}

.reaction-picker__menu[hidden] {
  display: none;
}

.reaction-picker__menu button {
  border: 0;
  background: var(--bg);
  border-radius: 6px;
  font-size: 1.15rem;
  padding: 0.25rem 0.35rem;
  cursor: pointer;
  line-height: 1;
}

.reaction-picker__menu button:hover {
  background: var(--accent-soft);
}

.rcomment__actions {
  display: flex;
  gap: 0.75rem;
}

.rcomment__action {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  padding: 0;
}

.rcomment__action:hover {
  color: var(--accent);
}

.rcomment__action--danger:hover {
  color: var(--danger);
}

.rcomment__edited {
  font-style: italic;
}

.rcomment__edit-form {
  margin: 0.35rem 0 0.65rem;
}

.rcomment__edit-form textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.5rem 0.65rem;
  font: inherit;
  min-height: 4rem;
  resize: vertical;
  margin-bottom: 0.45rem;
}

.rcomment__edit-actions {
  display: flex;
  gap: 0.45rem;
}

.rcomment__reply-form {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}

.rcomment__reply-form textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.5rem 0.65rem;
  font: inherit;
  min-height: 3.5rem;
  resize: vertical;
  margin-bottom: 0.45rem;
}

.rcomment__reply-form .discussion__compose-actions {
  margin-top: 0;
}

.rcomment__replies {
  margin-top: 0.25rem;
}

@media (max-width: 560px) {
  .rcomment {
    grid-template-columns: 1.75rem 1fr;
    padding: 0.65rem;
  }

  .discussion__compose-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .discussion__compose-actions .btn {
    width: 100%;
  }
}

/* ============================================================
   Editor review — tags + line comments
   ============================================================ */

.line-body {
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.line-row {
  display: grid;
  grid-template-columns: 2.5rem 1fr 2.25rem;
  gap: 0.15rem 0.35rem;
  border: 0;
  align-items: start;
  margin-bottom: 0.35rem;
  border-radius: 4px;
}

.line-row:last-child {
  margin-bottom: 0;
}

.line-row.is-active {
  background: #eef5fc;
  box-shadow: inset 3px 0 0 var(--accent);
}

.line-row.has-comments .line-num {
  color: var(--accent);
  font-weight: 700;
}

.line-num {
  border: 1px solid var(--line);
  background: #fafaf8;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.45rem 0.25rem;
  text-align: center;
  border-radius: 4px;
  min-width: 2rem;
  margin-top: 0.25rem;
}

.line-num:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.line-row.is-active .line-num {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.line-text {
  padding: 0.45rem 0.35rem;
  font-family: var(--font-display);
  font-size: 1.02rem;
  line-height: 1.55;
  outline: none;
  min-height: 2.5rem;
  border: 0;
  background: transparent;
}

.line-text:focus {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 4px;
}

.line-comment-btn {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 0.9rem;
  opacity: 0.35;
  border-radius: 4px;
  padding: 0.35rem;
}

.line-row:hover .line-comment-btn,
.line-row.is-active .line-comment-btn {
  opacity: 1;
  background: var(--accent-soft);
}

.line-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid #b8c9de;
}

.line-active-label {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  vertical-align: middle;
}

.review-tags-block {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.review-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
  min-height: 2rem;
}

.review-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.35rem 0.3rem 0.65rem;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
}

.review-tag__remove {
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.3rem;
  border-radius: 50%;
}

.review-tag__remove:hover {
  background: rgba(44, 74, 110, 0.15);
}

.review-tags-add {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.review-tags-add input {
  flex: 1;
  min-width: 10rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.5rem 0.65rem;
  font: inherit;
}

.review-tags-block .chip {
  margin: 0.15rem 0.15rem 0 0;
}

@media (max-width: 700px) {
  .line-row {
    grid-template-columns: 2rem 1fr 2rem;
  }

  .line-text {
    font-size: 0.95rem;
  }
}

/* ===== Live app extras (login, views, media, quill) ===== */
.login-gate {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 400;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.login-gate[hidden],
.view[hidden],
[hidden] { display: none !important; }
.login-card { max-width: 24rem; width: 100%; }
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.45);
  z-index: 500;
  place-items: center;
  padding: 1rem;
}
.modal.open { display: grid; }
.modal-card { max-width: 28rem; width: 100%; max-height: 90vh; overflow: auto; }
img.lazy-media:not([src]),
img.lazy-media[src=""] {
  min-height: 180px;
  background: #e8e8e4;
}

.feed-post__media img,
.article-hero img,
.article-inline-photo img {
  width: 100%;
  display: block;
  max-height: 440px;
  object-fit: cover;
}
.feed-post__media-grid img { max-height: 180px; }
.story-body-html { font-family: var(--font-display); font-size: 1.05rem; line-height: 1.7; }
.story-body-html img { max-width: 100%; height: auto; }
.ql-container { min-height: 220px; font-family: var(--font); }
.ql-editor { min-height: 220px; }
.hidden { display: none !important; }
.empty { color: var(--muted); text-align: center; padding: 2rem 1rem; }
.pill {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: #9dccb0; }
.pill.bad { background: var(--danger-soft); color: var(--danger); }
.auth-tabs { margin: 0 0 1rem; }
.toast.is-visible, .toast.show { opacity: 1; transform: translateY(0); }
.geo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.geo-grid select { width: 100%; min-height: 6rem; }
.tag-pick-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip-check { font-size: 0.85rem; display: inline-flex; gap: 0.35rem; align-items: center; }
.feed-post__actions button.is-on { color: var(--accent); }
.nav-item__link--solo { cursor: pointer; }
.header-signout { background: none; border: 0; cursor: pointer; }
@media (max-width: 720px) {
  .geo-grid { grid-template-columns: 1fr 1fr; }
}

.forum-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.forum-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  flex-shrink: 0;
}
.forum-head .page-desc { margin-bottom: 0; }
.forum-compose { margin-bottom: 1.25rem; }
.forum-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-bottom: 0.75rem; }
.forum-list { display: flex; flex-direction: column; gap: 0.75rem; }
.phpbb {
  display: flex;
  flex-direction: column;
  max-width: 52rem;
}
.phpbb-index { max-width: 40rem; }
.phpbb-cat__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  background: var(--accent);
  color: #fff;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.55rem 1rem;
}
.phpbb-cat__head a {
  color: #fff;
  text-decoration: none;
}
.phpbb-cat__head a:hover { text-decoration: underline; }
.phpbb-cat__meta {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  opacity: 0.75;
  text-transform: none;
}
.phpbb-cat__action {
  appearance: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: #fff;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
  border-radius: 2px;
}
.phpbb-cat__action:hover {
  background: rgba(255, 255, 255, 0.12);
  text-decoration: none;
}
.phpbb-table {
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(26, 26, 26, 0.04);
}
.phpbb-cols,
.phpbb-forum,
.phpbb-topic {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 5rem 5rem minmax(9rem, 13rem);
  gap: 0.75rem;
  align-items: start;
}
.phpbb-cols--topics,
.phpbb-topic {
  grid-template-columns: minmax(0, 1fr) 5rem minmax(8rem, 11rem);
}
.phpbb-cols {
  background: #f0f0ec;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.4rem 1rem;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.phpbb-place {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  background: var(--surface);
}
.phpbb-place:last-child { border-bottom: 0; }
.phpbb-place:hover {
  background: var(--accent-soft);
  text-decoration: none;
}
.phpbb-place.is-home { box-shadow: inset 3px 0 0 var(--accent); }
.phpbb-place__main {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}
.phpbb-place__name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.2;
}
.phpbb-place:hover .phpbb-place__name { color: var(--accent); }
.phpbb-place__desc,
.phpbb-place__count {
  font-size: 0.78rem;
  color: var(--muted);
}
.phpbb-place__count {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.phpbb-forum,
.phpbb-topic,
a.phpbb-forum {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  background: var(--surface);
}
a.phpbb-forum:hover { text-decoration: none; }
.phpbb-forum:last-child,
.phpbb-topic:last-child { border-bottom: 0; }
.phpbb-forum:hover,
.phpbb-topic:hover {
  background: var(--accent-soft);
  text-decoration: none;
}
.phpbb-forum.is-pinned { box-shadow: inset 3px 0 0 var(--accent); }
.phpbb-forum__main,
.phpbb-topic__main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
.phpbb-forum__name,
.phpbb-topic__title {
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.25;
}
.phpbb-forum__name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem;
}
.phpbb-forum:hover .phpbb-forum__name,
.phpbb-topic:hover .phpbb-topic__title { text-decoration: underline; }
.phpbb-forum__desc,
.phpbb-topic__by,
.phpbb-last__meta {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
}
.phpbb-num {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-size: 0.9rem;
  padding-top: 0.12rem;
}
.phpbb-last {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.8rem;
  min-width: 0;
}
.phpbb-last__link {
  color: var(--accent);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.phpbb-pin {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid #c5d0de;
  padding: 0.08rem 0.35rem;
  border-radius: 2px;
  line-height: 1.3;
}
.phpbb-empty {
  padding: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.phpbb-empty--cta p { margin: 0; max-width: 36rem; }
@media (max-width: 700px) {
  .phpbb-cols,
  .phpbb-forum {
    grid-template-columns: minmax(0, 1fr) 3.75rem 3.75rem;
  }
  .phpbb-forum .phpbb-last,
  .phpbb-cols > span:last-child { display: none; }
  .phpbb-cols--topics,
  .phpbb-topic {
    grid-template-columns: minmax(0, 1fr) 4.5rem;
  }
  .phpbb-topic .phpbb-last,
  .phpbb-cols--topics > span:last-child { display: none; }
  .phpbb-place__count span { display: none; }
}
.forum-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  text-decoration: none;
  color: inherit;
}
.forum-card:hover { border-color: var(--line-strong); }
.forum-card.is-pinned { border-color: var(--accent); background: var(--accent-soft); }
.forum-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.forum-card__title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 0.25rem;
}
.forum-card__excerpt { margin: 0; color: var(--ink); }
.forum-pin {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.forum-card__thumb {
  display: block;
  max-width: 12rem;
  max-height: 8rem;
  object-fit: cover;
  border-radius: var(--radius);
  margin-top: 0.55rem;
}
.forum-photo-preview {
  display: block;
  max-width: 16rem;
  max-height: 10rem;
  object-fit: cover;
  border-radius: var(--radius);
  margin-top: 0.5rem;
  border: 1px solid var(--line-strong);
  background: #fff;
}
.forum-picker { margin-top: 0.25rem; }
.forum-picker__ready {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 0.5rem;
  padding: 0.65rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--accent-soft);
}
.forum-picker__ready[hidden] { display: none; }
.forum-picker__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}
.forum-picker__ok { color: var(--accent); font-size: 0.9rem; }
.forum-attach {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}
.forum-attach input {
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
}
.forum-attach:hover { text-decoration: underline; }
.forum-topic__title { font-family: var(--font-display); font-size: 1.6rem; margin: 0 0 0.4rem; }
.forum-topic__meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 1rem; }
.forum-topic__body { font-size: 1.05rem; line-height: 1.55; margin-bottom: 1rem; white-space: pre-wrap; }
.forum-topic__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1rem; }
.forum-topic__photo { max-width: 100%; border-radius: var(--radius); margin: 0 0 0.5rem; }
.forum-topic__photo-wrap { margin: 0 0 1rem; }
.forum-edit-photo { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.5rem 0; }
.forum-replies { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 0.85rem; }
.forum-reply {
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}
.forum-reply__meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.25rem; }
.forum-reply__body { white-space: pre-wrap; margin: 0; }
.forum-status {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: var(--accent-soft);
}
@media (max-width: 720px) {
  .forum-head { flex-direction: column; }
}
