/* Club on desktop (CLUB_DESK_ENABLED): the media-first feed (r4b). Every rule is scoped to .cd-page / body.cd-on and
   sits inside the desktop query, so phones and the flag off are untouched. The app's own tokens only: glass cards,
   flat bronze primary, Russo labels, Bebas title. The page scrolls; nothing inside it is a scroll trap. */
@media (min-width: 1024px) {
  body.cd-on main#view > :not(.cd-page), html body.cd-on #app.app main#view > :not(.cd-page) { display: none !important; }
  html body.cd-on #app.app main#view > .cd-page { grid-column: 1 / -1 !important; grid-row: auto !important; width: 100%; max-width: 1000px; margin: 0 auto; }
  .cd-page { grid-column: 1 / -1; color: var(--ink); min-width: 0; overflow-anchor: none; }
  .cd-wrap { display: grid; grid-template-columns: minmax(0, 640px) 300px; gap: 16px 32px; justify-content: center; align-items: start; }
  .cd-top { grid-column: 1; grid-row: 1; } .cd-feed { grid-column: 1; grid-row: 2; } .cd-side { grid-column: 2; grid-row: 2; }
  .cd-feed { display: flex; flex-direction: column; gap: 16px; min-width: 0; padding-bottom: 48px; }
  .cd-top { display: flex; flex-direction: column; gap: 4px; padding: 4px 4px 0; }
  .cd-top h1 { margin: 0; font: 44px/1 var(--f-title); letter-spacing: .01em; }
  .cd-eye { font: 11px/1.2 var(--f-logo); letter-spacing: .14em; text-transform: uppercase; color: var(--sand-text); margin: 0; font-weight: 400; }
  .cd-mut { font-size: 12.5px; color: var(--ink-3); }
  .cd-page button { font: inherit; color: inherit; cursor: pointer; }
  .cd-page :focus-visible { outline: 3px solid var(--sand); outline-offset: 2px; }

  /* Glass card, one style for every surface. */
  .cd-compose, .cd-post, .cd-ms, .cd-side-card { background: var(--glass); border: 1px solid var(--hair); border-radius: 24px; box-shadow: var(--shadow); -webkit-backdrop-filter: blur(20px) saturate(1.2); backdrop-filter: blur(20px) saturate(1.2); box-sizing: border-box; }

  /* Avatars: photo, the ASPN mark, or a refined initial (bronze gradient, Russo). */
  .cd-av { position: relative; width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; background: linear-gradient(140deg, var(--sand-deep, #a6886e), var(--sand, #a6886e)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
  .cd-av i { font: 14px/1 var(--f-logo); font-style: normal; color: #FAF8F4; letter-spacing: .02em; }
  .cd-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .cd-av .cd-aimg { position: absolute; inset: 0; background-color: transparent; } /* the photo over the initial (the initial shows if it fails) */
  .cd-av.team { background: #F4ECE1; box-shadow: inset 0 0 0 1px var(--hair); }
  .cd-av.team img { position: static; width: 55%; height: 55%; object-fit: contain; }
  .cd-av.sm { width: 32px; height: 32px; } .cd-av.sm i { font-size: 12px; }
  .cd-av.xs { width: 24px; height: 24px; } .cd-av.xs i { font-size: 10px; }

  /* Composer: the app's own post flow behind every control. */
  .cd-compose { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
  .cd-field { flex: 1; min-width: 0; text-align: left; border: 1px solid var(--hair) !important; background: var(--glass-strong) !important; border-radius: 999px; min-height: 44px; padding: 0 18px; color: var(--ink-3) !important; font-size: 15px; }
  .cd-ib { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--hair) !important; background: none; display: grid; place-items: center; color: var(--ink-2); }
  .cd-ib svg, .cd-ab svg, .cd-cbtn svg, .cd-lb svg, .cd-mshd > svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .cd-btn, .cd-send { border: 0; border-radius: 999px; background: var(--primary, var(--sand-deep)); color: #FAF8F4; font: 12px/1 var(--f-logo) !important; letter-spacing: .1em; text-transform: uppercase; padding: 0 20px; min-height: 44px; }
  /* pw1: night theme paints the bronze button tan; dark ink keeps the label above 4.5:1 (was 1.68:1). */
  :root[data-theme=night] .cd-btn, :root[data-theme=night] .cd-send { color: #25211C !important; }

  /* Member milestones: one slim row, collapsed by default. */
  .cd-msw:empty { display: none; }
  .cd-ms { padding: 4px 8px; }
  .cd-mshd { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; padding: 8px; min-height: 44px; text-align: left; }
  .cd-mst { font: 11px/1.2 var(--f-logo); letter-spacing: .12em; text-transform: uppercase; color: var(--sand-text); flex: 1; }
  .cd-mshd > svg { color: var(--ink-3); transition: transform .2s; }
  .cd-mshd[aria-expanded="true"] > svg { transform: rotate(180deg); }
  .cd-avs { display: flex; } .cd-avs .cd-av + .cd-av { margin-left: -8px; box-shadow: 0 0 0 2px var(--glass-strong); }
  .cd-msl { border-top: 1px solid var(--line); padding: 4px 8px 8px; }
  .cd-msl[hidden] { display: none; }
  .cd-msr { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
  .cd-msr + .cd-msr { border-top: 1px solid var(--line); }
  .cd-msr p { flex: 1; margin: 0; font-size: 14px; line-height: 1.4; color: var(--ink-2); }
  .cd-msr p b { color: var(--ink); font-weight: 500; }

  /* Posts. */
  .cd-posts { display: flex; flex-direction: column; gap: 16px; }
  .cd-post { overflow: hidden; outline: none; scroll-margin-top: 96px; }
  .cd-post:focus-visible { box-shadow: 0 0 0 3px var(--sand), var(--shadow); }
  .cd-ph { display: flex; align-items: center; gap: 12px; padding: 14px 16px 12px; }
  .cd-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
  .cd-who b { font-weight: 500; font-size: 15px; }
  .cd-tag { border: 1px solid var(--hair) !important; background: none; border-radius: 999px; padding: 6px 12px; min-height: 32px; font-size: 13px !important; color: var(--sand-text) !important; }
  .cd-media { position: relative; background: #1d1a17; }
  .cd-shot { display: block; width: 100%; padding: 0; border: 0; background: none; aspect-ratio: 1 / 1; cursor: zoom-in; }
  .cd-img { display: block; width: 100%; height: 100%; background: #1d1a17 center / cover no-repeat; }
  .cd-vid video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #000; }
  .cd-car .cd-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
  .cd-car .cd-track::-webkit-scrollbar { display: none; }
  .cd-car .cd-shot { flex: 0 0 100%; scroll-snap-align: start; }
  /* r4b: a solid glass chip with a clearly visible chevron (the faint white circle read as nothing over bright photos). */
  .cd-cbtn { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--hair) !important; background: var(--glass-strong) !important; color: var(--ink) !important; display: grid; place-items: center; box-shadow: 0 8px 22px -8px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.35); -webkit-backdrop-filter: blur(12px) saturate(1.2); backdrop-filter: blur(12px) saturate(1.2); }
  .cd-cbtn svg { width: 22px; height: 22px; stroke-width: 2.4; }
  .cd-cbtn.prev { left: 12px; } .cd-cbtn.next { right: 12px; } .cd-cbtn.next svg { transform: rotate(180deg); }
  .cd-cbtn:disabled { opacity: 0; pointer-events: none; }
  .cd-dots { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
  .cd-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(250,248,244,.5); }
  .cd-dots i.on { background: #FAF8F4; }
  .cd-cap { padding: 12px 16px 0; }
  .cd-captx { margin: 0; font-size: 15px; line-height: 1.5; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .cd-captx b { font-weight: 600; }
  .cd-captx.open { display: block; -webkit-line-clamp: unset; }
  .cd-post.txt .cd-cap { padding-top: 0; }
  .cd-post.txt .cd-captx { font-size: 17px; line-height: 1.5; -webkit-line-clamp: 6; }
  .cd-more { border: 0; background: none; padding: 4px 0 0; color: var(--ink-3) !important; font-size: 14px !important; }
  .cd-more[hidden] { display: none; }
  .cd-act { display: flex; gap: 6px; padding: 8px 10px 10px; }
  .cd-ab { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; border-radius: 999px; padding: 0 10px; min-height: 40px; color: var(--ink-2) !important; font-size: 14px !important; font-variant-numeric: tabular-nums; }
  .cd-ab span:empty { display: none; }
  .cd-ab.like.on { color: var(--primary, var(--sand-deep)) !important; }
  .cd-ab.like.on svg { fill: currentColor; }
  .cd-cm { border-top: 1px solid var(--line); padding: 4px 16px 14px; }
  .cd-cm[hidden] { display: none; }
  .cd-reply { display: flex; gap: 10px; padding: 10px 0; }
  .cd-reply + .cd-reply { border-top: 1px solid var(--line); }
  .cd-reply b { font-weight: 500; font-size: 14px; }
  .cd-reply p { margin: 3px 0 0; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; }
  .cd-form { display: flex; gap: 10px; align-items: flex-end; padding-top: 10px; }
  .cd-input { flex: 1; resize: none; overflow-y: auto; min-height: 40px; max-height: 160px; border: 1px solid var(--hair); border-radius: 20px; padding: 9px 14px; background: var(--glass-strong); color: inherit; font: inherit; font-size: 15px; line-height: 1.4; box-sizing: border-box; }
  .cd-send { min-height: 40px; padding: 0 16px; }
  .cd-empty { padding: 24px; color: var(--ink-3); }
  .cd-end { height: 1px; }

  /* Sidebar: topics and the team's pinned posts, sticky while the feed scrolls. */
  .cd-side { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 16px; }
  .cd-side-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
  .cd-chips { display: flex; flex-wrap: wrap; gap: 8px; }
  .cd-chip { border: 1px solid var(--hair) !important; background: var(--glass-strong); color: var(--ink-2) !important; border-radius: 999px; padding: 0 14px; font-size: 13.5px !important; min-height: 36px; }
  .cd-chip.on { background: var(--sand-soft) !important; color: var(--sand-text) !important; border-color: var(--sand) !important; }
  .cd-pin { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
  .cd-pin > .cd-pimg { width: 48px; height: 48px; border-radius: 12px; flex: 0 0 auto; }
  .cd-pin > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .cd-pin b { font-weight: 500; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

  /* Photo viewer. */
  .cd-lb { position: fixed; inset: 0; z-index: 1000; background: rgba(20,17,14,.92); display: grid; place-items: center; overscroll-behavior: contain; }
  .cd-lb > img { max-width: min(92vw, 1400px); max-height: 88vh; object-fit: contain; border-radius: 12px; }
  .cd-lbx, .cd-lbn { position: absolute; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(250,248,244,.14); color: #FAF8F4; display: grid; place-items: center; cursor: pointer; }
  .cd-lbx { top: 20px; right: 20px; }
  .cd-lbn { top: 50%; transform: translateY(-50%); } .cd-lbn.prev { left: 24px; } .cd-lbn.next { right: 24px; } .cd-lbn.next svg { transform: rotate(180deg); }
}
@media (min-width: 1024px) and (max-width: 1199px) {
  .cd-wrap { grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; }
}

/* r4b fix: the composer is a form in the desk column (text, a photo, Post). The field grows with the text (no resize
   handle); the photo shows as a thumbnail under it. */
@media (min-width: 1024px) {
  .cd-compose { align-items: flex-start; }
  .cd-cbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
  .cd-cinput { display: block; width: 100%; box-sizing: border-box; resize: none; overflow-y: auto; min-height: 44px; max-height: 200px; padding: 11px 18px; border-radius: 22px; font: inherit; font-size: 15px; line-height: 1.4; color: var(--ink) !important; }
  .cd-cinput::placeholder { color: var(--ink-3); }
  .cd-cinput:focus-visible { outline: 3px solid var(--sand); outline-offset: 2px; }
  .cd-compose .cd-ib { flex: 0 0 auto; }
  .cd-cprev[hidden], .cd-cmsg[hidden] { display: none; }
  .cd-cthumb { display: block; width: 88px; height: 88px; border-radius: 14px; background: center / cover no-repeat; border: 1px solid var(--hair); }
  .cd-cmsg { margin: 0; font-size: 13px; color: var(--ink-3); }
  .cd-compose[aria-busy="true"] .cd-btn { opacity: .6; pointer-events: none; }
}
