/* KMS magazine theme — clean-room stylesheet (visual parity with the live install;
   refined against insights.carlosartiles.com in the side-by-side pass). */
:root {
  /* Sourced from the --kms-* token block emitted by base.html (KMS Colors screen,
     Settings → Colors). Fallbacks = the original hardcoded values, so the look is
     unchanged until an operator configures tokens. */
  --primary: var(--kms-accent, #2d65fe);
  --dark: var(--kms-band, #161616);
  --body-bg: #ffffff;
  --surface: var(--kms-box-bg, #f9f9f9);
  --text: var(--kms-ink, #16181b);
  --text-muted: var(--kms-muted, #6c757d);
  --border: var(--kms-line, #e6e6e6);
  /* live-install font stack: primary = body, secondary = headings/nav */
  --font-primary: var(--kms-body-font, "Open Sans", Helvetica, sans-serif);
  --font-secondary: var(--kms-heading-font, "Inter", sans-serif);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--body-bg); color: var(--text); font: 14px/1.6 var(--font-primary); }
h1, h2, h3, h4, h5, h6, .nav-link, .widget-title, .btn-custom, .btn-custom-outline { font-family: var(--font-secondary); }
body.dark-mode { --body-bg: #101010; --surface: #1e1e1e; --text: #e8e8e8; --text-muted: #9aa0a6; --border: #2b2b2b; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }
img { max-width: 100%; height: auto; display: block; }
.container-xl { max-width: 1320px; margin: 0 auto; padding: 0 16px; }
.m0 { margin: 0; }

/* ── top bar ── */
.nav-top { background: var(--dark); color: #cfcfcf; font-size: 13px; }
.nav-top-inner { display: flex; justify-content: space-between; align-items: center; min-height: 36px; }
.nav-top a { color: #cfcfcf; margin-right: 14px; }
.nav-top a:hover { color: #fff; }
.nav-top-right { display: flex; align-items: center; gap: 12px; }
.nav-user { color: #fff; font-weight: 600; }
.btn-mode { background: none; border: 0; color: #cfcfcf; cursor: pointer; padding: 4px; display: flex; }
.btn-mode:hover { color: #fff; }

/* ── main nav ── */
.nav-main { background: var(--body-bg); border-bottom: 1px solid var(--border); position: relative; }
.nav-main-inner { display: flex; align-items: center; gap: 8px; min-height: 64px; position: relative; }
.navbar-brand .logo { max-height: 44px; width: auto; }
.logo-text { font-size: 22px; font-weight: 800; }
.navbar-nav { display: flex; align-items: center; list-style: none; margin: 0 0 0 18px; padding: 0; flex-wrap: wrap; }
.navbar-nav > li { position: relative; }
.nav-link { display: block; padding: 20px 13px; font-weight: 600; font-size: 14.5px; text-transform: uppercase; letter-spacing: .2px; }
.nav-link:hover { color: var(--primary); }
.nav-dropdown { display: none; position: absolute; top: 100%; left: 0; background: var(--body-bg); border: 1px solid var(--border); box-shadow: 0 8px 20px rgba(0,0,0,.08); min-width: 200px; list-style: none; margin: 0; padding: 6px 0; z-index: 50; }
.navbar-nav > li:hover .nav-dropdown { display: block; }
.nav-dropdown a { display: block; padding: 8px 16px; font-size: 14px; }
.nav-dropdown a:hover { background: var(--surface); color: var(--primary); }
.nav-right { margin-left: auto; display: flex; align-items: center; }
.search-icon { background: none; border: 0; cursor: pointer; color: var(--text); padding: 8px; display: flex; }
.search-form { display: none; position: absolute; right: 0; top: 100%; background: var(--body-bg); border: 1px solid var(--border); padding: 10px; z-index: 60; box-shadow: 0 8px 20px rgba(0,0,0,.08); }
.search-form.open { display: block; }
.search-form form { display: flex; gap: 6px; }
.nav-burger { display: none; background: none; border: 0; cursor: pointer; padding: 8px; margin-left: auto; }
.nav-burger span { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; }

/* ── buttons / forms ── */
.btn-custom { background: var(--primary); color: #fff; border: 0; padding: 9px 18px; font-weight: 600; font-size: 14px; cursor: pointer; display: inline-block; }
.btn-custom:hover { filter: brightness(.92); color: #fff; }
.btn-custom-outline { border: 1px solid var(--primary); color: var(--primary); padding: 9px 22px; font-weight: 600; font-size: 14px; display: inline-block; }
.btn-custom-outline:hover { background: var(--primary); color: #fff; }
.btn-block { width: 100%; }
.form-input { width: 100%; border: 1px solid var(--border); background: var(--body-bg); color: var(--text); padding: 9px 12px; font-size: 14px; }
.form-input:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.form-label { display: block; font-weight: 600; font-size: 13px; margin: 14px 0 5px; }

/* ── sections ── */
.title-index { position: absolute; left: -9999px; }
.section { padding: 22px 0; }
.section-title { border-bottom: 2px solid var(--dark); margin-bottom: 18px; }
body.dark-mode .section-title { border-color: #e8e8e8; }
.section-title .title { display: inline-block; margin: 0; padding: 8px 0; font-size: 21px; font-weight: 800; border-bottom: 2px solid var(--primary); margin-bottom: -2px; text-transform: uppercase; }

/* ── newsticker ── */
.section-newsticker { padding: 14px 0 4px; }
.newsticker-container { display: flex; align-items: center; gap: 14px; background: var(--surface); padding: 9px 14px; }
.newsticker-title { display: flex; align-items: center; gap: 6px; background: var(--primary); color: #fff; font-size: 12.5px; font-weight: 700; text-transform: uppercase; padding: 5px 11px; white-space: nowrap; }
.newsticker { list-style: none; margin: 0; padding: 0; overflow: hidden; flex: 1; min-width: 0; }
.newsticker li { display: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; font-size: 14px; }
.newsticker li.active { display: block; }
.newsticker-nav { display: flex; gap: 5px; }
.newsticker-nav button, .slider-nav { background: var(--dark); color: #fff; border: 0; width: 28px; height: 28px; cursor: pointer; font-size: 17px; line-height: 1; }
.newsticker-nav button:hover { background: var(--primary); }

/* ── featured slider ── */
.featured-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.featured-slider { position: relative; overflow: hidden; background: var(--dark); }
.featured-slider .slide { display: none; position: relative; }
.featured-slider .slide.active { display: block; }
.featured-slider .slide img { width: 100%; aspect-ratio: 16/9; object-fit: cover; opacity: .92; }
.slide-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px; background: linear-gradient(transparent, rgba(0,0,0,.85)); color: #fff; }
.slide-caption .title { margin: 8px 0 6px; font-size: 26px; line-height: 1.25; color: #fff; }
.slide-caption .post-meta { color: #ddd; font-size: 13px; }
.slide-caption .post-meta a { color: #fff; }
.cat-label { display: inline-block; color: #fff; font-size: 11.5px; font-weight: 700; text-transform: uppercase; padding: 3.5px 9px; }
.slider-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; opacity: .75; }
.slider-nav:hover { opacity: 1; background: var(--primary); }
.slider-nav.prev { left: 10px; }
.slider-nav.next { right: 10px; }
.slider-dots { position: absolute; bottom: 10px; right: 14px; display: flex; gap: 6px; z-index: 5; }
.slider-dots .dot { width: 9px; height: 9px; border-radius: 50%; border: 0; background: rgba(255,255,255,.45); cursor: pointer; padding: 0; }
.slider-dots .dot.active { background: #fff; }
.featured-side { display: grid; grid-template-rows: repeat(4, 1fr); gap: 10px; }
.featured-item { position: relative; overflow: hidden; background: var(--dark); }
.featured-item img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; opacity: .9; }
.featured-item-caption { position: relative; z-index: 2; display: flex; align-items: flex-end; height: 100%; min-height: 96px; padding: 12px; background: linear-gradient(transparent 30%, rgba(0,0,0,.85)); }
.featured-item-caption .title { margin: 0; color: #fff; font-size: 14.5px; line-height: 1.35; }

/* ── post cards ── */
.row { display: grid; gap: 16px; }
.row-vr, .row .col-3-lg { min-width: 0; }
.row-vr { grid-template-columns: repeat(4, 1fr); margin-bottom: 16px; }
.row-small { grid-template-columns: repeat(3, 1fr); }
.section-content .row { margin-bottom: 14px; }
.post-item .title a:hover { color: var(--primary); }
.post-item-vr { position: relative; background: var(--dark); overflow: hidden; }
/* Top row of every category block (D-2026-78). The box was 306/340 = 0.90
   (portrait) while the posts' images are 3:2 landscape, so `cover` kept the
   height and threw away 40% of the width — measured: the Morning Brief weekday
   banners need 79% (Wednesday) and 63% (Thursday) of their width for the word
   to survive, so both were being cut. 4/3 shows 89%: every weekday fits with
   ~10 points to spare for a longer word later. */
.post-item-vr .image img { width: 100%; aspect-ratio: 4/3; object-fit: cover; opacity: .88; }
/* Caption scrim: the old 2-stop linear ramp started at the box edge, so the
   title sat where the alpha was still ~0.35 (2.3:1 over a light banner — below
   AA). Seven stops keep the plateau under the whole text block and fade only
   above it (no visible edge); `padding-top` raises the ceiling WITHOUT moving
   the text, which is bottom-anchored. Measured worst case (scrim over a pure
   white pixel): title 11.9:1, meta 10.3:1. Tint is near-black navy, not pure
   black, to sit with the brand band colour. */
.post-item-vr .caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 44px 16px 16px;
  background: linear-gradient(to top, rgba(9,13,22,.94) 0%, rgba(9,13,22,.92) 38%,
    rgba(9,13,22,.86) 62%, rgba(9,13,22,.74) 76%, rgba(9,13,22,.45) 87%,
    rgba(9,13,22,.18) 94%, rgba(9,13,22,0) 100%); }
.post-item-vr .caption .title a { text-shadow: 0 1px 2px rgba(0,0,0,.45); }
.post-item-vr .caption .post-meta { text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.post-item-vr .caption .title { margin: 0 0 6px; font-size: 16px; line-height: 1.35; }
.post-item-vr .caption .title a { color: #fff; display: block; }
.post-item-vr .post-meta { color: #ccc; font-size: 12.5px; }
.post-item-vr .post-meta a { color: #eee; }
.post-item-small { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.post-item-small .image { flex: 0 0 90px; }
.post-item-small .image img { width: 90px; height: 68px; object-fit: cover; }
.post-item-small .title { margin: 0 0 4px; font-size: 14.5px; line-height: 1.35; font-weight: 600; }
.small-post-meta, .post-meta { color: var(--text-muted); font-size: 12.5px; margin: 0; }
.small-post-meta a, .post-meta a { color: var(--text-muted); }
.post-item-horizontal { display: flex; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--border); }
.post-item-horizontal .image { flex: 0 0 230px; }
.post-item-horizontal .image img { width: 230px; height: 150px; object-fit: cover; }
.post-item-horizontal .title { margin: 0 0 7px; font-size: 18.5px; line-height: 1.35; }
.post-item-horizontal .summary { margin: 0 0 8px; color: var(--text-muted); font-size: 14px; }
.post-item-big .image img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.post-item-big .title-lg { margin: 12px 0 8px; font-size: 22px; line-height: 1.3; }
.post-item-big .summary { color: var(--text-muted); margin: 0 0 8px; }
.col-6-lg { min-width: 0; }
.section-content .row:has(.col-6-lg) { grid-template-columns: 1fr 1fr; }

/* ── latest + sidebar ── */
.latest-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 34px; }
.latest-grid.no-sidebar { grid-template-columns: minmax(0, 1fr); }
/* post detail: breathing room between the article column and the sidebar */
.section-post .latest-grid { gap: 64px; }
.post-fb-comments { margin: 22px 0; }
.maintenance-wrap { text-align: center; padding: 90px 16px; }
.maintenance-title { font-size: 40px; margin-bottom: 12px; }
.maintenance-desc { color: var(--text-muted); font-size: 17px; max-width: 560px; margin: 0 auto; }
.latest-more { padding: 18px 0; text-align: center; }
.sidebar .widget { margin-bottom: 28px; }
.widget-title { font-size: 17px; font-weight: 800; text-transform: uppercase; border-bottom: 2px solid var(--dark); padding-bottom: 8px; margin: 0 0 12px; }
body.dark-mode .widget-title { border-color: #e8e8e8; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-badge { border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 12.5px; padding: 5px 11px; }
.tag-badge:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.follow-links { display: flex; flex-wrap: wrap; gap: 8px; }
.follow-link { border: 1px solid var(--border); padding: 6px 12px; font-size: 13px; }
.follow-link:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── post detail ── */
.breadcrumb { display: flex; gap: 8px; color: var(--text-muted); font-size: 13px; margin-bottom: 14px; flex-wrap: wrap; }
.post-title { font-size: 32px; line-height: 1.25; margin: 12px 0 10px; }
.post-summary { font-size: 17px; color: var(--text-muted); margin: 0 0 12px; }
.post-detail-meta { display: flex; gap: 8px; align-items: center; color: var(--text-muted); font-size: 13.5px; margin-bottom: 18px; flex-wrap: wrap; }
.post-detail-meta .author { font-weight: 700; color: var(--text); }
/* meta row parity with the live install: author · dates · comments/views right */
.post-details-meta { display: flex; gap: 16px; align-items: center; color: var(--text-muted); font-size: 13.5px; margin-bottom: 14px; flex-wrap: wrap; }
.post-details-meta .item-meta { display: inline-flex; align-items: center; gap: 5px; }
.post-details-meta .item-meta-author { font-weight: 700; color: var(--text); }
.post-details-meta .meta-right { margin-left: auto; display: inline-flex; align-items: center; gap: 14px; }
.post-details-meta .meta-count { color: var(--text-muted); }
.post-details-meta .meta-count:hover { color: var(--primary); }
.post-edit-link { display: inline-flex; align-items: center; gap: 5px; color: var(--primary); font-weight: 600; border: 1px solid var(--primary); padding: 2px 10px; border-radius: 3px; font-size: 12.5px; }
.post-edit-link:hover { background: var(--primary); color: #fff; }
/* share buttons row — networks are CMS-driven (SOCIAL_LINKS_KMS_SYNC_PLAN), so the
   base carries a neutral accent fallback and each known network overrides it. */
.post-share-buttons { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.share-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; background: var(--kms-accent, #2d65fe); border: 0; padding: 0; cursor: pointer; }
.share-btn:hover { color: #fff; filter: brightness(1.12); }
.s-facebook { background: #4267b2; }
.s-twitter, .s-x { background: #111111; }
.s-linkedin { background: #0077b5; }
.s-whatsapp { background: #25d366; }
.s-pinterest { background: #e60023; }
.s-reddit { background: #ff4500; }
.s-telegram { background: #229ed9; }
.s-threads { background: #000000; }
.s-bluesky { background: #0085ff; }
.s-tumblr { background: #34526f; }
.s-email { background: #6c757d; }
.s-copy { background: #6c757d; }
.post-image { margin: 0 0 20px; }
.post-image img { width: 100%; }
.post-image figcaption { color: var(--text-muted); font-size: 12.5px; padding-top: 6px; }
.post-content { font-size: 16px; line-height: 1.75; overflow-wrap: break-word; }
.post-content img { margin: 12px auto; }
.post-content table { max-width: 100%; overflow-x: auto; display: block; }
.post-optional-url { margin: 22px 0; }
.post-tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 24px 0; }
.post-reactions { border: 1px solid var(--border); background: var(--surface); padding: 18px; margin: 26px 0; }
.reactions-title { margin: 0 0 14px; font-size: 15px; text-transform: uppercase; text-align: center; }
.reactions-row { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.reaction { background: var(--body-bg); border: 1px solid var(--border); cursor: pointer; padding: 10px 14px; text-align: center; min-width: 72px; color: var(--text); }
.reaction:hover { border-color: var(--primary); }
.reaction .emoji { display: block; font-size: 22px; }
.reaction .count { display: block; font-weight: 700; font-size: 14px; }
.reaction .label { display: block; color: var(--text-muted); font-size: 11.5px; text-transform: uppercase; }
.post-related { margin-top: 30px; }
.post-related .row-small { grid-template-columns: 1fr 1fr; }

/* ── pagination / misc ── */
.pagination { display: flex; gap: 6px; padding: 22px 0; flex-wrap: wrap; }
.page-link, .page-current { border: 1px solid var(--border); padding: 7px 13px; font-size: 14px; }
.page-current { background: var(--primary); border-color: var(--primary); color: #fff; }
.no-results { color: var(--text-muted); padding: 30px 0; }

/* ── footer ── */
#footer { background: var(--dark); color: #bdbdbd; margin-top: 34px; font-size: 14px; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px; padding: 40px 16px; }
.footer-col h4 { color: #fff; font-size: 15px; text-transform: uppercase; margin: 0 0 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a:hover { color: #fff; }
.logo-footer { max-height: 42px; width: auto; margin-bottom: 12px; }
/* Follow us (D-2026-79). Was `flex-direction: column` — fine for the 2–3 links
   this shipped with, a 14-row tower now that Settings → Social Links drives it
   (32 brand glyphs available). Grid instead: `auto-fill` lets the column decide
   how many fit (6 at the footer's ~217–240px, fewer when narrower) and rows
   grow as needed; `max-width` stops it stretching into a single wide line when
   the footer collapses to one column on mobile. Tiles echo the sidebar's
   `.follow-link` chips (border + primary fill on hover), adapted to the dark
   footer, so both social rows read as the same component. */
.footer-social { display: grid; grid-template-columns: repeat(auto-fill, minmax(30px, 1fr));
  gap: 6px; max-width: 216px; }
.footer-social a { display: flex; align-items: center; justify-content: center; aspect-ratio: 1;
  border: 1px solid rgba(255,255,255,.14); border-radius: 6px; color: #bdbdbd;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease; }
.footer-social a:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.footer-copyright { border-top: 1px solid #2b2b2b; padding: 14px 0; font-size: 13px; }

/* Back to top (D-2026-80) — same behaviour as the beta's BackToTop.js.
   Hidden by default and revealed past 300px; `visibility` (not display) keeps
   the transition alive, `pointer-events` keeps it unclickable while hidden.
   It sits ABOVE the cookies banner (z-index 200) and BELOW the subscribe
   overlay (100000); `:has()` lifts it over the banner while that is on screen
   and drops it back the moment the visitor accepts. */
.to-top { position: fixed; right: 24px; bottom: 24px; z-index: 210;
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; cursor: pointer;
  background: var(--primary); color: #fff; box-shadow: 0 6px 20px -6px rgba(0,0,0,.45);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  /* visibility is DELAYED, not transitioned: it flips to visible instantly on
     show and only hides once the fade has finished. Transitioning it leaves the
     computed value indeterminate mid-flight; keeping it (instead of opacity
     alone) is what takes the button out of the a11y tree while hidden. */
  transition: opacity 180ms ease-out, transform 180ms ease-out, visibility 0s linear 180ms; }
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0);
  transition: opacity 180ms ease-out, transform 180ms ease-out, visibility 0s; }
.to-top:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -8px rgba(0,0,0,.5); }
.to-top:active { transform: translateY(0) scale(.96); }
body:has(.cookies-banner) .to-top { bottom: 88px; }
@media (prefers-reduced-motion: reduce) {
  .to-top, .to-top:hover, .to-top:active { transition: opacity 180ms ease-out, visibility 0s linear 180ms; transform: none; }
  .to-top.show { transition: opacity 180ms ease-out, visibility 0s; transform: none; }
}

/* ── gallery ── */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.album-card, .gallery-item { position: relative; display: block; background: var(--dark); overflow: hidden; }
.album-card img, .gallery-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; opacity: .92; transition: transform .25s; }
.album-card:hover img, .gallery-item:hover img { transform: scale(1.03); }
.album-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px; background: linear-gradient(transparent, rgba(0,0,0,.85)); color: #fff; }
.album-caption .title { margin: 0; font-size: 16px; color: #fff; }
.album-caption .count { font-size: 12.5px; color: #ddd; }
@media (max-width: 991px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575px) { .gallery-grid { grid-template-columns: 1fr; } }

/* ── cookies banner ── */
.cookies-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 200; background: var(--dark); color: #ddd; display: flex; align-items: center; justify-content: center; gap: 18px; padding: 14px 18px; flex-wrap: wrap; box-shadow: 0 -4px 16px rgba(0,0,0,.25); }
.cookies-text { font-size: 13.5px; max-width: 820px; }
.cookies-text p { margin: 0; }
.cookies-text a { text-decoration: underline; }

/* ── login ── */
.login-body { background: var(--surface); display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-card { background: var(--body-bg); border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0,0,0,.06); width: 100%; max-width: 400px; padding: 34px; }
.login-logo { text-align: center; margin-bottom: 18px; }
.login-logo img { max-height: 52px; margin: 0 auto; }
.login-title { font-size: 21px; margin: 0 0 4px; text-align: center; }
.login-sub { color: var(--text-muted); font-size: 13.5px; text-align: center; margin: 0 0 18px; }
.login-error { background: #fdecec; border: 1px solid #f5b5b5; color: #a33; font-size: 13.5px; padding: 9px 12px; margin-bottom: 12px; }
.login-card .btn-custom { margin-top: 20px; }

/* ── responsive ── */
@media (max-width: 991px) {
  .navbar-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--body-bg); border-bottom: 1px solid var(--border); flex-direction: column; align-items: stretch; margin: 0; z-index: 70; }
  .navbar-nav.open { display: flex; }
  .navbar-nav .nav-link { padding: 13px 18px; border-top: 1px solid var(--border); }
  .nav-dropdown { position: static; display: block; box-shadow: none; border: 0; padding-left: 16px; }
  .nav-burger { display: block; }
  .nav-right { margin-left: 0; }
  .featured-grid { grid-template-columns: 1fr; }
  .featured-side { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .row-vr { grid-template-columns: repeat(2, 1fr); }
  .row-small { grid-template-columns: 1fr; }
  .latest-grid { grid-template-columns: 1fr; }
  .section-content .row:has(.col-6-lg) { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 575px) {
  .row-vr { grid-template-columns: 1fr; }
  .post-item-horizontal { flex-direction: column; }
  .post-item-horizontal .image, .post-item-horizontal .image img { width: 100%; height: auto; flex-basis: auto; }
  .post-title { font-size: 25px; }
  .footer-inner { grid-template-columns: 1fr; }
  .featured-side { grid-template-columns: 1fr; }
  .newsticker-title span { display: none; }
  /* s154: related posts go single-column (beats `.post-related .row-small`) */
  .post-related .row-small { grid-template-columns: 1fr; }
  /* s154: finger-sized header controls */
  .btn-mode { min-width: 40px; min-height: 40px; }
  .nav-top-right a { display: inline-flex; align-items: center; min-height: 40px; }
  /* s154: Morning Brief scorecard (print-style single row) wraps to 2 per row */
  .scorecard { flex-wrap: wrap !important; }
  .scorecard > .sc { flex: 1 1 calc(50% - 6px) !important; min-width: 0; }
}
.post-item-small .caption { min-width: 0; }

/* ── Phase 4a: comments / poll / newsletter / ads ───────────────────────── */
.post-comments { margin-top: 34px; border-top: 1px solid var(--vr-border, #e5e5e5); padding-top: 22px; }
.comment { padding: 14px 0; border-bottom: 1px solid var(--vr-border, #eee); }
.comment-child { margin-left: 34px; border-bottom: 0; padding-bottom: 0; }
.comment-head { display: flex; gap: 10px; align-items: baseline; font-size: 13px; margin-bottom: 4px; }
.comment-author { font-weight: 700; }
.comment-date { color: #8a8a8a; font-size: 12px; }
.comment-reply-link { margin-left: auto; font-size: 12px; cursor: pointer; }
.comment-body { margin: 0; white-space: pre-wrap; word-break: break-word; }
.comment-form { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.comment-form textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--vr-border, #ddd); border-radius: 4px; font: inherit; resize: vertical; }
.comment-notice { background: #eef7ee; border: 1px solid #cfe8cf; color: #2e6b2e; padding: 10px 14px; border-radius: 4px; margin-bottom: 14px; font-size: 14px; }
.comment-replying { font-size: 13px; color: #666; }
.text-soft { color: #8a8a8a; }
.widget-poll .poll-question { font-weight: 700; margin: 0 0 10px; }
.poll-form { display: flex; flex-direction: column; gap: 7px; align-items: flex-start; }
.poll-option { display: flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; }
.btn-poll { margin-top: 6px; }
.poll-result { margin-bottom: 9px; font-size: 13px; }
.poll-result-label { display: block; margin-bottom: 3px; }
.poll-bar { background: var(--vr-border, #eee); border-radius: 3px; height: 8px; overflow: hidden; }
.poll-bar-fill { background: var(--vr-primary, #2d65fe); height: 100%; }
.poll-result-count { color: #8a8a8a; font-size: 12px; }
.poll-total { margin: 8px 0 0; color: #8a8a8a; font-size: 12px; }
.newsletter-form { display: flex; flex-direction: column; gap: 8px; }
.newsletter-form input[type=email] { padding: 9px 12px; border: 1px solid var(--vr-border, #ddd); border-radius: 4px; font: inherit; }
.widget-custom-body { font-size: 14px; }
.widget-custom-body img { max-width: 100%; height: auto; }
.ad-space { display: flex; justify-content: center; margin: 14px auto; }
.ad-space img { max-width: 100%; height: auto; }
.ad-desktop { display: block; }
.ad-mobile { display: none; }
@media (max-width: 767px) {
  .ad-desktop { display: none; }
  .ad-mobile { display: block; }
  .comment-child { margin-left: 16px; }
}

/* ── Phase 4b: reading list / follow / comment likes ────────────────────── */
.reading-list-form { margin: 18px 0 0; display: flex; gap: 14px; align-items: center; }
.btn-reading-list { cursor: pointer; }
.reading-list-link { font-size: 13px; }
.inline-like-form { display: inline; margin: 0; }
.comment-like-btn { background: none; border: 1px solid var(--vr-border, #ddd); border-radius: 12px; padding: 1px 9px; font-size: 12px; cursor: pointer; color: inherit; }
.comment-like-btn.liked { border-color: var(--vr-primary, #2d65fe); color: var(--vr-primary, #2d65fe); cursor: default; }
.profile-follow { display: flex; gap: 14px; align-items: center; margin-top: 6px; }
.follower-count { font-size: 14px; color: #8a8a8a; }
.ad-post-content { margin: 18px auto; }

/* ── Phase 4c-1: post-type rendering ────────────────────────────────────── */
.post-video-embed { position: relative; padding-top: 56.25%; margin: 18px 0; }
.post-video-embed iframe, .post-video-embed video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.post-audios { margin: 18px 0; }
.post-audio { border: 1px solid var(--vr-border, #e5e5e5); border-radius: 6px; padding: 12px 14px; margin-bottom: 12px; }
.post-audio audio { width: 100%; display: block; margin: 6px 0; }
.audio-name { font-weight: 700; margin-bottom: 4px; }
.audio-download { font-size: 13px; }
.post-toc { border: 1px solid var(--vr-border, #e5e5e5); border-radius: 6px; padding: 14px 18px; margin: 18px 0; }
.post-toc ol { margin: 8px 0 0 18px; }
.post-toc li { margin: 4px 0; }
.post-item { margin: 26px 0; scroll-margin-top: 80px; }
.post-item-title .item-num { color: var(--vr-primary, #2d65fe); }

/* ── Phase 4c-2: quiz / poll / recipe ───────────────────────────────────── */
.quiz-q { border: 1px solid var(--vr-border, #e5e5e5); border-radius: 6px; padding: 16px 18px; margin: 16px 0; }
.quiz-q-title { margin: 0 0 6px; font-size: 18px; }
.quiz-q-desc { color: #8a8a8a; margin: 0 0 8px; }
.quiz-ans { display: block; padding: 8px 10px; border: 1px solid var(--vr-border, #e5e5e5); border-radius: 4px; margin: 6px 0; cursor: pointer; }
.quiz-ans.ans-correct { border-color: #2e9e5b; background: rgba(46,158,91,.08); }
.quiz-q.q-wrong { border-color: #cc4b37; }
.quiz-q.q-correct { border-color: #2e9e5b; }
.quiz-result { border: 2px solid var(--vr-primary, #2d65fe); border-radius: 6px; padding: 16px 18px; margin: 16px 0; }
.poll-option { margin: 8px 0; }
.poll-vote-btn.voted { border-color: var(--vr-primary, #2d65fe); color: var(--vr-primary, #2d65fe); }
.poll-bar-wrap { position: relative; background: rgba(128,128,128,.12); border-radius: 4px; height: 22px; margin-top: 4px; overflow: hidden; }
.poll-bar { position: absolute; inset: 0 auto 0 0; background: var(--vr-primary, #2d65fe); opacity: .25; }
.poll-pct { position: absolute; left: 8px; top: 2px; font-size: 12px; }
.recipe-card { border: 1px solid var(--vr-border, #e5e5e5); border-radius: 6px; padding: 18px 22px; margin: 18px 0; }
.recipe-meta { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 10px; }
.recipe-ingredients { margin: 8px 0 16px 20px; }
.recipe-directions { margin: 8px 0 0 20px; }
.recipe-directions li { margin: 8px 0; }

/* hidden attribute must always win over author display rules */
[hidden] { display: none !important; }

/* ============================================================================
   Reading-comprehension quiz (member-only, article-attached) — Stage 1
   CTA card at the end of the article + a modal that runs one question at a
   time with instant correct/incorrect feedback + explanation, then a score.
   ========================================================================== */
.kms-quiz-cta {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin: 26px 0; padding: 18px 22px; border-radius: 14px;
  border: 1px solid var(--kms-line, #e5e7eb);
  background: color-mix(in srgb, var(--kms-accent, #2d65fe) 6%, transparent);
  font-family: var(--kms-body-font, inherit);
}
.kms-quiz-cta-text { flex: 1 1 260px; }
.kms-quiz-cta-title { margin: 0 0 4px; font-size: 17px; font-weight: 700; color: var(--kms-ink, #111827); }
.kms-quiz-cta-sub { margin: 0; font-size: 13.5px; line-height: 1.5; color: color-mix(in srgb, var(--kms-ink, #111827) 66%, transparent); }
.kms-quiz-open { white-space: nowrap; }

/* modal shell */
.kms-quiz-modal { position: fixed; inset: 0; z-index: 100050; display: flex; align-items: center; justify-content: center; padding: 20px; }
.kms-quiz-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .55); backdrop-filter: blur(2px); animation: kmsQuizFade .18s ease; }
.kms-quiz-dialog {
  position: relative; width: 100%; max-width: 560px; max-height: calc(100vh - 40px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--kms-card, #fff); color: var(--kms-ink, #111827);
  border-radius: 16px; box-shadow: 0 24px 60px rgba(15, 23, 42, .35);
  font-family: var(--kms-body-font, inherit); animation: kmsQuizPop .2s cubic-bezier(.2,.8,.2,1);
}
@keyframes kmsQuizFade { from { opacity: 0; } }
@keyframes kmsQuizPop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .kms-quiz-backdrop, .kms-quiz-dialog { animation: none; } }

.kms-quiz-head { padding: 18px 22px 14px; border-bottom: 1px solid var(--kms-line, #e5e7eb); }
.kms-quiz-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kms-quiz-title { margin: 0; font-size: 16px; font-weight: 700; }
.kms-quiz-x { flex: none; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; font-size: 24px; line-height: 1; color: color-mix(in srgb, var(--kms-ink, #111827) 55%, transparent); cursor: pointer; transition: background .15s, color .15s; }
.kms-quiz-x:hover { background: color-mix(in srgb, var(--kms-ink, #111827) 8%, transparent); color: var(--kms-ink, #111827); }
.kms-quiz-progress { margin-top: 10px; font-size: 12.5px; font-weight: 600; letter-spacing: .01em; color: color-mix(in srgb, var(--kms-ink, #111827) 60%, transparent); }
.kms-quiz-bar { margin-top: 8px; height: 5px; border-radius: 999px; background: color-mix(in srgb, var(--kms-ink, #111827) 10%, transparent); overflow: hidden; }
.kms-quiz-bar-fill { height: 100%; width: 0; border-radius: 999px; background: var(--kms-accent, #2d65fe); transition: width .3s ease; }

.kms-quiz-body { padding: 20px 22px; overflow-y: auto; }
.kms-quiz-question { margin: 0 0 16px; font-size: 16.5px; font-weight: 650; line-height: 1.45; }
.kms-quiz-opts { display: flex; flex-direction: column; gap: 10px; }
.kms-quiz-opt {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left;
  padding: 13px 15px; border-radius: 11px; cursor: pointer;
  border: 1.5px solid var(--kms-line, #e5e7eb); background: var(--kms-card, #fff);
  color: var(--kms-ink, #111827); font: inherit; font-size: 14.5px; line-height: 1.45;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.kms-quiz-opt:hover:not(:disabled) { border-color: var(--kms-accent, #2d65fe); background: color-mix(in srgb, var(--kms-accent, #2d65fe) 5%, transparent); }
.kms-quiz-opt:disabled { cursor: default; }
.kms-quiz-letter { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 7px; font-size: 13px; font-weight: 700; background: color-mix(in srgb, var(--kms-ink, #111827) 8%, transparent); color: color-mix(in srgb, var(--kms-ink, #111827) 75%, transparent); }
.kms-quiz-opt-text { padding-top: 2px; }
/* answered states */
.kms-quiz-opt.is-correct { border-color: #2e9e5b; background: color-mix(in srgb, #2e9e5b 12%, transparent); }
.kms-quiz-opt.is-correct .kms-quiz-letter { background: #2e9e5b; color: #fff; }
.kms-quiz-opt.is-wrong { border-color: #d64545; background: color-mix(in srgb, #d64545 12%, transparent); }
.kms-quiz-opt.is-wrong .kms-quiz-letter { background: #d64545; color: #fff; }
.kms-quiz-explain {
  margin-top: 14px; padding: 13px 15px; border-radius: 11px; font-size: 13.5px; line-height: 1.55;
  border-left: 3px solid var(--kms-accent, #2d65fe);
  background: color-mix(in srgb, var(--kms-accent, #2d65fe) 6%, transparent);
}
.kms-quiz-explain b { display: block; margin-bottom: 3px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: color-mix(in srgb, var(--kms-ink, #111827) 60%, transparent); }
.kms-quiz-verdict { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 13.5px; font-weight: 700; }
.kms-quiz-verdict.ok { color: #2e9e5b; }
.kms-quiz-verdict.no { color: #d64545; }

.kms-quiz-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px 18px; border-top: 1px solid var(--kms-line, #e5e7eb); }
.kms-quiz-tally { font-size: 13px; font-weight: 600; color: color-mix(in srgb, var(--kms-ink, #111827) 65%, transparent); }
.kms-quiz-next { margin-left: auto; }
.kms-quiz-next:disabled { opacity: .45; cursor: not-allowed; }

/* results screen */
.kms-quiz-result { text-align: center; padding: 12px 6px 6px; }
.kms-quiz-score-num { font-size: 44px; font-weight: 800; line-height: 1; color: var(--kms-accent, #2d65fe); }
.kms-quiz-score-lbl { margin: 6px 0 2px; font-size: 15px; font-weight: 700; }
.kms-quiz-score-msg { margin: 8px auto 0; max-width: 360px; font-size: 13.5px; line-height: 1.5; color: color-mix(in srgb, var(--kms-ink, #111827) 66%, transparent); }
.kms-quiz-ring { --pct: 0; width: 120px; height: 120px; margin: 4px auto 14px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(closest-side, var(--kms-card, #fff) 71%, transparent 72% 100%),
              conic-gradient(var(--kms-accent, #2d65fe) calc(var(--pct) * 1%), color-mix(in srgb, var(--kms-ink,#111827) 12%, transparent) 0); }
.kms-quiz-ring span { font-size: 26px; font-weight: 800; }

body.kms-quiz-lock { overflow: hidden; }
@media (max-width: 560px) { .kms-quiz-dialog { max-width: 100%; } .kms-quiz-cta-title { font-size: 16px; } }

.kms-quiz-recorded { margin-top: 12px; font-size: 13px; font-weight: 600; color: #2e9e5b; }

/* ── My points (s144) — member KMS slice of the MMS points program ── */
.pts-head { max-width: 70ch; margin-bottom: 22px; }
.pts-head .post-title { margin-bottom: 6px; text-wrap: balance; }
.pts-lede { color: var(--text-muted); font-size: 15px; line-height: 1.55; margin: 0; text-wrap: pretty; }
.pts-summary { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 0 34px; background: var(--surface); border: 1px solid var(--border); }
.pts-stat { padding: 18px 22px; min-width: 0; }
.pts-stat + .pts-stat { border-left: 1px solid var(--border); }
.pts-stat dt { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.pts-stat dd { margin: 6px 0 0; display: flex; flex-direction: column; gap: 3px; }
.pts-num { font-family: var(--font-secondary); font-size: 30px; font-weight: 800; line-height: 1.1; color: var(--text); font-variant-numeric: tabular-nums; }
.pts-sub { font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.pts-link { color: var(--primary); font-weight: 600; text-decoration: none; width: fit-content; transition: color .18s cubic-bezier(.25, 1, .5, 1); }
.pts-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.pts-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.pts-table-wrap { overflow-x: auto; border: 1px solid var(--border); }
.pts-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pts-table th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--text-muted); padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.pts-table td { padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: baseline; color: var(--text); }
.pts-table tbody tr:last-child td { border-bottom: 0; }
.pts-table .pts-r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pts-action { display: block; font-weight: 600; }
.pts-desc { display: block; margin-top: 2px; font-size: 13px; color: var(--text-muted); line-height: 1.45; }
.pts-limits-inline { display: none; }
.pts-muted { color: var(--text-muted); font-size: 13px; }
.pts-strong { font-weight: 700; }
.pts-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pts-recent td { vertical-align: middle; }
.pts-foot { margin: 10px 0 0; font-size: 13px; color: var(--text-muted); }
.pts-gap { margin-top: 34px; }
.pts-empty, .pts-notice { padding: 18px 20px; border: 1px dashed var(--border); color: var(--text-muted); font-size: 14px; margin: 0; }
.nav-points { font-weight: 600; }
@media (max-width: 767px) {
  .pts-summary { grid-template-columns: 1fr; }
  .pts-stat + .pts-stat { border-left: 0; border-top: 1px solid var(--border); }
  .pts-stat { padding: 14px 16px; }
  .pts-num { font-size: 26px; }
  .pts-col-limits { display: none; }
  .pts-limits-inline { display: block; }
  .pts-table th, .pts-table td { padding: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) { .pts-link { transition: none; } }
