/* Campus feed — Instagram-style cards in a centred column with a side rail on wide screens, photo carousel with snap
   scrolling, colour text cards, reaction picker, event ticket, the "create post" dialog and insights. Colours follow
   the theme tokens (light / dark / contrast). */

/* ---------------------------------------------------------------- page layout */
.fd-layout { display: grid; grid-template-columns: minmax(0, 614px) 300px; gap: 36px; justify-content: center; align-items: start; }
.fd-page { min-width: 0; }
.fd-pagehead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.fd-pagehead h1 { font-size: 24px; line-height: 32px; font-weight: 800; letter-spacing: -.02em; }
.fd-pagehead .sub { color: var(--gray-500); font-size: 13.5px; }
.fd-tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 14px; border-radius: 12px; background: var(--gray-100); }
.fd-tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: none; padding: 8px 12px; border-radius: 9px;
  font: inherit; font-weight: 700; font-size: 13.5px; color: var(--gray-500); cursor: pointer; transition: background .15s, color .15s; }
.fd-tabs button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(16, 24, 40, .1); }

.fd-rail { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 22px; padding-top: 4px; min-width: 0; }
.fd-rail-me { display: flex; align-items: center; gap: 12px; }
.fd-rail-me > div { flex: 1; display: flex; flex-direction: column; }
.fd-rail-me b { font-size: 14px; } .fd-rail-me small { font-size: 12.5px; color: var(--gray-500); }
.fd-rail-sec { display: flex; flex-direction: column; gap: 10px; }
.fd-rail-h { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--gray-500); }
.fd-rail-list { display: flex; flex-direction: column; gap: 4px; }
.fd-rail-ev { display: flex; align-items: center; gap: 12px; padding: 8px; margin: 0 -8px; border-radius: 12px; color: var(--ink); }
.fd-rail-ev:hover { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(16, 24, 40, .06); }
.fd-rail-ev > div { display: flex; flex-direction: column; } .fd-rail-ev b { font-size: 13.5px; } .fd-rail-ev small { font-size: 12px; color: var(--gray-500); }
.fd-rail-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.fd-rail-cats button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--gray-200); background: var(--surface); border-radius: 999px; padding: 6px 12px;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--gray-700); cursor: pointer; }
.fd-rail-cats button:hover { border-color: var(--c); color: color-mix(in srgb, var(--c) 80%, var(--ink)); }
.fd-rail-foot { font-size: 12px; color: var(--gray-400); }

/* ---------------------------------------------------------------- the list */
.fd { position: relative; display: flex; flex-direction: column; gap: 14px; }
.fd-list { display: flex; flex-direction: column; gap: 18px; }
.fd-compose-bar { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; border: 1px solid var(--gray-200); border-radius: 18px; background: var(--surface); }
.fd-compose-in { flex: 1; min-width: 0; height: 42px; border: 0; border-radius: 999px; padding: 0 16px; background: var(--gray-100); color: var(--gray-500); font: inherit;
  text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background .15s; }
