    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    :root {
      --bg:          #111111;
      --card-bg:     #F0EDE8;
      --caption:     #1A1714;
      --date:        #6B5F55;
      --amber:       #C8873A;
      --arrow-hover: rgba(200,135,58,0.28);
      --shadow:      0 12px 48px rgba(0,0,0,0.7), 0 2px 8px rgba(0,0,0,0.4);
      --card-w:      min(560px, calc(100vw - 24px)); /* tabs, card and lightbox share this */
      --tap:         44px;  /* minimum comfortable touch target */
      --hdr-h:       52px;  /* title row height */
      --safe-top:    env(safe-area-inset-top, 0px);
      --safe-right:  env(safe-area-inset-right, 0px);
      --safe-bottom: env(safe-area-inset-bottom, 0px);
      --safe-left:   env(safe-area-inset-left, 0px);
    }
    html, body {
      height: 100%;
      overscroll-behavior: none; /* no pull-to-refresh / bounce fighting the swipe gesture */
      -webkit-text-size-adjust: 100%;
      background-color: var(--bg);
      background-image: radial-gradient(circle, rgba(200,135,58,0.07) 1px, transparent 1px);
      background-size: 28px 28px;
      color: var(--card-bg); font-family: 'DM Sans', sans-serif; overflow: hidden;
    }
    /* Outer column — fills viewport, nothing overflows */
    .viewer {
      display: flex; flex-direction: column;
      align-items: center;
      height: 100vh;
      height: 100dvh; /* dynamic viewport height — accounts for mobile chrome */
      width: 100%;
      padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
      overflow: hidden;
    }
    .page-title {
      flex-shrink: 0;
      width: 100%; height: var(--hdr-h);
      display: flex; align-items: center; justify-content: center;
      /* side padding keeps the title clear of the fixed menu button */
      padding: 0 calc(var(--tap) + 12px);
      font-family: 'DM Serif Display', serif;
      font-size: clamp(17px,2.6vw,28px);
      letter-spacing: 0.18em; color: var(--card-bg);
      text-transform: uppercase; user-select: none; text-align: center;
      white-space: nowrap;
    }
    .page-title .sep { color: var(--amber); margin: 0 0.15em; }
    /* ── Hamburger menu ──────────────────────────────────── */
    .menu-btn {
      position: fixed; z-index: 410;
      top:  calc(var(--safe-top)  + (var(--hdr-h) - var(--tap)) / 2);
      left: calc(var(--safe-left) + 4px);
      width: var(--tap); height: var(--tap); border-radius: 50%; border: none;
      background: transparent; color: var(--amber);
      cursor: pointer; display: flex; align-items: center; justify-content: center;
      transition: background 0.18s, transform 0.18s;
      -webkit-tap-highlight-color: transparent;
    }
    .menu-btn:hover { background: rgba(240,237,232,0.12); }
    .menu-btn:active { transform: scale(0.94); }
    .menu-btn__bars {
      position: relative; display: block;
      width: 19px; height: 14px;
    }
    .menu-btn__bar {
      position: absolute; left: 0; width: 100%; height: 2px;
      border-radius: 1px; background: currentColor;
      transition: top 0.28s cubic-bezier(.4,0,.2,1),
                  transform 0.28s cubic-bezier(.4,0,.2,1),
                  opacity 0.18s ease;
    }
    .menu-btn__bar--top    { top: 0; }
    .menu-btn__bar--mid    { top: 6px; }
    .menu-btn__bar--bottom { top: 12px; }
    .menu-btn.open .menu-btn__bar--top {
      top: 6px; transform: rotate(45deg);
    }
    .menu-btn.open .menu-btn__bar--mid { opacity: 0; }
    .menu-btn.open .menu-btn__bar--bottom {
      top: 6px; transform: rotate(-45deg);
    }
    @media (prefers-reduced-motion: reduce) {
      .menu-btn__bar { transition: none; }
    }
    .menu-backdrop {
      position: fixed; inset: 0; z-index: 400;
      background: rgba(0,0,0,0.6);
      opacity: 0; pointer-events: none;
      transition: opacity 0.28s ease;
    }
    .menu-backdrop.open { opacity: 1; pointer-events: all; }
    .menu-panel {
      position: fixed; top: 0; left: 0; bottom: 0; z-index: 401;
      width: min(280px, 78vw);
      background: #1A1714;
      border-right: 1px solid rgba(200,135,58,0.45);
      box-shadow: 0 0 60px rgba(0,0,0,0.6);
      transform: translateX(-100%);
      transition: transform 0.3s ease;
      display: flex; flex-direction: column;
    }
    .menu-panel.open { transform: translateX(0); }
    .menu-panel__nav {
      padding: calc(14px + var(--safe-top)) 28px 28px 52px; display: flex; flex-direction: column; gap: 6px;
    }
    .menu-panel__eyebrow {
      font-family: 'DM Sans', sans-serif; font-size: 10.5px; font-weight: 400;
      letter-spacing: 0.22em; text-transform: uppercase;
      color: rgba(200,135,58,0.55); margin-bottom: 6px;
    }
    .menu-panel__home {
      font-family: 'DM Serif Display', serif; font-size: clamp(24px,5vw,30px);
      letter-spacing: 0.03em; color: var(--card-bg); text-decoration: none;
      border-bottom: 1px solid transparent; width: fit-content;
      transition: color 0.18s, border-color 0.18s;
    }
    .menu-panel__home:hover { color: var(--amber); border-color: rgba(200,135,58,0.5); }
    .menu-panel__item {
      font-family: 'DM Sans', sans-serif; font-size: 15px; font-weight: 400;
      color: var(--card-bg); background: transparent; border: none;
      text-align: left; cursor: pointer; padding: 12px 0 4px; min-height: var(--tap); width: fit-content;
      border-bottom: 1px solid transparent; transition: color 0.18s, border-color 0.18s;
      display: flex; align-items: center; gap: 7px;
    }
    .menu-panel__item:hover { color: var(--amber); border-color: rgba(200,135,58,0.5); }
    .menu-panel__badge {
      min-width: 17px; height: 17px; padding: 0 4px;
      border-radius: 999px; background: var(--amber); color: #1A1714;
      font-family: 'DM Sans', sans-serif; font-size: 10.5px; font-weight: 500;
      line-height: 17px; text-align: center;
      display: none;
    }
    .menu-panel__badge.show { display: inline-block; }
    .menu-panel__item.active { color: var(--amber); }
    .menu-panel__sep {
      display: block; width: 100%; height: 1px; margin: 12px 0 4px;
      background: rgba(200,135,58,0.22);
    }
    /* "N new posts since your last visit" dot on the hamburger */
    .menu-btn__dot {
      position: absolute; top: 4px; right: 2px;
      min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
      background: var(--amber); color: #111;
      font-family: 'DM Sans', sans-serif; font-size: 10.5px; font-weight: 700; line-height: 17px;
      text-align: center; display: none; pointer-events: none;
      box-shadow: 0 0 0 2px var(--bg);
    }
    .menu-btn__dot.show { display: block; }
    .menu-btn.open .menu-btn__dot { display: none; }
    @media (prefers-reduced-motion: reduce) {
      .menu-backdrop, .menu-panel { transition: none; }
    }
    /* ── Saved (auto-tracked reactions) overlay ─────────────── */
    .saved-overlay {
      position: fixed; inset: 0; z-index: 420;
      background: rgba(0,0,0,0.75);
      opacity: 0; pointer-events: none;
      transition: opacity 0.28s ease;
      display: flex; align-items: flex-start; justify-content: center;
      overflow-y: auto; padding: calc(60px + var(--safe-top)) 16px calc(40px + var(--safe-bottom));
    }
    .saved-overlay.open { opacity: 1; pointer-events: all; }
    .saved-panel {
      background: #1A1714; border: 1px solid rgba(200,135,58,0.35);
      border-radius: 16px; width: min(480px, 100%);
      max-height: calc(100vh - 100px);
      max-height: calc(100dvh - 100px - var(--safe-top) - var(--safe-bottom)); display: flex; flex-direction: column;
      box-shadow: var(--shadow);
    }
    .saved-panel__header {
      flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
      padding: 16px 10px 16px 20px; border-bottom: 1px solid rgba(200,135,58,0.2);
    }
    .saved-panel__title {
      font-family: 'DM Serif Display', serif; font-size: 19px; letter-spacing: 0.03em;
      color: var(--card-bg);
    }
    .saved-panel__close {
      background: transparent; border: none; color: var(--amber); cursor: pointer;
      width: var(--tap); height: var(--tap); display: flex; align-items: center; justify-content: center;
      border-radius: 50%; transition: background 0.18s;
    }
    .saved-panel__close:hover { background: rgba(240,237,232,0.12); }
    .saved-panel__close svg { width: 18px; height: 18px; }
    .saved-list {
      overflow-y: auto; padding: 8px 10px 16px; display: flex; flex-direction: column; gap: 2px;
    }
    .saved-item {
      display: flex; align-items: center; gap: 12px;
      padding: 9px 10px; border-radius: 10px; cursor: pointer;
      background: transparent; border: none; text-align: left; width: 100%;
      transition: background 0.15s;
    }
    .saved-item:hover { background: rgba(200,135,58,0.12); }
    .saved-item__thumb {
      width: 50px; height: 50px; border-radius: 8px; object-fit: cover; flex-shrink: 0;
      background: #2a2622;
    }
    .saved-item__body { flex: 1; min-width: 0; }
    .saved-item__caption {
      color: var(--card-bg); font-size: 13.5px; line-height: 1.32;
      overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
      -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    }
    .saved-item__meta {
      margin-top: 4px; font-size: 11.5px; color: var(--date);
      display: flex; gap: 8px; align-items: center;
    }
    .saved-empty {
      padding: 44px 26px; text-align: center; color: var(--date);
      font-size: 13.5px; line-height: 1.55;
    }
    .saved-sentinel { height: 1px; }
    @media (prefers-reduced-motion: reduce) {
      .saved-overlay { transition: none; }
    }
    /* Tabs — flush against card top, same width, connected look */
    .tabs {
      flex-shrink: 0;
      display: flex;
      width: var(--card-w);
      border: 2px solid rgba(200,135,58,0.45);
      border-bottom: 2px solid rgba(200,135,58,0.45);
      border-radius: 3px 3px 0 0;
      overflow: hidden;
      margin-top: clamp(6px,1vh,12px);
      margin-bottom: 0;
    }
    .tab {
      flex: 1;
      min-height: 36px; padding: 0;
      font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 400;
      letter-spacing: 0.1em; text-transform: uppercase;
      color: rgba(200,135,58,0.78);
      background: transparent; border: none; cursor: pointer;
      transition: background 0.18s, color 0.18s;
      -webkit-tap-highlight-color: transparent;
      white-space: nowrap; text-align: center;
    }
    .tab + .tab { border-left: 1px solid rgba(200,135,58,0.35); }
    @media (max-width: 420px) {
      .tab { font-size: 11px; letter-spacing: 0.04em; }
    }
    .tab:hover  { background: rgba(200,135,58,0.1); color: var(--amber); }
    .tab.active { background: rgba(200,135,58,0.18); color: var(--amber); }
    /* Middle row stretches to fill all remaining space */
    .middle {
      flex: 1 1 0; min-height: 0;
      display: flex; align-items: stretch; justify-content: center; width: 100%;
    }
    /* Arrows float on top of the card image itself — positioned
       relative to .stage (which is sized to match the card), not
       .middle, so they hug the card's edges at any viewport width. */
    .arrow {
      position: absolute; top: 50%; transform: translateY(-50%);
      z-index: 4;
      width: 40px; height: 40px; border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      cursor: pointer; border: none;
      background: rgba(17,17,17,0.45); color: var(--amber);
      transition: background 0.22s, transform 0.16s;
      -webkit-tap-highlight-color: transparent;
    }
    .arrow.prev { left: 8px; }
    .arrow.next { right: 8px; }
    .arrow:hover  { background: rgba(17,17,17,0.7); }
    .arrow:active { background: rgba(200,135,58,0.5); }
    .arrow:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
    .arrow::after { content: ''; position: absolute; inset: -4px; } /* 48px hit area */
    .arrow svg {
      width: 18px; height: 18px;
      filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
      transition: transform 0.16s;
    }
    .arrow.prev:hover svg { transform: translateX(-2px); }
    .arrow.next:hover svg { transform: translateX( 2px); }
    /* Stage fills middle, card fills stage */
    .stage {
      position: relative;
      flex: 0 0 auto; min-width: 0; min-height: 0;
      width: var(--card-w);
      display: flex; align-items: flex-start; justify-content: center;
      padding: 0 0 4px;
    }
    /* Card: fluid height — fills stage, capped at a max on large screens */
    .card {
      background: var(--card-bg); border-radius: 0 0 3px 3px;
      box-shadow: var(--shadow);
      border: 2px solid rgba(200,135,58,0.45);
      display: flex; flex-direction: column; overflow: hidden;
      width: 100%;
      height: 100%;
      max-height: min(740px, 100%);
    }
    .card.transitioning-out { opacity: 0; transform: scale(0.96) translateY(8px); }
    .card.transitioning-in  { opacity: 0; transform: scale(1.03); }
    /* Image: flex-grow fills all space not used by caption */
    .card__image-wrap {
      flex: 1 1 0; min-height: 0;
      width: 100%; overflow: hidden;
      background: #2a2520; cursor: zoom-in; position: relative;
    }
    .card__image-wrap img {
      width: 100%; height: 100%; object-fit: cover; display: block;
      transition: opacity 0.3s, transform 0.3s; pointer-events: none;
    }
    .card__image-wrap img.loading { opacity: 0; }
    @media (hover: hover) and (pointer: fine) {
      .card__image-wrap:hover img { transform: scale(1.03); }
    }
    /* Loading skeleton — shown while image fetches */
    .card__skeleton {
      position: absolute; inset: 0;
      background: linear-gradient(
        100deg,
        rgba(200,135,58,0.06) 30%,
        rgba(200,135,58,0.14) 50%,
        rgba(200,135,58,0.06) 70%
      );
      background-size: 200% 100%;
      animation: skeleton-shimmer 1.4s ease-in-out infinite;
      opacity: 1;
      transition: opacity 0.25s ease;
      pointer-events: none;
    }
    .card__skeleton.hide { opacity: 0; }
    /* "New" badge — shown for 24h after a post goes live */
    .card__new-badge {
      position: absolute; top: 10px; left: 10px;
      background: var(--amber); color: #111;
      font-family: 'DM Sans', sans-serif;
      font-size: 10px; font-weight: 700;
      letter-spacing: 0.1em; text-transform: uppercase;
      padding: 3px 8px; border-radius: 3px;
      pointer-events: none; z-index: 2;
      box-shadow: 0 1px 6px rgba(0,0,0,0.35);
    }
    /* "Top ⭐N" rank badge — shown on any tab when a post is in the
       all-time top 20 by hearts+fires, regardless of which mode
       (random/newest/top) the card happens to be viewed in.
       Styled to match .card__new-badge. */
    .card__rank-badge {
      position: absolute; top: 10px; right: 10px;
      background: var(--amber); color: #111;
      font-family: 'DM Sans', sans-serif;
      font-size: 10px; font-weight: 700;
      letter-spacing: 0.1em; text-transform: uppercase;
      padding: 3px 8px; border-radius: 3px;
      pointer-events: none; z-index: 2;
      box-shadow: 0 1px 6px rgba(0,0,0,0.35);
    }
    @keyframes skeleton-shimmer {
      0%   { background-position: 200% 0; }
      100% { background-position: -200% 0; }
    }
    @media (prefers-reduced-motion: reduce) {
      .card__skeleton { animation: none; }
    }
    /* Content fade */
    .card__image-wrap, .card__body { transition: opacity 0.22s ease; }
    .card.content-hidden .card__image-wrap,
    .card.content-hidden .card__body { opacity: 0; }
    /* Caption strip — fixed height, never grows */
    .card__body {
      flex-shrink: 0;
      height: 88px;
      padding: 10px 16px 8px; background: var(--card-bg);
      overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
      position: relative;
    }
    /* Bottom row: date left, share right */
    .card__meta {
      display: flex; align-items: center; justify-content: space-between;
      gap: 8px; min-height: 24px;
    }
    .card__share {
      position: relative; height: 24px; border-radius: 12px; border: none;
      background: none; color: var(--date);
      cursor: pointer; display: flex; align-items: center; justify-content: center;
      transition: color 0.18s, transform 0.15s;
      -webkit-tap-highlight-color: transparent;
      padding: 0; flex-shrink: 0;
    }
    .card__share:hover { color: var(--amber); transform: scale(1.1); }
    .card__share:active { transform: scale(0.9); }
    .card__share::after { content: ''; position: absolute; inset: -10px; } /* 44px hit area */
    .card__share svg { width: 14px; height: 14px; }
    .card__share-label {
      font-size: 11px; font-weight: 400; letter-spacing: 0.1em;
      text-transform: uppercase; margin-left: 5px; line-height: 1;
    }
    /* Toast */
    .share-toast {
      position: fixed; bottom: calc(28px + var(--safe-bottom)); left: 50%; transform: translateX(-50%) translateY(10px);
      background: rgba(30,26,22,0.95); border: 1px solid rgba(200,135,58,0.4);
      color: var(--card-bg); font-size: 12px; letter-spacing: 0.06em;
      padding: 8px 18px; border-radius: 20px;
      opacity: 0; pointer-events: none;
      transition: opacity 0.22s ease, transform 0.22s ease;
      z-index: 300; white-space: nowrap;
    }
    .share-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
    .card__caption {
      font-family: 'DM Serif Display', serif;
      font-size: 15px; line-height: 1.35;
      color: var(--caption); margin-bottom: 3px;
      overflow: hidden;
      display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    }
    .card__date {
      font-size: 12px; font-weight: 300;
      letter-spacing: 0.06em; color: var(--date); text-transform: uppercase;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .card__streak {
      font-size: 11px; font-weight: 400;
      letter-spacing: 0.06em; color: var(--amber); text-transform: uppercase;
      white-space: nowrap; flex-shrink: 0;
      opacity: 0; transform: scale(0.9);
      animation: streak-in 0.35s ease forwards;
    }
    @keyframes streak-in {
      to { opacity: 1; transform: scale(1); }
    }
    @media (prefers-reduced-motion: reduce) {
      .card__streak { animation: none; opacity: 1; transform: none; }
    }
    .card__reactions {
      position: absolute; bottom: 12px; left: 0; right: 0;
      display: flex; justify-content: space-between;
      padding: 0 12px; pointer-events: none;
    }
    /* Pill-shaped button: emoji + count always visible */
    .react-wrap {
      pointer-events: all;
    }
    .react-btn {
      pointer-events: all;
      display: flex; align-items: center; gap: 6px;
      height: 40px; padding: 0 14px;
      border-radius: 20px; border: none;
      background: rgba(0,0,0,0.52); backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      border: 1px solid rgba(255,255,255,0.12);
      cursor: pointer; font-size: 18px; line-height: 1;
      transition: background 0.18s, transform 0.15s, border-color 0.18s;
      -webkit-tap-highlight-color: transparent;
      position: relative; overflow: visible;
      width: auto;
    }
    .react-btn:hover  { background: rgba(0,0,0,0.7); transform: scale(1.05); }
    .react-btn:active { transform: scale(0.93); }
    .react-btn.active-heart {
      background: rgba(220,50,80,0.65);
      border-color: rgba(220,50,80,0.5);
    }
    .react-btn.active-fire {
      background: rgba(220,110,20,0.65);
      border-color: rgba(220,110,20,0.5);
    }
    /* Count inside the pill */
    .react-count {
      font-family: 'DM Sans', sans-serif;
      font-size: 14px; font-weight: 600; letter-spacing: 0.01em;
      color: rgba(255,255,255,0.95);
      text-shadow: 0 1px 4px rgba(0,0,0,0.6);
      min-width: 16px; text-align: left;
      pointer-events: none; user-select: none;
    }
    /* Hide count span — it now lives inside the btn */
    .react-wrap > .react-count { display: none; }
    @keyframes react-pop {
      0%   { transform: scale(1); }
      30%  { transform: scale(1.55); }
      55%  { transform: scale(0.88); }
      75%  { transform: scale(1.18); }
      100% { transform: scale(1); }
    }
    .react-btn.pop { animation: react-pop 0.45s cubic-bezier(.36,.07,.19,.97) both; }
    @keyframes float-up {
      0%   { opacity: 1; transform: translateY(0) scale(1); }
      100% { opacity: 0; transform: translateY(-52px) scale(1.5); }
    }
    .react-burst {
      position: absolute; top: -4px; left: 50%; transform: translateX(-50%);
      font-size: 18px; pointer-events: none; animation: float-up 0.6s ease-out forwards;
    }
    /* Tip bar — above counter */
    .tip-bar {
      flex-shrink: 0; width: 100%;
      height: 22px;
      display: flex; align-items: center; justify-content: center;
      overflow: hidden;
      margin-top: clamp(4px,0.8vh,10px);
    }
    .tip-text {
      font-size: 12px; font-weight: 300; letter-spacing: 0.05em;
      color: rgba(240,237,232,0.62); text-align: center;
      transition: opacity 0.3s ease, transform 0.3s ease;
      white-space: nowrap; max-width: calc(100% - 32px);
      overflow: hidden; text-overflow: ellipsis;
    }
    .tip-text.fade-out { opacity: 0; transform: translateY(-6px); }
    .tip-text.fade-in  { opacity: 0; transform: translateY(6px); }
    /* Counter — below tip */
    .counter {
      flex-shrink: 0; display: flex; align-items: center; justify-content: center;
      gap: 7px; padding: 5px 0 clamp(8px,1.5vh,16px);
      /* Fixed content height: dots (6px) and the "3 / 120" text (13px) used to
         make this row different heights, which resized the card between tabs. */
      height: 18px; box-sizing: content-box;
    }
    .dot {
      width: 6px; height: 6px; border-radius: 50%;
      background: rgba(200,135,58,0.28); cursor: pointer; position: relative;
      transition: background 0.22s, transform 0.22s;
    }
    .dot::after { content: ''; position: absolute; inset: -9px -4px; } /* easier to tap */
    .dot.active { background: var(--amber); transform: scale(1.4); }
    .lightbox {
      position: fixed; inset: 0; z-index: 100;
      background: rgba(0,0,0,0.93);
      display: flex; align-items: center; justify-content: center;
      opacity: 0; pointer-events: none;
      transition: opacity 0.26s ease;
    }
    .lightbox.open { opacity: 1; pointer-events: all; }
    .lightbox__img {
      max-width: var(--card-w); max-height: 92vh; max-height: 92dvh;
      object-fit: contain; border-radius: 2px;
      box-shadow: 0 20px 80px rgba(0,0,0,0.8); display: block;
      transform: scale(0.94); transition: transform 0.26s ease;
      cursor: pointer;
    }
    .lightbox.open .lightbox__img { transform: scale(1); }
    .lightbox__close {
      position: absolute; top: calc(18px + var(--safe-top)); right: calc(20px + var(--safe-right));
      width: 46px; height: 46px; border-radius: 50%; border: none;
      background: rgba(240,237,232,0.13); color: #F0EDE8;
      cursor: pointer; display: flex; align-items: center; justify-content: center;
      transition: background 0.18s, transform 0.18s;
      -webkit-tap-highlight-color: transparent;
    }
    .lightbox__close:hover { background: rgba(240,237,232,0.26); transform: scale(1.1); }
    .lightbox__close svg { width: 20px; height: 20px; }
    @media (prefers-reduced-motion: reduce) {
      .card, .card__image-wrap img, .lightbox, .lightbox__img { transition: none; }
    }
    .empty {
      color: rgba(240,237,232,0.3); font-family: 'DM Serif Display', serif;
      font-size: 1.3rem; text-align: center; line-height: 1.7;
    }
    /* ── In-feed ad card ─────────────────────────────────────
       The ad now renders as a real card in the swipe stream
       (same markup/size as a normal post) instead of a popup
       lightbox. It's inserted after AD_MIN–AD_MAX swipes — see the
       AD_CONFIGS array and advance()/showAdCard() in the JS. */
    .card__ad-badge {
      position: absolute; top: 10px; left: 10px;
      background: rgba(17,17,17,0.78); color: var(--card-bg);
      font-family: 'DM Sans', sans-serif;
      font-size: 10px; font-weight: 700;
      letter-spacing: 0.16em; text-transform: uppercase;
      padding: 3px 9px; border-radius: 3px;
      border: 1px solid rgba(200,135,58,0.55);
      pointer-events: none; z-index: 3;
      box-shadow: 0 1px 6px rgba(0,0,0,0.35);
    }
    .card__image-wrap--ad { cursor: pointer; }
    .card__image-wrap--ad a { display: block; width: 100%; height: 100%; }
    /* iframe-type ad: fills the same space a post photo would */
    .card__ad-frame {
      width: 100%; height: 100%; display: block; border: 0;
    }
    /* Friendly placeholder shown until an ad's `image` is set to a
       real creative, or if that image fails to load. */
    .card__image-wrap--ad-fallback img { display: none; }
    .card__image-wrap--ad-fallback::after {
      content: 'Sponsored';
      position: absolute; inset: 0;
      display: flex; align-items: center; justify-content: center;
      text-align: center; padding: 28px;
      background: linear-gradient(135deg, rgba(200,135,58,0.28), rgba(26,23,20,0.92));
      color: var(--card-bg); font-size: 13px; letter-spacing: 0.03em; line-height: 1.5;
    }
    /* ── end ad card styles ──────────────────────────────── */

    /* ── Responsive / touch layout ───────────────────────────
       Order matters: later rules override earlier ones. */
    @media (pointer: coarse) {
      .tab       { min-height: var(--tap); }
      .react-btn { height: var(--tap); }
    }
    @media (max-width: 600px) {
      :root { --card-w: calc(100vw - 16px); --hdr-h: 48px; } /* card nearly edge-to-edge */
      .page-title { font-size: clamp(15px, 3.2vw, 20px); letter-spacing: 0.14em; }
      .counter    { padding: 4px 0 6px; }
      /* Screen order, top to bottom: title, tip, card, dots, tabs.
         `order` rearranges the .viewer column (default is 0). */
      .page-title { order: -2; }
      .tip-bar    { order: -1; height: 18px; margin: 0 0 6px; } /* tip sits between title and card */
      /* Browse tabs become a bottom bar: easier to reach with a thumb. */
      .tabs { order: 10; margin: 2px 0 8px; border-radius: 3px; }
      .card { border-radius: 3px; }
      /* Pop-up bubbles ("Link copied!", "No reactions yet…") rise above the bottom tab bar */
      .share-toast { bottom: calc(64px + var(--safe-bottom)); }
    }
    @media (max-width: 480px) {
      /* Too narrow for the full tagline beside the menu button */
      .page-title { font-size: 18px; letter-spacing: 0.2em; }
      .page-title__tail { display: none; }
      .tip-text { font-size: 11.5px; letter-spacing: 0.02em; }
    }
    @media (max-height: 700px) {
      .tip-bar { display: none; } /* give the photo the room instead */
    }
    @media (orientation: landscape) and (max-height: 500px) {
      /* Phone on its side: drop the title row, keep the tabs clear of the menu button */
      .page-title { display: none; }
      /* back to the top of the screen, attached to the card */
      .tabs { order: 0; border-radius: 3px 3px 0 0; margin: 6px 0 0; width: min(var(--card-w), calc(100vw - 2 * var(--tap) - 24px)); }
      .card { border-radius: 0 0 3px 3px; }
      .tab  { min-height: 36px; }
      .counter { padding: 2px 0 4px; }
    }