.fd-compose-in:hover { background: var(--gray-200); }
.fd-compose-ph { width: 42px; height: 42px; flex: none; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, #F79009, #DD2590 55%, #7A5AF8); }
.fd-filters { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.fd-filters::-webkit-scrollbar { display: none; }
.fd-filters button { flex: none; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--gray-200); background: var(--surface); border-radius: 999px;
  padding: 7px 14px; font: inherit; font-size: 13px; font-weight: 600; color: var(--gray-700); cursor: pointer; transition: all .15s; }
.fd-filters button:hover { border-color: var(--gray-300); }
.fd-filters button.on { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.fd-newpill { position: sticky; top: 76px; z-index: 6; align-self: center; display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; margin-bottom: -40px;
  padding: 9px 18px; background: var(--primary); color: #fff; font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; box-shadow: 0 8px 24px rgba(59, 91, 219, .35);
  animation: fd-pop .2s ease-out; }
.fd-newpill.hidden { display: none; }
.fd-loading { display: grid; place-items: center; padding: 10px; }
.fd-end { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--gray-500); font-size: 13px; font-weight: 600; padding: 10px 0 24px; }
.fd-end span { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 16px;
  background: linear-gradient(135deg, #F79009, #DD2590 55%, #7A5AF8); }
.fd-sentinel { height: 1px; }

/* skeleton while the first page loads */
.fd-skel .sk { display: block; background: linear-gradient(90deg, var(--gray-100), var(--gray-50), var(--gray-100)); background-size: 200% 100%; animation: fd-sk 1.2s infinite linear; border-radius: 6px; }
.fd-skel i.sk { height: 12px; margin: 5px 0; } .fd-skel .w25 { width: 25%; } .fd-skel .w40 { width: 40%; } .fd-skel .w60 { width: 60%; } .fd-skel .w80 { width: 80%; }
.fd-skel .fd-av.sk { border-radius: 50%; }
.fd-skel .fd-media.sk { border-radius: 0; }
@keyframes fd-sk { to { background-position: -200% 0; } }

/* ---------------------------------------------------------------- the card */
.fd-card { position: relative; background: var(--surface); border: 1px solid var(--gray-200); border-radius: 20px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .04); }
.fd-card.pinned { box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 30%, transparent), 0 4px 16px rgba(16, 24, 40, .05); border-color: transparent; }
.fd-head { display: flex; align-items: center; gap: 10px; padding: 12px 8px 12px 14px; position: relative; }
.fd-ring { flex: none; padding: 2px; border-radius: 50%; background: conic-gradient(from 200deg, #F79009, #DD2590, #7A5AF8, #3B5BDB, #F79009); }
.fd-av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13.5px; flex: none; }
.fd-ring .fd-av { border: 2px solid var(--surface); width: 40px; height: 40px; }
.fd-who { flex: 1; min-width: 0; }
.fd-name { font-weight: 700; font-size: 14.5px; line-height: 19px; display: flex; align-items: center; gap: 5px; color: var(--ink); min-width: 0; }
.fd-pin { color: var(--primary); display: inline-flex; flex: none; }
.fd-sub { display: flex; align-items: center; gap: 5px; font-size: 12.5px; line-height: 17px; color: var(--gray-500); min-width: 0; }
.fd-sub i { font-style: normal; font-size: 9px; opacity: .7; }
.nowrap { white-space: nowrap; }
.fd-cat { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 4px 10px 4px 8px; border-radius: 999px;
  color: color-mix(in srgb, var(--c) 82%, var(--ink)); background: color-mix(in srgb, var(--c) 12%, var(--surface)); }
.fd-icon { width: 36px; height: 36px; border-radius: 50%; border: 0; background: none; display: grid; place-items: center; color: var(--gray-600); cursor: pointer; flex: none; }
.fd-icon:hover { background: var(--gray-100); color: var(--ink); }
.fd-menu { position: absolute; right: 10px; top: 52px; z-index: 20; background: var(--surface); border: 1px solid var(--gray-200); border-radius: 14px; box-shadow: var(--shadow-pop);
  padding: 6px; min-width: 220px; display: flex; flex-direction: column; animation: fd-pop .14s ease-out; }
.fd-menu button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; border-radius: 9px; background: none; font: inherit; font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer; text-align: left; }
.fd-menu button:hover { background: var(--gray-100); } .fd-menu button.danger { color: var(--error-700); }
.fd-status { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 7px; background: var(--warning-50); color: var(--warning-700); }
.fd-status.expired { background: var(--gray-100); color: var(--gray-600); }

/* photos */
.fd-media { position: relative; width: 100%; max-height: 80vh; overflow: hidden; background: var(--ph, var(--gray-100)); }
.fd-track { display: flex; width: 100%; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.fd-track::-webkit-scrollbar { display: none; }
.fd-slide { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; position: relative; }
.fd-slide::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .25) 50%, transparent 70%);
  background-size: 200% 100%; animation: fd-sk 1.4s infinite linear; }
.fd-slide.ready::before { display: none; }
.fd-slide img { position: relative; width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; -webkit-user-drag: none; opacity: 0; transition: opacity .35s; }
.fd-slide.ready img { opacity: 1; }
.fd-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92); color: #101828;
  display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .15s; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); z-index: 2; }
.fd-nav svg { width: 16px; height: 16px; }
.fd-nav.prev { left: 10px; } .fd-nav.next { right: 10px; }
.fd-media:hover .fd-nav, .fd-nav.show { opacity: 1; }
.fd-media.at-start .fd-nav.prev, .fd-media.at-end .fd-nav.next { opacity: 0; pointer-events: none; }
.fd-count-pill { position: absolute; top: 12px; right: 12px; z-index: 2; background: rgba(16, 24, 40, .6); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  backdrop-filter: blur(6px); }
.fd-burst { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; font-size: 96px; pointer-events: none; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .35));
  animation: fd-burst .85s ease-out forwards; }
@keyframes fd-burst { 0% { opacity: 0; transform: scale(.3); } 15% { opacity: 1; transform: scale(1.2); } 30% { transform: scale(.95); } 70% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.1) translateY(-20px); } }

/* text-only post: a colour card */
.fd-text { position: relative; aspect-ratio: 16 / 10; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; padding: 32px 28px;
  color: #fff; text-align: center; overflow: hidden; user-select: none; }
.fd-text::before, .fd-text::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .1); }
.fd-text::before { width: 240px; height: 240px; top: -90px; right: -70px; } .fd-text::after { width: 180px; height: 180px; bottom: -80px; left: -50px; }
.fd-text-emo { position: relative; font-size: 34px; line-height: 1; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .2)); }
.fd-text-t { position: relative; font-size: 24px; line-height: 31px; font-weight: 800; letter-spacing: -.01em; text-wrap: balance; max-width: 460px; text-shadow: 0 2px 12px rgba(0, 0, 0, .15); }
.fd-text-t.long { font-size: 19px; line-height: 26px; }
.fd-text-cat { position: relative; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }

/* actions */
.fd-actions { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 2px; padding: 6px 8px 2px; }
.fd-a { width: 42px; height: 42px; border: 0; background: none; border-radius: 50%; display: grid; place-items: center; color: var(--ink); cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: transform .12s; }
.fd-a svg { width: 24px; height: 24px; stroke-width: 1.9; }
.fd-a:hover { color: var(--gray-500); } .fd-a:active { transform: scale(.88); }
.fd-a.heart.love { color: #F0284A; } .fd-a.heart.love svg { fill: #F0284A; }
.fd-a.heart.pop { animation: fd-heart .35s ease-out; }
@keyframes fd-heart { 40% { transform: scale(1.3); } 100% { transform: scale(1); } }
.fd-emo { font-size: 23px; line-height: 1; }
.fd-react-wrap { position: relative; display: flex; }
.fd-picker { position: absolute; bottom: calc(100% + 4px); left: 0; z-index: 15; display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--gray-200); border-radius: 999px;
  padding: 5px 7px; box-shadow: 0 10px 30px rgba(16, 24, 40, .18); animation: fd-pop .16s ease-out; }
.fd-picker.hidden { display: none; }
.fd-picker button { width: 42px; height: 42px; border: 0; background: none; border-radius: 50%; font-size: 27px; cursor: pointer; transition: transform .14s; line-height: 1; padding: 0; }
.fd-picker button:hover { transform: scale(1.3) translateY(-4px); }
.fd-picker button.on { background: var(--primary-100); }
@keyframes fd-pop { from { transform: translateY(6px) scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }
.fd-actions-mid { display: flex; justify-content: center; }
.fd-dots { display: flex; gap: 4px; }
.fd-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--gray-300); transition: background .15s, transform .15s; }
.fd-dots i.on { background: var(--primary); transform: scale(1.15); }
.fd-insight { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 7px 12px; background: var(--primary-50); color: var(--primary-700);
  font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.fd-insight:hover { background: var(--primary-100); }

/* text */
.fd-body { padding: 2px 16px 14px; display: flex; flex-direction: column; gap: 6px; }
.fd-count { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink); }
.fd-emos { display: flex; }
.fd-emos span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; background: var(--surface); border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--gray-200); margin-left: -6px; } .fd-emos span:first-child { margin-left: 0; }
.fd-title { font-weight: 800; font-size: 15.5px; line-height: 21px; color: var(--ink); text-wrap: balance; margin-top: 2px; }
.fd-cap { font-size: 14.5px; line-height: 21px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.fd-cap.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fd-more { align-self: flex-start; border: 0; background: none; padding: 0; color: var(--gray-500); font: inherit; font-weight: 600; cursor: pointer; margin-top: -4px; }
.fd-tag { color: var(--primary-700); font-weight: 600; }
.fd-link { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px; background: var(--gray-50); border: 1px solid var(--gray-200);
  font-size: 13.5px; font-weight: 600; min-width: 0; }
.fd-foot { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--gray-500); margin-top: 2px; min-width: 0; }
.fd-foot svg { flex: none; }

/* event ticket */
.fd-event { display: flex; align-items: center; gap: 12px; padding: 10px; margin-top: 4px; border-radius: 16px; flex-wrap: wrap;
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 7%, var(--surface)), color-mix(in srgb, #DD2590 6%, var(--surface)));
  border: 1px solid color-mix(in srgb, var(--primary) 16%, var(--gray-200)); }
.fd-cal { width: 54px; border-radius: 12px; overflow: hidden; text-align: center; background: var(--surface); flex: none; box-shadow: 0 2px 6px rgba(16, 24, 40, .1); }
.fd-cal span { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #fff; background: linear-gradient(135deg, #F04438, #DD2590); padding: 3px 0; }
.fd-cal b { display: block; font-size: 21px; line-height: 24px; padding-top: 3px; color: var(--ink); }
.fd-cal small { display: block; font-size: 10.5px; font-weight: 700; color: var(--gray-500); padding-bottom: 4px; }
.fd-cal.pin { height: 54px; display: grid; place-items: center; color: var(--primary); }
.fd-cal.sm { width: 44px; } .fd-cal.sm b { font-size: 17px; line-height: 20px; padding: 3px 0 4px; }
.fd-ev-info { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 3px; }
.fd-ev-t, .fd-ev-v { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink); font-weight: 700; }
.fd-ev-v { font-weight: 500; color: var(--gray-600); }
.fd-ev-t svg, .fd-ev-v svg { flex: none; color: var(--gray-500); }
.fd-ev-when { font-size: 12px; font-weight: 700; color: var(--primary-700); }
.fd-ev-when:empty { display: none; }
.fd-ev-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 9px 14px; background: var(--ink); color: var(--surface);
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.fd-ev-btn:hover { opacity: .9; }

/* share sheet (works on desktop too) */
.fd-sheet { max-width: 460px; margin: 0 auto; padding-bottom: 12px; }
@media (min-width: 861px) { .wa-sheet-back:has(.fd-sheet) { align-items: center; } .fd-sheet { border-radius: 20px; } }
.fd-share-h { display: flex; align-items: center; gap: 12px; padding: 4px 16px 12px; border-bottom: 1px solid var(--gray-200); margin-bottom: 6px; }
.fd-share-h img, .fd-share-h > span { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; flex: none; display: grid; place-items: center; font-size: 22px; }
.fd-share-h b { display: block; font-size: 14px; } .fd-share-h small { color: var(--gray-500); font-size: 12.5px; }
.fd-share-i { display: flex !important; align-items: center; gap: 14px; text-align: left; }
.fd-share-i .ic { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--gray-100); color: var(--ink); flex: none; }
.fd-share-i b { display: block; font-size: 14.5px; } .fd-share-i small { display: block; font-size: 12.5px; color: var(--gray-500); font-weight: 400; }

/* ---------------------------------------------------------------- create post dialog */
body.fd-noscroll { overflow: hidden; }
.fd-cmp-back { position: fixed; inset: 0; z-index: 90; background: rgba(10, 14, 22, .62); display: grid; place-items: center; padding: 24px; animation: fd-fade .15s ease-out; }
@keyframes fd-fade { from { opacity: 0; } }
.fd-cmp { width: min(1080px, 100%); height: min(720px, 100%); background: var(--surface); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35); animation: fd-pop .2s ease-out; }
.fd-cmp-h { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 8px; height: 54px; padding: 0 8px 0 6px; border-bottom: 1px solid var(--gray-200); flex: none; }
.fd-cmp-h > b { text-align: center; font-size: 15.5px; }
.fd-share-btn { border: 0; background: none; color: var(--primary); font: inherit; font-weight: 800; font-size: 15px; padding: 8px 14px; border-radius: 10px; cursor: pointer; }
.fd-share-btn:hover { background: var(--primary-50); } .fd-share-btn:disabled { opacity: .6; }
.fd-cmp-b { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 380px; }
.fd-cmp-media { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--gray-50); border-right: 1px solid var(--gray-200); }
.fd-stage { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 18px; gap: 12px; transition: background .15s; }
.fd-stage.over { background: var(--primary-50); outline: 2px dashed var(--primary); outline-offset: -10px; }
.fd-stage-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--gray-500); padding: 20px; }
.fd-stage-art { position: relative; width: 120px; height: 90px; margin-bottom: 8px; }
.fd-stage-art svg { position: absolute; width: 64px; height: 64px; stroke-width: 1.3; color: var(--ink); }
.fd-stage-art svg:first-child { left: 8px; top: 4px; transform: rotate(-9deg); }
.fd-stage-art svg:last-child { right: 8px; top: 18px; transform: rotate(8deg); color: var(--primary); background: var(--gray-50); border-radius: 12px; }
.fd-stage-empty b { font-size: 19px; color: var(--ink); } .fd-stage-empty > span { font-size: 13.5px; }
.fd-stage-empty .btn { margin-top: 8px; }
.fd-stage-empty small { margin-top: 10px; font-size: 12.5px; color: var(--gray-400); }
.fd-stage-text { width: 100%; max-width: 520px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.fd-stage-text .fd-text { width: 100%; border-radius: 16px; box-shadow: 0 10px 30px rgba(16, 24, 40, .15); }
.fd-stage-add, .fd-shapes button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--gray-200); background: var(--surface); border-radius: 999px;
  padding: 7px 14px; font: inherit; font-size: 13px; font-weight: 700; color: var(--gray-700); cursor: pointer; }
.fd-frame-wrap { flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; container-type: size; }
.fd-frame { position: relative; aspect-ratio: var(--r, 1); width: min(100cqw, calc(100cqh * var(--r, 1))); border-radius: 10px; overflow: hidden; background: #000;
  box-shadow: 0 10px 30px rgba(16, 24, 40, .18); }
.fd-frame img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; }
.fd-grid-lines { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent calc(33.33% - .5px), rgba(255, 255, 255, .35) 33.33%, transparent calc(33.33% + .5px), transparent calc(66.66% - .5px), rgba(255, 255, 255, .35) 66.66%, transparent calc(66.66% + .5px)),
    linear-gradient(180deg, transparent calc(33.33% - .5px), rgba(255, 255, 255, .35) 33.33%, transparent calc(33.33% + .5px), transparent calc(66.66% - .5px), rgba(255, 255, 255, .35) 66.66%, transparent calc(66.66% + .5px)); }
.fd-shapes { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.fd-shapes button i { display: block; height: 14px; border: 2px solid currentColor; border-radius: 3px; }
.fd-shapes button.on { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.fd-strip { display: flex; gap: 8px; padding: 12px 16px; overflow-x: auto; border-top: 1px solid var(--gray-200); background: var(--surface); flex: none; scrollbar-width: thin; }
.fd-strip:empty { display: none; }
.fd-tile { position: relative; width: 68px; height: 68px; flex: none; border-radius: 10px; overflow: hidden; cursor: pointer; border: 2px solid transparent; padding: 0; background: var(--gray-100); }
.fd-tile.on { border-color: var(--primary); }
.fd-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fd-tile.add { display: grid; place-items: center; border: 2px dashed var(--gray-300); color: var(--gray-500); background: none; }
.fd-tile.add:hover { border-color: var(--primary); color: var(--primary); }
.fd-tile button { position: absolute; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(16, 24, 40, .7); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
.fd-tile button svg { width: 13px; height: 13px; }
.fd-tile .x { top: 3px; right: 3px; } .fd-tile .l { bottom: 3px; left: 3px; }
.fd-tile-cover { position: absolute; left: 0; right: 0; bottom: 0; font-size: 9.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; text-align: center; color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, .65)); padding: 8px 0 2px; }

.fd-side { min-width: 0; overflow-y: auto; padding: 16px 18px 24px; display: flex; flex-direction: column; gap: 12px; }
.fd-me { display: flex; align-items: center; gap: 10px; }
.fd-me > div { display: flex; flex-direction: column; } .fd-me b { font-size: 14px; } .fd-me small { font-size: 12px; color: var(--gray-500); }
.fd-in-title { width: 100%; border: 0; outline: 0; background: none; font: inherit; font-size: 18px; font-weight: 800; color: var(--ink); padding: 6px 0; }
.fd-in-title::placeholder, .fd-in-cap::placeholder { color: var(--gray-400); font-weight: 500; }
.fd-cap-wrap { position: relative; border-bottom: 1px solid var(--gray-200); padding-bottom: 22px; }
.fd-in-cap { width: 100%; min-height: 110px; border: 0; outline: 0; background: none; resize: none; font: inherit; font-size: 14.5px; line-height: 21px; color: var(--ink); padding: 0; }
.fd-counter { position: absolute; right: 0; bottom: 4px; font-size: 11.5px; color: var(--gray-400); }
.fd-label { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--gray-500); margin-top: 4px; }
.fd-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.fd-cats button { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--gray-200); background: var(--surface); border-radius: 999px; padding: 6px 11px;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--gray-700); cursor: pointer; transition: all .12s; }
.fd-cats button.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--surface)); color: color-mix(in srgb, var(--c) 82%, var(--ink)); box-shadow: 0 0 0 1px var(--c) inset; }
.fd-opts { display: flex; flex-direction: column; border: 1px solid var(--gray-200); border-radius: 14px; margin-top: 6px; }
.fd-opts > div + div { border-top: 1px solid var(--gray-200); }
.fd-opt-h { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.fd-opt-h.click { cursor: pointer; } .fd-opt-h.click:hover { background: var(--gray-50); }
.fd-opts > div:first-child .fd-opt-h { border-radius: 14px 14px 0 0; } .fd-opts > div:last-child .fd-opt-h { border-radius: 0 0 14px 14px; }
.fd-opt-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--gray-100); color: var(--gray-700); flex: none; }
.fd-opt-h .grow { display: flex; flex-direction: column; }
.fd-opt-h b { font-size: 14px; } .fd-opt-h small { font-size: 12.5px; color: var(--gray-500); }
.fd-chev { color: var(--gray-500); display: grid; transition: transform .15s; } .fd-chev.up { transform: rotate(180deg); }
.fd-opt-b { padding: 0 14px 14px; }
.fd-seg { display: flex; gap: 4px; padding: 4px; border-radius: 11px; background: var(--gray-100); }
.fd-seg button { flex: 1; border: 0; background: none; border-radius: 8px; padding: 7px 8px; font: inherit; font-size: 13px; font-weight: 700; color: var(--gray-500); cursor: pointer; white-space: nowrap; }
.fd-seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(16, 24, 40, .1); }
.fd-seg.sm { margin-top: 10px; } .fd-seg.sm button { font-size: 12px; }
.fd-aud-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; max-height: 190px; overflow-y: auto; }
.fd-aud { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--gray-200); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--gray-700); }
.fd-aud input { display: none; } .fd-aud svg { display: none; }
.fd-aud.on { background: var(--primary-50); border-color: var(--primary); color: var(--primary-700); } .fd-aud.on svg { display: block; }
.fd-all { border: 0; background: none; color: var(--primary); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; padding: 6px 4px; }
.fd-line { display: flex; align-items: center; gap: 12px; }
.fd-line .grow { display: flex; flex-direction: column; } .fd-line b { font-size: 13.5px; } .fd-line small { font-size: 12px; color: var(--gray-500); }
.fd-switch { position: relative; width: 44px; height: 26px; flex: none; cursor: pointer; }
.fd-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.fd-switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--gray-300); transition: background .18s; }
.fd-switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .18s; }
.fd-switch input:checked + i { background: var(--primary); } .fd-switch input:checked + i::after { transform: translateX(18px); }
.fd-switch input:focus-visible + i { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------------------------------------------------------------- insights */
.fd-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.fd-kpi { display: flex; flex-direction: column; gap: 2px; padding: 14px; border: 1px solid var(--gray-200); border-radius: 14px; background: var(--surface); }
.fd-kpi .k-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary-700); margin-bottom: 6px; }
.fd-kpi > span:not(.k-ic) { font-size: 12px; color: var(--gray-500); font-weight: 600; } .fd-kpi b { font-size: 26px; line-height: 32px; color: var(--ink); } .fd-kpi small { font-size: 12px; color: var(--gray-500); }
.fd-kpi.good b { color: var(--success-700); }
.fd-sec { padding: 16px; border: 1px solid var(--gray-200); border-radius: 14px; }
.fd-h4 { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--gray-500); margin: 0 0 12px; }
.fd-chart { height: 210px; }
.fd-bar { display: flex; align-items: center; gap: 10px; } .fd-bar .e { font-size: 20px; width: 28px; } .fd-bar b { width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
.fd-bar .track, .fd-mini { flex: 1; height: 10px; border-radius: 5px; background: var(--gray-100); overflow: hidden; }
.fd-bar .track i, .fd-mini i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #7A5AF8); border-radius: 5px; }
.fd-mini { height: 8px; }
.fd-reactors { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto; }
.fd-reactors > div { display: flex; align-items: center; gap: 10px; font-size: 13.5px; } .fd-reactors .e { font-size: 18px; }

/* ---------------------------------------------------------------- narrower screens */
@media (max-width: 1180px) { .fd-layout { grid-template-columns: minmax(0, 614px); } .fd-rail { display: none; } }
@media (max-width: 860px) {
  .fd-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* the create dialog becomes a full-screen page: photos on top, details below */
  .fd-cmp-back { padding: 0; }
  .fd-cmp { width: 100%; height: 100%; border-radius: 0; }
  .fd-cmp-h { padding-top: env(safe-area-inset-top, 0px); height: calc(54px + env(safe-area-inset-top, 0px)); }
  .fd-cmp-b { display: block; overflow-y: auto; }
  .fd-cmp-media { border-right: 0; border-bottom: 1px solid var(--gray-200); }
  .fd-stage { padding: 12px; min-height: 0; }
  .fd-frame-wrap { flex: none; height: min(62vh, calc(100vw - 24px)); }
  .fd-stage-empty { padding: 26px 10px; }
  .fd-side { overflow: visible; padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
}
/* phones: full-bleed cards like the Instagram app */
@media (max-width: 600px) {
  .fd-list { gap: 0; margin: 0 -16px; }
  .fd-card { border-radius: 0; border-width: 0 0 1px; box-shadow: none; }
  .fd-card.pinned { box-shadow: none; border-color: var(--gray-200); }
  .fd-list > .fd-card:first-child { border-top: 1px solid var(--gray-200); }
  .fd-body { padding-bottom: 18px; }
  .fd-nav { display: none; }
  .fd-newpill { top: calc(72px + env(safe-area-inset-top, 0px)); }
  .fd-cat .t { display: none; } .fd-cat { padding: 5px 7px; font-size: 14px; }
  .fd-pagehead h1 { font-size: 21px; line-height: 28px; } .fd-pagehead .sub { display: none; }
  .fd-new { width: 40px; height: 40px; padding: 0; border-radius: 50%; justify-content: center; } .fd-new span { display: none; }
  .fd-compose-bar { border-radius: 16px; }
  .fd-filters { margin: 0 -16px; padding: 2px 16px; }
  .fd-text-t { font-size: 21px; line-height: 28px; } .fd-text { padding: 28px 22px; }
  .fd-empty { margin: 0 16px; }
  .fd-ev-btn { flex: 1 1 100%; justify-content: center; }
}

/* ---------------------------------------------------------------- student home: feed in the middle, like Instagram */
.sh-top { display: flex; flex-direction: column; gap: 14px; }
.sh-stories { display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 4px; }
.sh-stories::-webkit-scrollbar { display: none; }
.sh-story { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: none; width: 70px; color: var(--gray-700); text-decoration: none; }
.sh-story .ring { display: block; box-sizing: border-box; width: 64px; height: 64px; border-radius: 50%; padding: 2.5px; background: conic-gradient(from 200deg, #F79009, #DD2590, #7A5AF8, #3B5BDB, #F79009); }
.sh-story .ring::after { content: none; }
.sh-story .ring > span { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--ink); border: 2.5px solid var(--surface); }
.sh-story .ring svg { width: 22px; height: 22px; }
.sh-story small { font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--ink); }
.sh-story:hover .ring > span { background: var(--primary-50); }
.sh-today { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.sh-today-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.sh-today-row::-webkit-scrollbar { display: none; }
.sh-period { flex: none; min-width: 96px; padding: 8px 10px; border-radius: 12px; background: var(--gray-50); border: 1px solid var(--gray-200); display: flex; flex-direction: column; gap: 1px; }
.sh-period span { font-size: 11px; font-weight: 700; color: var(--primary-700); } .sh-period b { font-size: 13.5px; } .sh-period small { font-size: 11.5px; color: var(--gray-500); }
.sh-period.now { background: var(--primary-50); border-color: var(--primary); }
/* compact stat pills (phones) instead of the four big cards */
.sh-pills { display: none; }
.sh-pill { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 10px; border-radius: 16px; background: var(--surface); border: 1px solid var(--gray-200); color: var(--ink); min-width: 140px; }
.sh-pill .ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--t) 13%, var(--surface)); color: color-mix(in srgb, var(--t) 85%, var(--ink)); }
.sh-pill b { display: block; font-size: 16px; line-height: 20px; } .sh-pill small { display: block; font-size: 11.5px; color: var(--gray-500); white-space: nowrap; }
.sh-pill.bad b { color: var(--error-700); }
.sh-grid { display: grid; grid-template-columns: minmax(0, 614px) minmax(0, 1fr); gap: 28px; align-items: start; }
.sh-feed { min-width: 0; }
.sh-feed-h { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; color: var(--ink); font-size: 16px; }
.sh-feed-h b { font-weight: 800; }
.sh-feed-h a { margin-left: auto; font-size: 13px; font-weight: 700; }
.sh-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 84px; min-width: 0; }
@media (max-width: 1100px) { .sh-grid { grid-template-columns: minmax(0, 614px); justify-content: center; } .sh-side { display: none; } }
@media (max-width: 767px) {
  .sh-top .sp-hero, .sh-top .sh-cards { display: none; }
  .sh-pills { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; }
  .sh-pills::-webkit-scrollbar { display: none; }
  .sh-stories { margin: 0 -16px; padding: 2px 16px 4px; }
  .sh-today { border-radius: 16px; }
  .sh-grid.section { margin-top: 18px; }
}
