/* =====================================================================
   PsyHub mockup -- shared stylesheet.

   Editorial / coffee-shop aesthetic. Body Helvetica, headings Times New
   Roman, hero display in Source Serif 4. Photos do the colour work; type
   stays small and quiet.

   Structure:
     1. Tokens
     2. Base & a11y
     3. Layout primitives
     4. Topnav
     5. Search (in topnav)
     6. Hero (full-bleed photo) + compact modifier
     7. Page-hero (typographic) + photo modifier
     8. Container card pattern (.surface-card)
     9. Right rail
    10. Footer
    11. Avatar hover-zoom
    12. Homepage components
    13. Practice components
    14. Support components
    15. Support-guides components

   Conflict resolution from the original page-scoped sheets:
     - homepage's tall .hero stays default; support's lighter strip is
       .hero.hero-compact
     - practice's photo backdrop page-hero is .page-hero.page-hero-photo;
       support-guides keeps the typographic .page-hero default
     - support's featured-guides row uses .guidance-card so the magazine
       .guide-card on support-guides keeps its name
   ===================================================================== */


/* ---------- 1. tokens ---------- */
:root {
  /* Plymouth official brand palette */
  --plymouth-azure:      #005DAC;
  --plymouth-azure-deep: #003e74;
  --plymouth-red:        #D93426;
  --plymouth-gold:       #EFDD90;

  /* coastal supporting palette */
  --rockpool:            #1f8d99;
  --kelp:                #3a7a4d;

  /* paper and ink */
  --paper:               #fbfaf7;
  --paper-2:             #f3f0e9;
  --card:                #ffffff;
  --ink:                 #1a1d22;
  --ink-2:               #2f3540;
  --ink-soft:            #5a6271;
  --ink-quiet:           #6a7080;
  --line:                #e2dcd0;
  --line-soft:           #ece6d8;

  --radius:              10px;
  --radius-sm:           6px;

  --focus-ring:          #1a6fc4;

  /* answer panel: subtle blue against warm paper */
  --answer-bg:           #eaf2fa;
  --answer-border:       #cfdce9;

  /* container width is shared by topnav, hero, container, footer so the
     edges line up across the page */
  --container-max:       1240px;
  --container-pad:       28px;
  --container-pad-sm:    16px;

  --topnav-h:            71px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --plymouth-azure:      #6db1eb;
    --plymouth-azure-deep: #9ec9f0;
    --plymouth-red:        #ff7a6c;
    --plymouth-gold:       #b29f4d;
    --rockpool:            #5cc4cf;
    --kelp:                #82b893;
    --paper:               #14130f;
    --paper-2:             #1c1b16;
    --card:                #1a1914;
    --ink:                 #ece8de;
    --ink-2:               #d2cdc0;
    --ink-soft:            #9b9485;
    --ink-quiet:           #8a8678;
    --line:                #2c2920;
    --line-soft:           #211e18;
    --answer-bg:           #1a2530;
    --answer-border:       #2a3a4a;
  }
}


/* ---------- 2. base & a11y ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Disable mobile double-tap-to-zoom (which can leave a horizontal
     stripe / partial pan), while still allowing pinch zoom. */
  touch-action: manipulation;
}
/* Belt-and-braces against horizontal page scroll on narrow viewports,
   so a stray overflowing element can't introduce a thin "stripe" on
   the right edge during scroll/tap interactions. */
html, body { overflow-x: clip; }

h1, h2, h3, h4 {
  font-family: 'Times New Roman', Times, Georgia, serif;
  font-weight: 400;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.005em;
  line-height: 1.22;
}

.editorial-italic {
  font-family: 'Times New Roman', Times, Georgia, serif;
  font-style: italic;
  color: var(--ink-soft);
}

a { color: var(--plymouth-azure); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
button { font: inherit; color: inherit; cursor: pointer; }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  top: -100px; left: 12px;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  z-index: 200;
  font-size: 14px;
  transition: top .15s;
}
.skip-link:focus { top: 12px; text-decoration: none; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .item { opacity: 1 !important; transform: none !important; }
  .hero-bg, .page-hero-bg { transform: none !important; }
}


/* ---------- 3. layout primitives ---------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad) 96px;
  position: relative;
  z-index: 2;
}

/* main two-column page layout: stream + right rail */
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 56px;
  margin-top: 36px;
}
.grid.grid-rail-wide { grid-template-columns: minmax(0, 1fr) 360px; }

@media (max-width: 960px) {
  .grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .rail { position: static; top: auto; }

  /* On narrow viewports, the homepage right rail collapses below
     the stream. Promote its first section (timetable CTA) to sit
     *above* the stream by flattening the rail with display:contents
     and using order on the children. Scoped via :has(.timetable-cta)
     so this only applies to rails that actually carry the CTA --
     stream-detail / other pages with a different "Related" rail
     are unaffected. */
  .grid > .rail:has(.timetable-cta) { display: contents; }
  .grid > .rail:has(.timetable-cta) > section { order: 1; }
  .grid > .rail:has(.timetable-cta) > section:first-child { order: -1; margin-bottom: 0; }

  /* Compact timetable CTA: single row, smaller icon, drop the
     section heading, description text and trailing note so it fits
     in a thin strip above the stream. */
  .grid > .rail:has(.timetable-cta) > section:first-child h3,
  .grid > .rail:has(.timetable-cta) > section:first-child .timetable-cta-text span,
  .grid > .rail:has(.timetable-cta) > section:first-child .timetable-note { display: none; }
  .grid > .rail:has(.timetable-cta) > section:first-child .timetable-cta {
    grid-template-columns: 28px 1fr auto;
    gap: 10px;
    padding: 10px 14px;
    margin-bottom: 0;
  }
  .grid > .rail:has(.timetable-cta) > section:first-child .timetable-cta-icon {
    width: 28px; height: 28px;
  }
  .grid > .rail:has(.timetable-cta) > section:first-child .timetable-cta-icon svg {
    width: 16px; height: 16px;
  }
}
@media (max-width: 720px) {
  .container { padding: 0 var(--container-pad-sm) 72px; }
}

/* small all-caps editorial label, used for section headers, rail
   headings, and card-eyebrow text */
.section-label {
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
}

/* "today" strip inside the hero: weather + swell on the image.
   Sits in a translucent dark pill so the type stays legible against
   any photo without the previous heavy text-shadow halo. */
.today-strip {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: stretch;
  align-self: flex-start;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 13.5px;
  color: #fff;
  background: rgba(15,15,18,.42);
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  padding: 6px 4px;
}
.today-strip .today-item {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 2px 14px;
  white-space: nowrap;
}
.today-strip .today-item + .today-item {
  border-left: 1px solid rgba(255,255,255,.18);
}
.today-strip .today-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,.72);
}
.today-strip .today-value {
  font-weight: 500;
  letter-spacing: 0.005em;
}
@media (max-width: 720px) {
  .today-strip { font-size: 11.5px; padding: 4px 12px; }
  .today-strip .today-item { padding: 0; }
  .today-strip .today-item + .today-item { border-left: none; }
  .today-strip .today-item + .today-item::before {
    content: ". ";
    white-space: pre;
  }
}

/* a small urgency icon paired with text: keeps signal non-colour-only */
.urgency-icon {
  width: 12px; height: 12px;
  display: inline-block;
  vertical-align: -2px;
  margin-right: 4px;
  flex-shrink: 0;
}


/* anchor jumps need to clear the sticky topnav so the target isn't hidden */
html { scroll-padding-top: 96px; }
[id^="cite-"],
[id^="faq-"] { scroll-margin-top: 96px; }

/* common-questions list on the support page */
.faq-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-soft);
}
.faq-list .faq {
  border-bottom: 1px solid var(--line-soft);
}
.faq-list summary {
  cursor: pointer;
  padding: 12px 4px;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  list-style: none;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::before {
  content: "+";
  display: inline-block;
  width: 1.2em;
  color: var(--focus-ring);
  font-weight: 600;
}
.faq-list details[open] summary::before { content: "\2212"; }
.faq-list .faq-answer {
  padding: 0 4px 14px 1.2em;
  color: var(--ink-2);
  font-size: 15px;
}
.faq-list .faq:target {
  background: var(--answer-bg);
  border-radius: var(--radius-sm);
}

/* ---------- 4. topnav ---------- */
.topnav {
  background: rgba(247,244,238,.55);
  border-bottom: 1px solid rgba(226,220,208,.45);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
}
/* drop the divider when there's a hero photo behind the nav --
   the line otherwise cuts across the image */
body:has(.page-hero-photo) .topnav,
body:has(.page-hero-band) .topnav,
body:has(.hero) .topnav { border-bottom-color: transparent; }
@media (prefers-color-scheme: dark) {
  .topnav { background: rgba(20,19,15,.5); }
}
.topnav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex; align-items: center; gap: 32px;
  padding: 16px var(--container-pad);
}

.brand {
  display: flex; align-items: center; gap: 7px;
  font-family: 'Times New Roman', Times, Georgia, serif;
  font-size: 23px; font-weight: 400;
  font-style: italic;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--ink); text-decoration: none; }
/* UoP shield -- native aspect ~0.82; constrain by height so it lines
   up with the wordmark cap-height without bloating the nav. */
.brand-mark {
  height: 27px;
  width: auto;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
  /* slight nudge so the shield's optical centre sits on the text baseline */
  transform: translateY(-1px);
}
@media (max-width: 720px) {
  .brand-mark { height: 24px; }
}

.topnav nav { display: flex; gap: 24px; flex: 1; font-size: 13.5px; }
.topnav nav a {
  color: var(--ink);
  padding: 4px 0;
  position: relative;
  font-weight: 600;
}
.topnav nav a:hover { color: #000; text-decoration: none; }
.topnav nav a.active { color: #000; font-weight: 700; }
.topnav nav a.active::after {
  content: ""; position: absolute;
  left: 0; right: 0; bottom: -18px;
  height: 1px; background: var(--ink);
}

.menu-toggle {
  display: none;
  background: none; border: none;
  color: var(--ink); padding: 8px;
  margin-left: -8px;
  border-radius: var(--radius-sm);
}
.menu-toggle:hover { background: var(--paper-2); }

.topnav-right { display: flex; align-items: center; gap: 18px; }

.bell {
  position: relative;
  cursor: pointer;
  color: var(--ink-soft);
  background: none; border: none;
  padding: 6px;            /* 30px hit target -- WCAG 2.5.5 */
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-sm);
}
.bell:hover { color: var(--ink); background: var(--paper-2); }
.bell.has-unread { color: var(--ink); }
.bell.has-unread svg { animation: bell-wiggle 1.1s ease-in-out 0.4s 2; transform-origin: 50% 10%; }
.bell-dot {
  position: absolute; top: -4px; right: -6px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px;
  background: var(--plymouth-red);
  border: 2px solid var(--paper);
  color: #fff;
  font-size: 11px; font-weight: 700; line-height: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  box-sizing: border-box;
}
@keyframes bell-wiggle {
  0%, 100% { transform: rotate(0); }
  15%      { transform: rotate(-12deg); }
  30%      { transform: rotate(10deg); }
  45%      { transform: rotate(-8deg); }
  60%      { transform: rotate(6deg); }
  75%      { transform: rotate(-3deg); }
  90%      { transform: rotate(2deg); }
}
@media (prefers-reduced-motion: reduce) {
  .bell.has-unread svg { animation: none; }
}

.me-pill {
  display: flex; align-items: center; gap: 8px;
  color: var(--ink); font-size: 14px;
}
.me-pill img {
  width: 30px; height: 30px; border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}

@media (max-width: 720px) {
  .topnav-inner { padding: 14px var(--container-pad-sm); gap: 14px; }
  .topnav nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 8px 16px 16px;
  }
  .topnav nav.open { display: flex; }
  .topnav nav a { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
  .topnav nav a:last-child { border-bottom: none; }
  .topnav nav a.active::after { display: none; }
  .menu-toggle { display: inline-flex; align-items: center; }
  .brand .brand-text { display: none; }
  .topnav-inner:has(nav.open) .brand .brand-text { display: inline; }
  /* Push the right-hand cluster (search, bell, user) to the end of
     the row, and let the search field stretch into the gap left by
     the hidden wordmark. */
  .topnav-right { flex: 1 1 auto; min-width: 0; justify-content: flex-end; }
}


/* ---------- 5. search (in topnav, plus suggestions panel) ---------- */
.search-wrap { position: relative; }
.search {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px 8px 34px;
  color: var(--ink);
  font-size: 13.5px;
  width: 240px;
  transition: width .25s, border-color .15s;
  font-family: 'Helvetica Neue', sans-serif;
}
.search::placeholder {
  color: var(--ink-soft);
  font-style: italic;
  font-family: 'Times New Roman', Times, serif;
  font-size: 14px;
}
.search:focus { outline: none; border-color: var(--ink-soft); width: 320px; }
.search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-soft);
  pointer-events: none;
}

.search-suggestions {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 380px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 36px rgba(20,20,30,.12);
  padding: 10px 8px 12px;
  z-index: 100;
}
.search-wrap:focus-within .search-suggestions { display: block; }
.search-suggestions-label {
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 11.5px; font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-quiet);
  padding: 6px 12px 8px;
}
.search-suggestion {
  display: block;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--ink-soft);
  border-radius: 6px;
  font-style: italic;
  font-family: 'Times New Roman', Times, serif;
  border: none;
}
.search-suggestion:hover {
  background: var(--paper-2);
  color: var(--ink);
  text-decoration: none;
}
.search-suggestions-foot {
  border-top: 1px solid var(--line-soft);
  margin-top: 8px;
  padding: 10px 12px 4px;
  font-size: 12px;
  color: var(--ink-quiet);
  font-style: italic;
  font-family: 'Times New Roman', Times, serif;
}

@media (max-width: 720px) {
  .search { width: 130px; }
  .search:focus { width: 180px; }
  .search-suggestions { width: calc(100vw - 32px); right: -8px; }
}


/* ---------- 6. hero (full-bleed photo) ---------- */
/* Default = homepage hero. The .hero-compact modifier shrinks it for
   utility pages (support). */
.hero {
  position: relative;
  height: calc(330px + var(--topnav-h));
  margin-top: calc(-1 * var(--topnav-h));   /* start at 0,0 behind the nav */
  overflow: hidden;
  background: var(--paper-2);
  margin-bottom: -110px;     /* the floating card overlaps this much */
}
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center 45%;
  will-change: transform;
}
/* legacy single full-frame overlay -- kept for .hero-compact pages
   which still use ::after. The homepage now layers a stronger,
   bottom-anchored .hero-scrim instead. */
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0,0,0,0.00) 0%,
    rgba(0,0,0,0.18) 50%,
    rgba(0,0,0,0.55) 100%
  );
  pointer-events: none;
}
/* Two-band scrim: soft wash under the headline (top) and a stronger
   one under the today-strip / floating card (bottom), leaving the
   middle of the photo as clear as possible. */
.hero-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,.45) 0%, rgba(0,0,0,.10) 28%, rgba(0,0,0,0) 45%),
    linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,.30) 75%, rgba(0,0,0,.65) 100%);
  pointer-events: none;
  z-index: 0;
}
.hero-content {
  position: relative; z-index: 1;
  max-width: var(--container-max); margin: 0 auto; height: 100%;
  padding: calc(28px + var(--topnav-h)) var(--container-pad) 120px;
  display: flex; flex-direction: column;
}
.hero-content .today-strip { margin-top: auto; }
.hero-title { display: flex; flex-direction: column; gap: 4px; }
.hero h1 {
  font-family: 'Source Serif 4', 'Times New Roman', serif;
  font-variation-settings: "opsz" 60;
  color: #fff;
  font-size: 62px;
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.024em;
  /* tight shadow -- the bottom scrim does the heavy contrast work,
     so the type doesn't need a fuzzy halo around every glyph */
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
  max-width: 720px;
  margin: 0;
}
.hero h1 em {
  font-style: italic;
  font-weight: 400;
  color: rgba(255,255,255,0.94);
}
.hero-meta {
  color: rgba(255,255,255,.88);
  font-size: 16px;
  font-weight: 400;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0,0,0,.45);
}
.hero-credit {
  position: absolute; right: 14px; top: 14px; z-index: 1;
  color: #fff;
  font-size: 10.5px;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  letter-spacing: 0.02em;
  background: rgba(0,0,0,.20);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 2px 8px;
  border-radius: 999px;
}

/* compact (support page) -- shorter and lighter gradient.
   Roughly 2/3 of the homepage hero height so secondary pages are
   visually slighter; the overlap (margin-bottom) is scaled with the
   height reduction so the content below lifts by the same amount. */
.hero.hero-compact { height: calc(165px + var(--topnav-h)); margin-bottom: -45px; }
.hero.hero-compact::after {
  background: linear-gradient(
    180deg,
    rgba(0,0,0,0.05) 0%,
    rgba(0,0,0,0.35) 100%
  );
}
.hero.hero-compact .hero-content {
  padding: calc(20px + var(--topnav-h)) var(--container-pad) 55px;
  justify-content: flex-start;
  gap: 0;
}
.hero.hero-compact h1 { font-size: 40px; }
.hero.hero-compact .hero-meta { font-size: 14px; }
/* compact heroes don't need the bottom scrim layer */
.hero.hero-compact .hero-scrim { display: none; }

@media (max-width: 720px) {
  .hero { height: calc(320px + var(--topnav-h)); margin-bottom: -90px; }
  .hero h1 { font-size: 44px; }
  .hero-content { padding: calc(24px + var(--topnav-h)) var(--container-pad-sm) 90px; }
  .hero-meta { font-size: 14px; }
  .hero.hero-compact { height: calc(140px + var(--topnav-h)); margin-bottom: -25px; }
  .hero.hero-compact h1 { font-size: 32px; }
}


/* ---------- 7. page-hero (typographic, with optional photo) ---------- */
/* default = typographic, used by support-guides. Add .page-hero-photo
   for the photo-backdrop variant used by practice. */
.page-hero {
  background: linear-gradient(180deg, var(--paper-2) 0%, var(--paper-2) 60%, color-mix(in srgb, var(--paper-2) 70%, var(--paper)) 100%);
  border-bottom: 1px solid var(--line);
  padding: 56px var(--container-pad) 64px;
}
.page-hero-inner {
  max-width: var(--container-max); margin: 0 auto;
}
.page-hero-crumb {
  font-family: 'Times New Roman', serif;
  font-style: italic;
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.page-hero-crumb a { color: var(--ink-soft); }
.page-hero h1 {
  font-family: 'Source Serif 4', 'Times New Roman', serif;
  font-variation-settings: "opsz" 60;
  font-size: 64px;
  line-height: 1;
  letter-spacing: -0.025em;
  margin: 4px 0 8px;
}
.page-hero-sub {
  font-family: 'Times New Roman', serif;
  font-style: normal;            /* upright -- single source of truth so
                                    pages don't need per-template
                                    font-style overrides. */
  font-size: 20px;
  color: var(--ink-soft);
  margin: 0; max-width: 60ch;
}

/* photo variant -- swaps the gradient for a photo backdrop with a dark
   overlay so the headline reads white over arbitrary imagery. Roughly
   2/3 of the homepage hero height; overlap (margin-bottom) is reduced
   by the same delta so following content lifts but the relative crop
   above the floating card is preserved. */
.page-hero.page-hero-photo {
  position: relative;
  height: calc(165px + var(--topnav-h));    /* extra space sits behind nav */
  margin-top: calc(-1 * var(--topnav-h));   /* pull hero up to start at 0,0 */
  overflow: hidden;
  background: var(--paper-2);
  border-bottom: none;
  margin-bottom: -30px;      /* upload card pulls up over this much */
  padding: 0;
}
.page-hero-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center 46%;
}
.page-hero.page-hero-photo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0,0,0,0.05) 0%,
    rgba(0,0,0,0.20) 45%,
    rgba(0,0,0,0.55) 100%
  );
  pointer-events: none;
}
.page-hero.page-hero-photo .page-hero-inner {
  position: relative; z-index: 1;
  height: 100%;
  padding: calc(20px + var(--topnav-h)) var(--container-pad) 40px;
  display: flex; flex-direction: column; justify-content: flex-start;
}
.page-hero.page-hero-photo .section-label { color: rgba(255,255,255,.85); }
.page-hero.page-hero-photo h1 {
  font-size: 40px;
  font-variation-settings: "opsz" 144, "SOFT" 50;
  color: #fff;
  line-height: 0.98;
  letter-spacing: -0.022em;
  text-shadow:
    0 0 12px rgba(0,0,0,.55),
    0 0 28px rgba(0,0,0,.45),
    0 0 2px rgba(0,0,0,.6);
  margin: 6px 0 6px;
}
.page-hero.page-hero-photo .page-hero-sub {
  color: rgba(255,255,255,.95);
  text-shadow: 0 1px 10px rgba(0,0,0,.55);
  max-width: 56ch;
}
/* flush variant -- hero that does NOT have a floating card overlapping
   it. Removes the negative margin-bottom and the matching bottom padding
   inside .page-hero-inner. Used by the calendar page. */
.page-hero.page-hero-photo.page-hero-flush {
  margin-bottom: 0;
  height: calc(165px + var(--topnav-h));
}
.page-hero.page-hero-photo.page-hero-flush .page-hero-inner {
  padding: calc(20px + var(--topnav-h)) var(--container-pad) 20px;
  justify-content: flex-end;
}
@media (max-width: 720px) {
  .page-hero.page-hero-photo.page-hero-flush { height: calc(140px + var(--topnav-h)); margin-bottom: 0; }
  .page-hero.page-hero-photo.page-hero-flush .page-hero-inner {
    padding: calc(16px + var(--topnav-h)) var(--container-pad-sm) 16px;
  }
}
.page-hero-credit {
  position: absolute; right: 14px; top: 14px; z-index: 2;
  color: #fff;
  font-size: 10.5px;
  font-family: 'Helvetica Neue', sans-serif;
  letter-spacing: 0.02em;
  background: rgba(0,0,0,.20);
  backdrop-filter: blur(6px);
  padding: 2px 8px;
  border-radius: 999px;
}
@media (max-width: 720px) {
  .page-hero { padding: 36px var(--container-pad-sm) 40px; }
  .page-hero h1 { font-size: 44px; }
  .page-hero-sub { font-size: 16px; }
  .page-hero.page-hero-photo { height: calc(140px + var(--topnav-h)); margin-bottom: -20px; padding: 0; }
  .page-hero.page-hero-photo .page-hero-inner { padding: calc(16px + var(--topnav-h)) var(--container-pad-sm) 30px; }
  .page-hero.page-hero-photo h1 { font-size: 32px; }
}


/* ---------- 8. surface card (floating panel that overlaps a hero) ----------
   Shared shape used for the homepage heads-up card, the practice upload
   panel, and the support ask-card. The aliased selectors keep the
   existing per-page class names working without needing extra classes
   in the HTML. */
.surface-card,
.headsup-card,
.upload-panel,
.ask-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: 0 1px 1px rgba(0,0,0,.02), 0 18px 50px rgba(20,20,30,.10);
  position: relative;
  z-index: 5;
  margin: 0 auto;
  max-width: 1184px;       /* sit slightly inside the container */
}
@media (max-width: 720px) {
  .surface-card,
  .headsup-card,
  .upload-panel,
  .ask-card { padding: 22px; }
}

.headsup-card {
  background: color-mix(in srgb, var(--card) 90%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}


/* ---------- 8b. document surface --------------------------------------
   Wraps the main content of a single-document detail page (resource,
   handbook, guide, opportunity, group, refdoc, headsup, profile etc).
   Distinct from .surface-card: no drop-shadow, sits inline in the
   container, generous padding for long-read content. */
.doc-surface {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 36px 44px 40px;
  margin-bottom: 32px;
}
@media (max-width: 700px) {
  .doc-surface { padding: 24px 22px 28px; border-radius: 12px; }
}

/* "back to" link sitting above a .doc-surface */
.doc-crumb { margin: 16px 0 14px; font-size: 13px; }
.doc-crumb a { color: var(--ink-quiet); }
.doc-crumb a:hover { color: var(--ink); }

/* doc hero: badge + h1 + meta + tags, with optional left thumbnail */
.doc-hero {
  display: flex; gap: 28px; align-items: flex-start;
  margin: 0 0 24px;
}
.doc-hero-body { min-width: 0; flex: 1; }
.doc-thumb {
  width: 180px; height: 135px; flex: 0 0 180px;
  object-fit: cover; border-radius: 10px;
  background: #f5f5f3;
}
.doc-badge {
  display: inline-block; font-size: 10.5px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-quiet);
  margin-bottom: 8px;
}
.doc-surface > .doc-hero h1,
.doc-surface > h1 { font-size: 34px; line-height: 1.15; margin: 0; }
.doc-meta {
  color: var(--ink-quiet); font-size: 14px;
  margin: 8px 0 0; line-height: 1.5;
}
@media (max-width: 700px) {
  .doc-hero { flex-direction: column; gap: 18px; }
  .doc-thumb { width: 100%; height: 200px; flex: 0 0 200px; }
  .doc-surface > .doc-hero h1,
  .doc-surface > h1 { font-size: 28px; }
}

/* tag pill row (replaces .resdet-kw, .res-tag etc) */
.tag-pill-row { margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tag-pill {
  font-size: 12px; padding: 3px 10px;
  border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink-soft); background: #fff;
  text-decoration: none;
  transition: background 120ms, border-color 120ms;
}
.tag-pill:hover { background: #f5f5f3; text-decoration: none; color: var(--ink); }
.tag-pill.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* links band: divider + primary CTA + secondary links list */
.doc-links { margin: 4px 0 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.doc-extra-links { list-style: none; margin: 16px 0 0; padding: 0; font-size: 14px; }
.doc-extra-links li { margin: 5px 0; }
.doc-extra-links a { color: var(--ink-soft); text-decoration: none; }
.doc-extra-links a:hover { color: var(--ink); text-decoration: underline; }

/* primary CTA button (solid dark) */
.btn-cta {
  font: inherit; font-size: 15px; font-weight: 500;
  color: #fff; text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: var(--ink);
  transition: background 120ms, transform 120ms;
}
.btn-cta:hover { background: var(--ink-2); color: #fff; text-decoration: none; }
.btn-cta:active { transform: translateY(1px); }
.btn-cta-icon { flex: 0 0 auto; }

/* outline variant */
.btn-cta-outline {
  font: inherit; font-size: 15px; font-weight: 500;
  color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: transparent;
  transition: background 120ms, color 120ms, transform 120ms;
}
.btn-cta-outline:hover { background: var(--ink); color: #fff; text-decoration: none; }
.btn-cta-outline:active { transform: translateY(1px); }

/* doc body wrapper -- constrains prose width */
.doc-body { margin-top: 4px; }
.doc-body .prose { max-width: 68ch; }

/* doc footer (e.g. "last checked", dates) */
.doc-footer {
  margin-top: 28px; padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--ink-quiet); font-size: 13px;
}


/* ---------- 9. right rail ---------- */
.rail {
  display: flex; flex-direction: column; gap: 36px;
  position: sticky; top: 84px;
  align-self: start;
  margin-top: 16px;
}
.rail h3 {
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 12px; font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
  margin-bottom: 12px;
}
.rail ul { list-style: none; padding: 0; margin: 0; }
.rail li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
  display: flex; align-items: baseline; gap: 14px;
  line-height: 1.45;
}
.rail li:last-child { border-bottom: none; }

/* a list whose items are full-width text rather than time + title pairs */
.rail ul.rail-list-block li { display: block; gap: 0; }

.rail .when {
  flex-shrink: 0;
  width: 86px;
  font-family: 'Times New Roman', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--ink-soft);
}
.rail .when.urgent { color: var(--plymouth-red); font-style: normal; font-weight: 500; }

.rail-note {
  color: var(--ink-soft);
  font-size: 13.5px;
  font-family: 'Times New Roman', serif;
  font-style: italic;
  line-height: 1.55;
  margin: 4px 0 0;
}
.timetable-note {
  font-size: 12px;
  color: var(--ink-quiet);
  margin-top: 8px;
}
.rail-link {
  font-size: 13px; color: var(--ink-soft);
  display: inline-block; margin-top: 10px;
}
.rail-link:hover { color: var(--ink); }


/* ---------- 10. footer ---------- */
footer {
  max-width: var(--container-max);
  margin: 96px auto 0;
  padding: 40px var(--container-pad);
  color: var(--ink-quiet);
  font-size: 13px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
}
footer a { color: var(--ink-soft); }
footer a:hover { color: var(--ink); }
.footer-text { flex: 1; line-height: 1.8; }
.footer-text strong {
  font-family: 'Times New Roman', serif;
  font-style: italic;
  font-weight: 400;
  color: var(--ink-2);
}
footer img {
  height: 80px; width: 220px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  opacity: 0.85;
}
.footer-edit-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  font-family: 'Helvetica Neue', sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--paper-2);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 999px;
}
.footer-edit-link:hover { color: var(--ink); border-color: var(--ink-quiet); }


/* ---------- 11. avatar hover-zoom ---------- */
/* circular avatars enlarge 2x on hover so it's actually possible to see
   who someone is. Applied across all pages to consistent selectors. */
.me-pill img,
.item-author img,
.tutor-card img,
.person img,
.dropin-attendees img {
  transition: transform .22s ease, box-shadow .22s ease;
  position: relative;
  z-index: 1;
  transform-origin: center;
}
.me-pill:hover img,
.item-author:hover img,
.tutor-card:hover img,
.person:hover img,
.me-pill img:hover,
.item-author img:hover,
.tutor-card img:hover,
.person img:hover,
.dropin-attendees img:hover {
  transform: scale(2);
  z-index: 60;
  box-shadow: 0 12px 36px rgba(20,20,30,.30);
}
@media (prefers-reduced-motion: reduce) {
  .me-pill:hover img,
  .item-author:hover img,
  .tutor-card:hover img,
  .person:hover img,
  .dropin-attendees:hover img { transform: none; }
}


/* =====================================================================
   12. HOMEPAGE
   ===================================================================== */

/* heads-up card sits on top of the surface-card shape */
.headsup-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 36px;
  align-items: start;
}
@media (max-width: 720px) {
  .headsup-grid { grid-template-columns: 1fr; gap: 14px; }
  .tasks-toggle { grid-column: 1; }
  /* Narrow .task layout (collapse 5-col grid -> 2-row stack) is
     redefined later in the file, after the desktop .task rule, so
     it wins on cascade order. */
}
.headsup-head { margin-bottom: 0; }
.headsup-head h2 {
  font-size: 30px; font-weight: 400;
  margin-top: 6px;
  text-wrap: balance;
}
.headsup-head .count {
  font-style: italic;
  color: var(--ink-quiet);
}

/* Empty state when there are no Nudges in the card. */
.headsup-empty {
  padding: 18px 0 12px;
}
.headsup-empty h3 {
  font-size: 36px;
  font-weight: 300;
  line-height: 1.1;
  margin: 0 0 10px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.headsup-empty p {
  font-family: 'Times New Roman', Times, serif;
  font-style: italic;
  font-size: 18px;
  color: var(--ink-quiet);
  margin: 0;
}

/* tasks list inside the heads-up card */
.tasks { list-style: none; padding: 0; margin: 0; overflow: visible; }
.task {
  display: grid;
  grid-template-columns: 22px 110px 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 15px;
  position: relative;
}
.task:first-child { padding-top: 0; }
.task:last-child { border-bottom: none; padding-bottom: 0; }

/* leftmost checkbox: mark done */
.task-check {
  width: 18px; height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--kelp, #4a7);
}

/* delete (trash) and snooze sit in the rightmost columns. The
   button posts to the dismiss endpoint -- which hides the nudge
   from the user's heads-up list -- so the trash icon reads
   "delete this from my list" rather than the cryptic "x". */
.task-dismiss {
  position: relative; z-index: 1;
  background: none; border: none;
  color: var(--ink-quiet);
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex; align-items: center;
  transition: color .15s, background .15s;
}
.task-dismiss:hover { color: var(--plymouth-red, #c0392b); background: var(--line-soft); }
.delete-icon { width: 18px; height: 18px; display: block; }

.task-snooze { position: relative; }
.task-snooze summary {
  list-style: none;
  cursor: pointer;
  color: var(--ink-quiet);
  padding: 4px 6px;
  border-radius: 4px;
  transition: color .15s, background .15s;
  display: inline-flex;
  align-items: center;
}
.task-snooze summary::-webkit-details-marker { display: none; }
.task-snooze summary:hover { color: var(--ink); background: var(--line-soft); }
.snooze-icon { width: 22px; height: 22px; display: block; }
.task-snooze-menu {
  position: absolute; right: 0; top: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px;
  display: flex; flex-direction: column;
  min-width: 170px;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.task-snooze-menu button {
  background: none; border: none;
  text-align: left;
  padding: 8px 10px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  border-radius: 4px;
}
.task-snooze-menu button:hover { background: var(--line-soft); }

/* "Done & dismissed →" link under the heads-up title */
.headsup-head .rail-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
}
.headsup-head .rail-link:hover { color: var(--ink); }
.task-when {
  font-family: 'Times New Roman', Times, serif;
  font-size: 14px;
  color: var(--ink-2);
  font-style: italic;
}
.task-when.urgent { color: var(--plymouth-red); font-style: normal; font-weight: 500; }
.task-when.soon   { color: var(--kelp); }
.task-when.todo   { color: var(--ink-quiet); }

/* Title is an <a> -- stretched link covers the whole row.
   Other controls bump z-index above it via .task-check / .task-action
   / .task-snooze / .task-dismiss rules below. */
.task-title {
  line-height: 1.4;
  display: block;
  color: inherit;
  text-decoration: none;
}
.task-title::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
}
.task-title:hover { color: var(--ink); }
.task-meta {
  display: block;
  color: var(--ink-quiet);
  font-size: 13px; margin-top: 2px;
  font-style: italic;
  font-family: 'Times New Roman', serif;
}

/* Lift interactive controls above the stretched title link. */
.task-check,
.task-action,
.task-snooze,
.task-dismiss { position: relative; z-index: 1; }

@media (max-width: 720px) {
  .task {
    grid-template-columns: 22px 1fr;
    grid-template-areas:
      "when  when"
      "check title";
    column-gap: 12px;
    row-gap: 4px;
    padding: 14px 0;
  }
  .task-when { grid-area: when; font-size: 12.5px; }
  .task-check { grid-area: check; align-self: start; margin-top: 2px; }
  .task-title { grid-area: title; }
  .task .task-snooze,
  .task .task-dismiss { display: none; }
}

/* Done state: 10s grace window with strikethrough. */
.task--done .task-title,
.task--done .task-when,
.task--done .task-meta {
  text-decoration: line-through;
  color: var(--ink-quiet);
}
.task {
  transition: opacity .4s ease, transform .4s ease;
}
.task--fading {
  opacity: 0;
  transform: translateX(8px);
  pointer-events: none;
}

/* Snoozed: not done, just sleeping. Mute the colour but no strikethrough. */
.task--snoozed:not(.task--done) .task-title,
.task--snoozed:not(.task--done) .task-when,
.task--snoozed:not(.task--done) .task-meta {
  color: var(--ink-quiet);
}

/* The empty placeholder row reuses .task, whose grid template puts the
   first child in a 22px-wide column; collapse the grid so the message
   has room to render on one line. */
.task--empty { display: block; padding: 12px 0; color: var(--ink-quiet); }

/* Sections on the archive page. */
.archive-section { margin-bottom: 36px; }
.archive-section + .archive-section { margin-top: 8px; }
.archive-section:first-of-type { margin-top: 40px; }
.archive-section .section-label {
  display: block;
  margin-bottom: 14px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* Compact variant of the typographic page-hero -- smaller headline,
   tighter vertical padding. Used by secondary/utility pages where the
   default 64px display title feels too loud (e.g. headsup archive). */
.page-hero.page-hero-compact {
  padding: 36px var(--container-pad) 40px;
}
.page-hero.page-hero-compact h1 {
  font-size: 40px;
  line-height: 1.05;
}
.page-hero.page-hero-compact .page-hero-sub {
  font-size: 17px;
}
@media (max-width: 720px) {
  .page-hero.page-hero-compact { padding: 28px var(--container-pad-sm) 32px; }
  .page-hero.page-hero-compact h1 { font-size: 30px; }
  .page-hero.page-hero-compact .page-hero-sub { font-size: 15px; }
}
.task-snooze-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-quiet);
  width: 22px;
}
.task-action {
  background: none; border: none;
  color: var(--ink-soft);
  font-size: 13px;
  padding: 0;
  cursor: pointer;
  transition: color .15s;
  text-decoration: none;
  font-family: inherit;
}
.task-action:hover { color: var(--ink); }
.task-action::after {
  content: " →";
  transition: margin-left .15s;
  display: inline-block;
  margin-left: 2px;
}
.task-action:hover::after { margin-left: 6px; }

.tasks[data-collapsed="true"] .task:nth-child(n+3) { display: none; }
.tasks-toggle {
  grid-column: 2;
  display: grid;
  grid-template-columns: 22px 110px 1fr auto;
  align-items: center;
  gap: 14px;
  background: none; border: none;
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 4px 0 0;
  margin-top: -28px;
  cursor: pointer;
  font-family: 'Helvetica Neue', Helvetica, sans-serif;
  width: 100%;
  text-align: left;
  transition: color .15s;
}
.tasks-toggle .label {
  font-size: 12px; letter-spacing: 0.16em;
  white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
.tasks-toggle .icon {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; line-height: 1;
  color: var(--ink-soft);
  font-family: 'Times New Roman', serif;
  transition: border-color .15s, color .15s, transform .2s;
}
.tasks-toggle:hover { color: var(--ink); }
.tasks-toggle:hover .icon { border-color: var(--ink-soft); color: var(--ink); }
.tasks-toggle[aria-expanded="true"] .icon { transform: rotate(45deg); }


/* the stream */
.stream-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 16px 0 12px;
}
.stream-head h2 { margin: 0; }
.filters { display: flex; gap: 18px; font-size: 13px; }

.chip {
  background: none; border: none;
  color: var(--ink-quiet);
  padding: 0; cursor: pointer;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
}
.chip.on { color: var(--ink); border-bottom-color: var(--ink); }
.chip:hover { color: var(--ink); }

.day-divider {
  font-family: 'Times New Roman', Times, serif;
  font-style: italic;
  font-size: 13px;
  color: var(--ink-quiet);
  margin: 64px 0 18px;       /* breathe between date groups */
  letter-spacing: 0.04em;
}
/* first divider in the list shouldn't push the top down */
.stream > .day-divider:first-child,
#stream-list > .day-divider:first-child { margin-top: 8px; }

/* Container-query host: stream items respond to the width of their own
   stream container, not the viewport. This lets the same items render
   correctly in a wide single-column stream and inside a narrower middle
   column on the staff homepage. */
.stream,
#stream-list {
  container-type: inline-size;
  container-name: stream;
}

/* stream items */
.item {
  padding: 28px 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 28px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .55s ease, transform .55s ease;
}
.item.in { opacity: 1; transform: none; }

.item-meta-col {
  font-size: 12px;
  color: var(--ink-quiet);
  line-height: 1.6;
}
.item-type {
  display: block;
  font-family: 'Times New Roman', Times, serif;
  font-style: italic;
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 10px;
}
.item-author { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.item-author img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.item-author span { color: var(--ink-soft); font-style: italic; font-family: 'Times New Roman', serif; }

.item h3 { font-size: 28px; font-weight: 400; line-height: 1.18; margin-bottom: 10px; letter-spacing: -0.01em; }
.item-body { color: var(--ink-soft); font-size: 16.5px; line-height: 1.6; margin-bottom: 14px; max-width: 60ch; }

/* Whole-card link: the <a class="item-link"> wraps the article so the
   full block is clickable, but only the title should *look* like a
   link on hover. Reset colour/underline on the wrapper, then apply
   the hover affordance to the h3 only. */
.item-link { color: inherit; display: block; }
.item-link:hover,
.item-link:focus { color: inherit; text-decoration: none; }
.item-link:hover h3,
.item-link:focus-visible h3 {
  color: var(--plymouth-azure);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* You said / We did stream item: small "you said" / "we did" labels
   above each summary block. */
.ysd-stream-block { margin: 6px 0 10px; }
.ysd-stream-block .item-body { margin-bottom: 4px; }
.ysd-stream-key {
  display: block;
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 10.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-quiet);
  margin-bottom: 4px;
}
.item-foot { display: flex; gap: 22px; font-size: 13px; }
.item-foot a { color: var(--ink-soft); }
.item-foot a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.status {
  display: inline-block;
  margin-left: 12px;
  font-family: 'Times New Roman', Times, serif;
  font-style: italic;
  font-size: 14px;
  color: var(--ink-quiet);
  vertical-align: middle;
}
.status.urgent { color: var(--plymouth-red); }
.status.action { color: var(--plymouth-azure); }

/* tier 1: lead item -- one per day, full-width photo and big head */
.item-lead {
  grid-template-columns: 1fr;
  padding: 36px 0 40px;
  border-top: 2px solid var(--ink);
}
.item-lead .item-meta-col {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
  margin-bottom: 12px;
}
.item-lead .item-type { margin-bottom: 0; }
.item-lead .item-author { margin-bottom: 0; }
.item-lead .lead-photo {
  width: 100%;
  height: 380px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 22px;
  transition: transform .6s ease;
}
.item-lead:hover .lead-photo { transform: scale(1.005); }
.item-lead h3 {
  font-size: 46px;
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 20ch;
  margin-bottom: 16px;
}
.item-lead .item-body {
  font-size: 18.5px;
  max-width: 56ch;
  line-height: 1.6;
}

/* tier 2: standard item w/ right-side thumb */
.item-with-thumb { grid-template-columns: 110px 1fr 200px; }
.item-thumb {
  width: 200px; height: 130px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  align-self: start;
  transition: transform .5s ease;
}
.item-with-thumb:hover .item-thumb { transform: scale(1.012); }
@media (max-width: 720px) {
  .item-with-thumb { grid-template-columns: 1fr; }
  .item-thumb { width: 100%; height: 200px; }
}

/* tier 3: compact (polls, brief social posts) */
.item-compact {
  padding: 16px 0;
  grid-template-columns: 110px 1fr 120px;
}
.item-compact h3 { font-size: 17px; margin-bottom: 4px; }
.item-compact .item-body { font-size: 13.5px; margin-bottom: 8px; max-width: 60ch; }
.item-compact .item-thumb { width: 120px; height: 80px; }
.item-compact .item-type { font-size: 12px; }
.item-compact .item-author img { width: 20px; height: 20px; }
.item-compact.no-thumb { grid-template-columns: 110px 1fr; }
@media (max-width: 720px) {
  .item-compact { grid-template-columns: 1fr; }
  .item-compact .item-thumb { display: none; }
}

/* photo cluster: a self-contained block, not a row inside .item */
.item-photo-cluster {
  display: block !important;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}
.item-photo-cluster::after {
  content: "";
  display: block;
  clear: both;
}
.item-photo-cluster .item-photo-cluster-head {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 28px;
  margin-bottom: 18px;
}
@media (max-width: 720px) {
  .item-photo-cluster .item-photo-cluster-head { grid-template-columns: 1fr; }
}
.photo-cluster {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 150px 150px;
  gap: 6px;
}
.photo-cluster img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
}
.photo-cluster img:nth-child(1) {
  grid-row: 1 / 3;
  height: auto;
  border-radius: var(--radius);
}

/* event date strip used inside an item */
.event-when {
  display: flex; gap: 16px; align-items: center;
  margin: 14px 0;
  padding: 12px 18px;
  background: var(--paper-2);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--ink-2);
  width: fit-content;
  font-family: 'Times New Roman', serif;
  font-style: italic;
}
.event-date {
  font-size: 12px;
  line-height: 1;
  text-align: center;
  color: var(--ink-2);
  font-style: normal;
}
.event-date strong {
  display: block;
  font-size: 28px; font-weight: 400;
  margin-bottom: 2px;
  font-family: 'Times New Roman', serif;
}

/* drop-in callout in the stream -- subtle warm panel */
.item-dropin {
  background: var(--paper-2);
  border-radius: var(--radius);
  border: none;
  padding: 30px 32px;
  margin: 28px 0;
  grid-template-columns: 1fr;
  box-shadow: 0 1px 1px rgba(0,0,0,.02);
}
.item-dropin .item-meta-col { display: none; }
.item-dropin h3 { font-size: 30px; }
.item-dropin .item-type { color: var(--ink-2); margin-bottom: 8px; }
.item-dropin .item-body { color: var(--ink-2); font-size: 16px; max-width: 64ch; }
.item-dropin .item-foot a { color: var(--ink-soft); }
.item-dropin .item-foot a:hover { color: var(--ink); }

/* Narrow-container variants: when the stream container is too narrow
   for the 110px meta column + content (+200px thumb), reflow into a
   tight "card-like" layout: meta strip on top, title with the heart
   to its right, image as a thumbnail close to the title, then body.
   Driven by the container's width so the same items work inside the
   wide stream page and the narrower staff-homepage middle column.

   Implementation: items that have a sibling .item-meta-col plus an
   unclassed content wrapper get the wrapper flattened with
   display:contents, so h3 / body / item-foot / event-when / poll
   options become direct grid items of .item. We then place them via
   grid-template-areas. Items with a different inner structure
   (photo cluster, dropin) keep their own layouts. */
@container stream (max-width: 600px) {
  .item:has(> .item-meta-col) > div:has(> h3) { display: contents; }

  .item {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "meta  meta"
      "title foot"
      "thumb thumb"
      "chip  chip"
      "body  body"
      "extras extras";
    gap: 8px 12px;
    padding: 22px 0;
  }
  .item-meta-col {
    grid-area: meta;
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 6px 14px;
    margin-bottom: 2px;
  }
  .item-meta-col > * { margin: 0; }
  .item-author { margin-bottom: 0; }
  .item h3 { grid-area: title; font-size: 22px; margin-bottom: 0; }
  .item-foot {
    grid-area: foot;
    align-self: start;
    margin: 0;
    gap: 8px;
  }
  /* On narrow the foot row carries the heart only; hide secondary
     links / text so it doesn't compete with the title. */
  .item-foot > :not(.heart-form) { display: none; }

  .item-with-thumb { grid-template-columns: minmax(0, 1fr) auto; }
  .item-thumb {
    grid-area: thumb;
    /* Render as a thumbnail rather than a full-bleed image: stays
       chunky enough to read but doesn't dominate the card. */
    width: 100%;
    max-width: 260px;
    height: 170px;
    margin-bottom: 0;
    justify-self: start;
  }
  .item-body { grid-area: body; margin-bottom: 0; }
  .ysd-stream-block { grid-area: extras; margin: 6px 0; }

  /* Event variant: pair the date chip with the image in one row.
     If there's no image, the chip spans the row by itself. */
  .item-event {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "meta  meta"
      "title foot"
      "chip  thumb"
      "body  body";
  }
  .item-event .event-when {
    grid-area: chip;
    margin: 0;
    align-self: stretch;
    align-items: center;
  }
  /* Event thumb fills the row column and sits a bit deeper than the
     news/opportunity thumb -- ~25% more height for a stronger image. */
  .item-event .item-thumb {
    width: 100%;
    max-width: none;
    height: auto;
    aspect-ratio: 4 / 3;
    align-self: stretch;
    justify-self: stretch;
  }
  .item-event:not(.item-with-thumb) .event-when { grid-column: 1 / -1; }

  .item-compact { grid-template-columns: 1fr; }
  .item-compact.no-thumb { grid-template-columns: 1fr; }
  .item-compact .item-thumb { display: none; }

  .item-lead { padding: 28px 0 30px; }
  .item-lead .lead-photo {
    grid-area: thumb;
    height: 220px;
    margin-bottom: 0;
  }
  .item-lead h3 { font-size: 30px; }
  .item-lead .item-body { font-size: 16.5px; }

  .item-photo-cluster .item-photo-cluster-head {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 14px;
  }
  .photo-cluster {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 110px 110px;
  }
  .photo-cluster img:nth-child(1) { grid-row: 1 / 2; }

  .item-dropin { padding: 22px 20px; margin: 20px 0; }
  .item-dropin h3 { font-size: 22px; }

  .item-poll h3 { font-size: 22px; margin-bottom: 8px; }
}

/* Poll stream item: keep it minimal -- just title + options. The
   meta strip and body copy are hidden, and the heart only appears
   once the user has voted (signalled by the .poll-results class on
   the swapped-in partial). Applies at all widths so polls feel
   consistent across desktop and mobile.

   Polls also opt out of the .item two-column grid (110px meta + 1fr
   content): with .item-meta-col hidden the desktop grid would leave
   a 110px empty gutter on the left. Drop the grid and let title +
   options stack naturally; the inner wrapper is returned to block
   flow so its children don't escape into the (now non-existent)
   parent grid. */
.item-poll {
  display: block;
  grid-template-areas: none;
}
.item-poll > div:has(> h3) { display: block; }
.item-poll .item-meta-col,
.item-poll .item-body { display: none; }
.item-poll .item-foot { display: none; }
.item-poll:has(.poll-results) .item-foot { display: flex; }

/* poll item */
.poll-options {
  display: flex; flex-direction: column; gap: 6px;
  margin: 14px 0; max-width: 480px;
}
.poll-option {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: transparent;
  font-size: 14px;
  transition: border-color .15s;
}
label.poll-option { cursor: pointer; }
label.poll-option:hover { border-color: var(--ink-soft); }
.poll-results .poll-option {
  cursor: default;
  opacity: 0.55;
  border-color: var(--line-soft);
}
.poll-results .poll-option.voted {
  opacity: 1;
}
.poll-bar {
  margin-left: auto;
  margin-right: 3px;
  width: 80px; height: 2px;
  background: var(--line-soft);
  border-radius: 1px; overflow: hidden;
}
.poll-bar > span { display: block; height: 100%; background: var(--ink-2); }
.poll-meta {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 8px;
}
.poll-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  max-width: 480px;
}
.poll-action-link {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  font-size: 11.5px;
  color: var(--ink-quiet);
  text-decoration: none;
  cursor: pointer;
  line-height: 1.5;
  transition: color .12s, border-color .12s, background .12s;
}
.poll-action-link:hover {
  color: var(--ink);
  border-color: var(--ink-soft);
  background: var(--paper-2);
  text-decoration: none;
}
.poll-option.voted {
  border-color: #ff6f61;
  background: color-mix(in srgb, #ff6f61 12%, transparent);
}
.poll-your-vote {
  margin-left: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #c64a3f;
}
.poll-voters-view { gap: 14px; }
.poll-voters-group { padding: 0; }
.poll-voters-group-label {
  font-size: 14px;
  margin: 0 0 4px;
  font-weight: 500;
}
.poll-voters-list {
  list-style: none;
  padding: 0 0 0 18px;
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}
.poll-voters-list li { padding: 1px 0; }
.poll-voters-empty {
  font-size: 13px;
  color: var(--ink-soft);
  padding-left: 18px;
  margin: 0;
  font-style: italic;
}


/* homepage rail-only widgets */
.timetable-cta {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--plymouth-azure);
  border-radius: var(--radius-sm);
  color: var(--ink);
  text-decoration: none;
  margin-bottom: 14px;
  transition: border-color .15s, background .15s, transform .15s;
}
.timetable-cta:hover {
  text-decoration: none;
  background: var(--paper);
  border-color: var(--ink-soft);
  border-left-color: var(--plymouth-azure-deep);
  transform: translateY(-1px);
}
.timetable-cta-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--plymouth-azure) 12%, var(--paper));
  color: var(--plymouth-azure);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.timetable-cta-text strong {
  display: block;
  font-family: 'Times New Roman', serif;
  font-size: 15.5px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 1px;
}
.timetable-cta-text span {
  font-family: 'Times New Roman', serif;
  font-style: italic;
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.35;
  display: block;
}
.timetable-cta-arrow { color: var(--ink-soft); flex-shrink: 0; }
.timetable-cta:hover .timetable-cta-arrow { color: var(--ink); }

.tutor-card {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}
.tutor-card img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.tutor-card strong {
  display: block;
  font-size: 15px; font-weight: 500;
  font-family: 'Times New Roman', serif;
}
.tutor-card span {
  color: var(--ink-quiet); font-size: 13px;
  font-family: 'Times New Roman', serif; font-style: italic;
}

.moments {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
}
.moments img {
  width: 100%; aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  transition: transform .35s, opacity .25s;
  opacity: 0.95;
}
.moments img:hover { transform: scale(1.04); opacity: 1; }
.moments-thumb { display: block; line-height: 0; }

/* moment upload form in the right rail */
.moment-upload-wrap { margin-top: 10px; }
.moment-upload {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
  font-size: 13px;
}
.moment-upload-file {
  grid-column: 1 / -1;
  cursor: pointer;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--ink-soft);
  text-align: center;
  transition: border-color .15s, color .15s;
}
.moment-upload-file:hover { border-color: var(--ink-soft); color: var(--ink); }
.moment-upload-file input[type="file"] { display: none; }
.moment-upload-file.has-file {
  border-style: solid;
  border-color: var(--kelp);
  color: var(--kelp);
}
.moment-upload-file .moment-upload-cta {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.moment-upload input[type="text"] {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font: inherit;
  font-size: 13px;
}
.moment-upload button {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.moment-upload button:hover { background: var(--paper-2); border-color: var(--ink-soft); }
.moment-upload-error {
  grid-column: 1 / -1;
  color: var(--plymouth-red);
  font-size: 12px;
  margin: 0;
}
.moment-thanks {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--ink-soft);
}
.moment-thanks strong { display: block; color: var(--ink); margin-bottom: 2px; }

/* moments curation page */
.moments-curate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.moments-curate-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
.moments-curate-card input[type="checkbox"] {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  width: 20px; height: 20px;
}
.moments-curate-card img {
  width: 100%; aspect-ratio: 1; object-fit: cover; display: block;
}
.moments-curate-card:has(input:checked) { outline: 3px solid var(--kelp); }
.moments-curate-meta { padding: 8px 10px; font-size: 13px; }
.moments-curate-meta strong { display: block; }
.moments-curate-meta span { color: var(--ink-quiet); font-size: 12px; }
.moments-curate-meta p { margin: 4px 0 0; font-style: italic; color: var(--ink-soft); }
.moments-curate-publish {
  margin-top: 20px; display: grid; gap: 10px;
}
.moments-curate-publish label { display: grid; gap: 4px; font-size: 13px; color: var(--ink-soft); }
.moments-curate-publish input[type="text"],
.moments-curate-publish textarea {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px 10px; font: inherit; font-size: 14px; color: var(--ink);
}
.moments-curate-actions { display: flex; gap: 10px; margin-top: 8px; }
.moments-curate-actions button {
  border: 1px solid var(--line); background: var(--card);
  border-radius: var(--radius-sm); padding: 8px 14px;
  font: inherit; cursor: pointer;
}
.moments-curate-actions button[value="publish"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.moments-curate-actions .btn-secondary { color: var(--plymouth-red); }

/* lightbox styling is inline in static/hub/lightbox.js */

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.quick-action {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 13px;
  text-align: left;
  color: var(--ink);
  line-height: 1.3;
  transition: border-color .15s, transform .15s;
  text-decoration: none;
  display: block;
}
.quick-action:hover {
  border-color: var(--ink-soft);
  transform: translateY(-1px);
  text-decoration: none;
}
.quick-action span {
  display: block;
  color: var(--ink-quiet);
  font-size: 11px;
  margin-top: 3px;
  font-style: italic;
  font-family: 'Times New Roman', serif;
}


/* =====================================================================
   13. PRACTICE
   ===================================================================== */

/* ---- stream detail page ---- */
.stream-detail-article {
  display: block;
  max-width: 70ch;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 36px 44px 40px;
  margin-bottom: 32px;
  border-top: 1px solid var(--line);
}
@media (max-width: 700px) {
  .stream-detail-article { padding: 24px 22px 28px; border-radius: 12px; }
}
.stream-detail-article .page-hero-crumb { margin-bottom: 4px; }
.stream-detail-article .lead-photo {
  display: block;
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius);
  margin: 12px 0 20px;
}
.stream-detail-headline {
  font-family: 'Source Serif 4', 'Times New Roman', serif;
  font-variation-settings: "opsz" 60;
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 4px 0 12px;
  overflow-wrap: anywhere;
  hyphens: auto;
}
@media (max-width: 700px) {
  .stream-detail-headline { font-size: 35px; }
}
.stream-detail-rail {
  position: sticky; top: 84px;
  align-self: start;
  margin-top: 24px;
}
@media (max-width: 960px) {
  .stream-detail-rail { position: static; top: auto; }
}

.event-detail-meta {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 20px;
  row-gap: 6px;
  align-items: baseline;
  margin: 18px 0 24px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.event-detail-meta dt {
  color: var(--ink-quiet);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}
.event-detail-meta dd {
  margin: 0;
  color: var(--ink);
  font-size: 15.5px;
  line-height: 1.5;
}
.event-detail-meta dd a { word-break: break-word; }

/* ---- task detail page ---- */

/* band hero: a thin photo strip used on second-level pages. No content
   overlaps it (no negative margin-bottom). Crops the image hard so it
   reads as abstract texture rather than a literal photo. */
.page-hero.page-hero-band {
  height: calc(180px + var(--topnav-h));
  margin-bottom: 0;
}
.page-hero.page-hero-band .page-hero-inner {
  padding: var(--topnav-h) var(--container-pad) 22px;
  justify-content: flex-end;
  padding-bottom: 22px;
}
.page-hero.page-hero-band h1 {
  font-size: 40px;
  margin: 4px 0 0;
}
.page-hero.page-hero-band::after {
  background: linear-gradient(
    180deg,
    rgba(0,0,0,0.10) 0%,
    rgba(0,0,0,0.40) 65%,
    rgba(0,0,0,0.65) 100%
  );
}
@media (max-width: 720px) {
  .page-hero.page-hero-band { height: 140px; }
  .page-hero.page-hero-band h1 { font-size: 30px; }
  .page-hero.page-hero-band .page-hero-inner { padding: 0 var(--container-pad-sm) 16px; }
}

.practice-task-page .grid { margin-top: 40px; }
.practice-task-crumb {
  font-family: 'Times New Roman', serif;
  font-style: italic;
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 12px;
}
.practice-task-crumb a { color: var(--ink-soft); }
.practice-task-crumb a:hover { color: var(--ink); }
.practice-task-meta {
  display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap;
  margin-bottom: 24px;
}
.practice-task-duration {
  font-size: 13px; color: var(--ink-soft);
  font-family: 'Helvetica Neue', sans-serif;
}
.practice-task-prose {
  font-family: 'Times New Roman', serif;
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink);
  max-width: 64ch;
}
.practice-task-prose p { margin: 0 0 18px; }
.practice-task-rail {
  position: sticky; top: 84px;
  align-self: start;
  margin-top: 0;
}
.upload-panel-small {
  padding: 22px 24px !important;
  box-shadow: 0 1px 1px rgba(0,0,0,.02), 0 8px 24px rgba(20,20,30,.08) !important;
}
.upload-panel-small h2 { font-size: 20px !important; margin: 4px 0 4px; }
.upload-panel-small .upload-lede { font-size: 13.5px; margin-bottom: 14px; }
.upload-panel-small textarea { min-height: 140px; }
.upload-panel-small .upload-tab { padding: 8px 10px; font-size: 13px; }
.upload-panel-small .upload-foot { flex-direction: column; align-items: stretch; gap: 8px; }
.upload-panel-small .upload-cta { width: 100%; }
@media (max-width: 960px) {
  .practice-task-rail { position: static; top: auto; }
  .practice-task-page .grid { margin-top: 36px; }
}

/* Hero-overlap layout: the action card (upload panel on practice, ask
   card on support) sits inside the left column of the grid -- not full
   width -- so the right column beside it stays clear of the hero photo.
   The hero keeps its -120px margin-bottom so the card can overlap on
   the left only; we push the grid down to compensate so the rail
   starts below the hero, then pull just the card up into the photo. */
.practice-page .grid,
.calendar-page .grid { margin-top: 100px; }

.support-page .support-row1 { margin-top: 156px; }

.practice-page .grid > div > #practice-submitter,
.practice-page .grid > div > .upload-panel,
.calendar-page .grid > section.cal-listing {
  margin-top: -120px;
}
.support-page .support-row1 > div > .ask-card,
.support-page .support-row1 > .handbook-card {
  margin-top: -120px;
}
.practice-page .grid > div > #practice-submitter > .upload-panel,
.practice-page .grid > div > .upload-panel,
.calendar-page .grid > section.cal-listing {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}
.support-page .support-row1 > div > .ask-card {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}
.practice-page .grid > div > #practice-submitter,
.calendar-page .grid > section.cal-listing { margin-bottom: 36px; }

/* Practice: let the photo show through the upload card subtly. */
.practice-page .upload-panel {
  background: color-mix(in srgb, var(--card) 90%, transparent);
  backdrop-filter: blur(8px);
}

/* Calendar: events listing floats as a card overlapping the hero (left column only). */
.calendar-page .grid > section.cal-listing {
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: 0 1px 1px rgba(0,0,0,.02), 0 18px 50px rgba(20,20,30,.10);
  position: relative;
  z-index: 5;
}
@media (max-width: 720px) {
  .calendar-page .grid > section.cal-listing { padding: 22px; }
}

@media (max-width: 960px) {
  .practice-page .grid,
  .calendar-page .grid { margin-top: 80px; }
  .support-page .support-row1 { margin-top: 120px; }
  .practice-page .grid > div > #practice-submitter,
  .practice-page .grid > div > .upload-panel { margin-top: -120px; }
  .support-page .support-row1 > div > .ask-card,
  .support-page .support-row1 > .handbook-card { margin-top: -120px; }
}
@media (max-width: 720px) {
  .practice-page .grid,
  .calendar-page .grid { margin-top: 50px; }
  .support-page .support-row1 { margin-top: 90px; grid-template-columns: 1fr; }
  .practice-page .grid > div > #practice-submitter,
  .practice-page .grid > div > .upload-panel { margin-top: -90px; }
  .support-page .support-row1 > div > .ask-card { margin-top: -90px; }
  .support-page .support-row1 > .handbook-card { margin-top: 0; }
}

/* record-detail page: feedback on the left, the student's submission on
   the right, in a 2:1 split. */
.practice-record-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 40px;
  margin-top: 36px;
  align-items: start;
}
.practice-record-feedback { min-width: 0; }
.practice-record-submission { min-width: 0; }
.practice-record-submission .submission-panel { margin-bottom: 24px; }
.practice-record-submission pre {
  white-space: pre-wrap;
  font-family: 'Times New Roman', serif;
  font-size: 14.5px;
  line-height: 1.55;
  margin: 8px 0 0;
}
.practice-record-meta h3 {
  font-size: 14px; font-weight: 500;
  margin: 0 0 6px;
  color: var(--ink-soft);
}
.practice-record-meta ul {
  list-style: none; padding: 0; margin: 0;
  color: var(--ink-quiet); font-size: 13px;
}

.submission-body {
  position: relative;
  max-height: 70vh;
  overflow: hidden;
}
.submission-body[data-expanded="true"] { max-height: none; }
.submission-body:not([data-expanded="true"])::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 80px;
  background: linear-gradient(to bottom, rgba(255,255,255,0), var(--paper, #fff));
  pointer-events: none;
}
.submission-toggle {
  background: none; border: none;
  color: var(--ink-soft);
  font-family: 'Helvetica Neue', Helvetica, sans-serif;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 10px 0 0;
  margin-top: 4px;
  cursor: pointer;
  transition: color .15s;
}
.submission-toggle:hover { color: var(--ink); }

@media (max-width: 960px) {
  .practice-record-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* upload panel header / body */
.upload-head {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  margin-bottom: 6px;
}
.upload-panel h2 {
  font-size: 28px;
  margin: 4px 0 6px;
}
.upload-lede {
  color: var(--ink-soft);
  font-size: 15px;
  margin: 0 0 18px;
  max-width: 64ch;
}

/* input mode tabs */
.upload-tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.upload-tab {
  background: none; border: none;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  font-family: 'Helvetica Neue', sans-serif;
}
.upload-tab:hover { color: var(--ink); }
.upload-tab[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.upload-pane { margin-bottom: 18px; }
.upload-pane textarea {
  width: 100%;
  min-height: 160px;
  padding: 14px 16px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  resize: vertical;
  line-height: 1.55;
}
.upload-pane textarea:focus {
  outline: none; border-color: var(--ink-soft);
}

.upload-drop {
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 10px;
  padding: 36px 20px;
  background: var(--paper);
  border: 1px dashed var(--ink-quiet);
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, background .15s;
}
.upload-drop:hover {
  border-color: var(--ink-soft);
  background: var(--paper-2);
}
.upload-drop svg { color: var(--ink-soft); }
.upload-drop strong {
  color: var(--ink);
  font-family: 'Times New Roman', serif;
  font-weight: 500;
  font-size: 16px;
}
.upload-drop small {
  color: var(--ink-quiet);
  font-size: 12.5px;
}

.record-zone {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 28px 24px;
  text-align: center;
}
.record-btn {
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.record-btn:hover { background: var(--ink-2); transform: translateY(-1px); }
.record-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--plymouth-red);
}
.record-hint {
  color: var(--ink-soft);
  font-size: 13.5px;
  font-family: 'Times New Roman', serif;
  font-style: italic;
  margin: 12px 0 0;
}

.upload-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
@media (max-width: 720px) {
  .upload-options { grid-template-columns: 1fr; }
}
.upload-options label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
}
.upload-options select {
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  padding: 8px 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}
.upload-options select:focus { outline: none; border-color: var(--ink-soft); }

.upload-foot {
  display: flex; align-items: center; gap: 18px;
  flex-wrap: wrap;
}
.upload-cta {
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background .15s, transform .15s, opacity .15s;
}
.upload-cta:hover:not(:disabled) {
  background: var(--ink-2);
  transform: translateY(-1px);
}
.upload-cta:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.upload-meta {
  color: var(--ink-soft);
  font-size: 13px;
  font-family: 'Times New Roman', serif;
  font-style: italic;
}

/* feedback result panel under the upload */
.feedback-result {
  margin-top: 24px;
  padding: 22px 24px;
  border-top: 2px solid var(--ink);
  background: linear-gradient(180deg, var(--paper-2) 0%, transparent 60%);
  border-radius: var(--radius-sm);
  animation: fade-up .35s ease both;
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.feedback-result h3 { font-size: 20px; margin-bottom: 4px; }
.feedback-result h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
  margin: 16px 0 8px;
  font-family: 'Helvetica Neue', sans-serif;
  font-weight: 600;
}
.feedback-bullets { list-style: none; padding: 0; margin: 0; }
.feedback-bullets li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.55;
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
}
.feedback-bullets li:last-child { border-bottom: none; }
.feedback-bullets li::before {
  content: "•";
  color: var(--rockpool);
  font-weight: 700;
}
.feedback-foot {
  display: flex; gap: 16px; margin-top: 14px;
  font-size: 13px;
}
.feedback-foot a { color: var(--ink-soft); }
.feedback-foot a:hover { color: var(--ink); }
.feedback-loading {
  margin-top: 22px;
  display: flex; align-items: center; gap: 12px;
  color: var(--ink-soft);
  font-style: italic;
  font-family: 'Times New Roman', serif;
}
.pulse {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--rockpool);
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}


/* practice activities (browse) */
.activities { margin-top: 56px; }
.activities-head {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 14px;
  margin-bottom: 18px;
}

.year-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.year-tab {
  background: none; border: 1px solid var(--line);
  color: var(--ink-soft);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-family: 'Helvetica Neue', sans-serif;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.year-tab:hover { color: var(--ink); border-color: var(--ink-soft); }
.year-tab[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.year-tab.your-year:not([aria-pressed="true"]) {
  border-color: var(--rockpool);
  color: var(--rockpool);
}

.activity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}
.activity-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color .2s, transform .25s, box-shadow .2s;
  color: inherit;
  text-decoration: none;
}
.activity-card:hover {
  border-color: var(--ink-soft);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(20,20,30,.08);
  color: inherit;
  text-decoration: none;
}
.activity-card .activity-start {
  color: var(--ink);
  font-weight: 500;
}
.activity-card:hover .activity-start { color: var(--rockpool); }
.activity-card.card-current { border-color: var(--rockpool); }
.activity-card-img {
  width: 100%; aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}
.activity-card-body {
  padding: 16px 18px 18px;
  display: flex; flex-direction: column; gap: 8px;
  flex: 1;
}
.activity-meta {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}
.activity-year {
  font-family: 'Times New Roman', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--ink-soft);
}
.activity-year.current {
  color: var(--rockpool);
  font-style: normal;
  font-weight: 500;
  font-family: 'Helvetica Neue', sans-serif;
  text-transform: uppercase;
  font-size: 11.5px;
  letter-spacing: 0.14em;
}
.activity-card h3 {
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.activity-brief {
  color: var(--ink-soft);
  font-size: 13.5px;
  margin: 0;
  line-height: 1.5;
}
.activity-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
  font-size: 13px;
  color: var(--ink-soft);
}
.activity-foot a {
  color: var(--ink);
  font-weight: 500;
}
.activity-foot a:hover { color: var(--ink-2); }

.activities-empty {
  color: var(--ink-soft);
  font-style: italic;
  font-family: 'Times New Roman', serif;
  padding: 32px 0;
  text-align: center;
  grid-column: 1 / -1;
}

/* practice rail history list */
.history-list { list-style: none; padding: 0; margin: 0; }
.history-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
}
.history-list li:last-child { border-bottom: none; }
.history-item {
  display: block;
  color: var(--ink);
  text-decoration: none;
}
.history-item:hover { color: var(--ink-2); text-decoration: none; }
.history-item:hover .history-task { text-decoration: underline; }
.history-item-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  justify-content: space-between;
}
.history-task {
  font-weight: 500;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.3;
  /* Long task names truncate -- the summary line below carries the
     specifics; keep the head a single line for scannability. */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}
.history-when {
  flex-shrink: 0;
  font-family: 'Times New Roman', serif;
  font-style: italic;
  font-size: 12px;
  color: var(--ink-quiet);
}
.history-summary {
  display: block;
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-style: italic;
  font-family: 'Times New Roman', serif;
  /* Two-line clamp keeps the rail tidy when the LLM produces a long
     one-line summary. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* theme tags -- shared between practice activities and support-guides */
.theme-tag {
  display: inline-block;
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-2);
  line-height: 1.6;
}
.theme-tag.studying   { background: rgba(58,122,77,.12);   color: var(--kelp); }
.theme-tag.thinking   { background: rgba(31,141,153,.12);  color: var(--rockpool); }
.theme-tag.writing    { background: var(--paper-2);        color: var(--ink-2); }
.theme-tag.speaking   { background: rgba(0,93,172,.10);    color: var(--plymouth-azure); }
.theme-tag.growth     { background: rgba(239,221,144,.45); color: var(--ink-2); }
.theme-tag.assessment { background: rgba(217,52,38,.08);   color: var(--plymouth-red); }
@media (prefers-color-scheme: dark) {
  .theme-tag.writing { background: rgba(255,255,255,.05); color: var(--ink-2); }
}


/* =====================================================================
   14. SUPPORT
   ===================================================================== */

/* ask card -- the RAG entry point. Sits inside .surface-card. */
.ask-card { padding: 32px 36px 28px; }
@media (max-width: 720px) {
  .ask-card { padding: 24px 22px; }
}
.ask-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.ask-head h2 { font-size: 30px; font-weight: 400; }
.ask-head h2 em {
  font-family: 'Times New Roman', serif;
  font-style: italic;
  color: var(--ink-quiet);
  font-size: 22px;
  margin-left: 4px;
}
.ask-blurb {
  color: var(--ink-soft);
  font-size: 14.5px;
  max-width: 60ch;
  margin: 0;
  font-family: 'Times New Roman', serif;
  font-style: italic;
}

.ask-input-wrap {
  position: relative;
  margin: 18px 0 14px;
}
.ask-input {
  width: 100%;
  background: var(--answer-bg);
  border: 1.5px solid var(--answer-border);
  border-radius: 999px;
  padding: 16px 60px 16px 52px;
  font-size: 16px;
  color: var(--ink);
  font-family: 'Helvetica Neue', sans-serif;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.ask-input::placeholder {
  color: var(--ink-soft);
  font-style: italic;
  font-family: 'Times New Roman', serif;
  font-size: 16px;
}
.ask-input:focus {
  outline: none;
  border-color: var(--focus-ring);
  background: var(--card);
  box-shadow: 0 0 0 3px rgba(26, 111, 196, 0.18);
}
.ask-input-icon {
  position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
  color: var(--focus-ring);
  pointer-events: none;
}
.ask-submit {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: var(--focus-ring);
  color: var(--paper);
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px;
  transition: background .15s;
}
.ask-submit:hover { background: #155aa0; }
.ask-ai-badge {
  position: absolute;
  right: 84px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--focus-ring);
  background: var(--paper);
  border: 1px solid var(--answer-border);
  border-radius: 999px;
  padding: 3px 8px;
  pointer-events: none;
  text-transform: uppercase;
}

.ask-suggestions {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}
.ask-suggestions > li { list-style: none; margin: 0; padding: 0; }
.ask-pill {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  color: var(--ink-soft);
  font-size: 13px;
  font-family: 'Times New Roman', serif;
  font-style: italic;
  transition: border-color .15s, color .15s, background .15s;
}
.ask-pill:hover {
  border-color: var(--ink-soft);
  color: var(--ink);
  background: var(--paper);
  text-decoration: none;
}

.ask-sample {
  margin-top: 22px;
  padding: 18px 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--ink-2);
}
.ask-answer-prose {
  background: var(--answer-bg);
  border: 1px solid var(--answer-border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 10px 0 14px;
}
.ask-answer-prose p:last-child { margin-bottom: 0; }
.ask-stream-body { font-family: inherit; }
.ask-thinking {
  display: flex; align-items: center; gap: 8px;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 13.5px;
}
.ask-sample-q {
  font-family: 'Times New Roman', serif;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 13.5px;
  margin-bottom: 6px;
}
.ask-sample p { margin: 0 0 8px; }
.ask-sample p:last-child { margin-bottom: 0; }
.ask-cite {
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 11px;
  color: var(--plymouth-azure);
  background: var(--paper-2);
  border-radius: 999px;
  padding: 1px 7px;
  margin: 0 1px;
  text-decoration: none;
  border: 1px solid var(--line);
  vertical-align: 1px;
}
.ask-cite:hover { background: var(--card); text-decoration: none; }
.ask-sample-foot {
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-quiet);
  font-style: italic;
  font-family: 'Times New Roman', serif;
}


/* hub divider (separates Ask from Browse inside the same card) */
.hub-divider {
  margin: 28px -32px 22px;
  padding: 22px 32px 0;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
@media (max-width: 720px) {
  .hub-divider { margin: 22px -20px 18px; padding: 16px 20px 0; }
}
.hub-divider-label {
  font-family: 'Times New Roman', serif;
  font-style: italic;
  color: var(--ink-quiet);
  font-size: 14px;
}
.hub-divider-label strong { font-weight: 400; color: var(--ink-2); }


/* handbook browser */
.browse { display: block; }
.browse-cats {
  display: flex; flex-wrap: wrap; gap: 6px;
  list-style: none; padding: 0;
  margin: 0 0 14px;
}
.browse-cats li { display: inline-block; }
.browse-cat {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-family: 'Helvetica Neue', sans-serif;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
  line-height: 1.3;
  text-align: left;
}
.browse-cat:hover { color: var(--ink); border-color: var(--ink-soft); }
.browse-cat[aria-selected="true"] {
  color: var(--paper);
  background: var(--ink);
  border-color: var(--ink);
}
.browse-cat-count {
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 11px;
  color: var(--ink-quiet);
  font-style: normal;
  padding: 1px 6px;
  background: var(--paper-2);
  border-radius: 999px;
}
.browse-cat[aria-selected="true"] .browse-cat-count {
  background: rgba(255,255,255,.18);
  color: var(--paper);
}

.browse-pages {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
@media (max-width: 720px) { .browse-pages { grid-template-columns: 1fr; } }
.browse-page {
  display: block;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  transition: border-color .15s, transform .15s, background .15s;
}
.browse-page:hover {
  border-color: var(--ink-soft);
  background: var(--paper);
  text-decoration: none;
  transform: translateY(-1px);
}
.browse-page-title {
  font-family: 'Times New Roman', serif;
  font-size: 14.5px;
  line-height: 1.25;
  margin-bottom: 2px;
}
.browse-page-meta {
  font-size: 12px;
  color: var(--ink-quiet);
  font-style: italic;
  font-family: 'Times New Roman', serif;
}
.browse-foot {
  grid-column: 1 / -1;
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-soft);
  text-align: right;
}


/* support page section heads */
.section { margin-top: 56px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 18px; gap: 18px;
}
.section-head h2 {
  font-size: 28px; font-weight: 400;
  letter-spacing: -0.01em;
}
.section-head h2 em {
  font-style: italic;
  color: var(--ink-quiet);
  font-size: 18px;
  margin-left: 6px;
}
.section-head .head-link { font-size: 13px; color: var(--ink-soft); }
.section-intro {
  color: var(--ink-soft);
  font-size: 15px;
  max-width: 64ch;
  margin: -6px 0 22px;
}


/* drop-in callouts */
.dropins { display: grid; gap: 14px; }
.dropin {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 22px 24px;
  background: var(--paper-2);
  border-radius: var(--radius);
}
.dropin.is-today {
  background: var(--card);
  border: 1px solid var(--line);
}
.dropin-when {
  font-family: 'Times New Roman', serif;
  color: var(--ink-2);
  line-height: 1.1;
  text-align: center;
}
.dropin-when strong {
  display: block;
  font-size: 32px;
  font-weight: 400;
  margin-bottom: 4px;
}
.dropin-when small {
  font-size: 12px;
  color: var(--ink-quiet);
  font-style: italic;
}
.dropin h3 { font-size: 20px; margin-bottom: 4px; }
.dropin h3 .badge {
  display: inline-block;
  margin-left: 8px;
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--plymouth-red);
  vertical-align: 3px;
}
.dropin-body {
  color: var(--ink-soft);
  font-size: 14px;
  margin: 0;
  max-width: 64ch;
}
.dropin-body strong { color: var(--ink-2); font-weight: 500; }
.dropin-attendees {
  display: flex; align-items: center;
  margin-top: 10px;
}
.dropin-attendees img {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--paper-2);
  margin-right: -8px;
}
.dropin.is-today .dropin-attendees img { border-color: var(--card); }
.dropin-attendees-label {
  font-family: 'Times New Roman', serif;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 13px;
  margin-left: 14px;
}
.dropin-cta {
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 13px;
  transition: background .15s, color .15s;
  text-decoration: none;
}
.dropin-cta:hover {
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}
.dropin-cta-quiet {
  background: transparent; border: none;
  color: var(--ink-soft);
  font-size: 13px;
  padding: 10px 4px;
}
.dropin-cta-quiet:hover { color: var(--ink); }
@media (max-width: 720px) {
  .dropin { grid-template-columns: 1fr; gap: 10px; padding: 18px; }
  .dropin-when { text-align: left; }
}


/* people / book-a-slot cards */
.people-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 720px) { .people-grid { grid-template-columns: 1fr; } }
.person {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 18px;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.person img {
  width: 64px; height: 64px;
  border-radius: 50%;
  object-fit: cover;
}
.person-role {
  font-family: 'Times New Roman', serif;
  font-style: italic;
  color: var(--ink-quiet);
  font-size: 13px;
  margin-bottom: 2px;
}
.person h3 { font-size: 19px; margin-bottom: 6px; }
.person-blurb {
  color: var(--ink-soft);
  font-size: 13.5px;
  margin: 0 0 10px;
}
.person-foot {
  display: flex; gap: 14px;
  font-size: 13px;
}
.person-foot a { color: var(--ink-soft); }
.person-foot a:hover { color: var(--ink); }


/* wellbeing cards */
.wellbeing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 720px) { .wellbeing-grid { grid-template-columns: 1fr; } }
.wellbeing-grid > .wellbeing {
  padding: 22px 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.wellbeing-grid > .wellbeing.crisis {
  border-color: rgba(217,52,38,.35);
  background: var(--card);
}
.wellbeing-tag {
  display: inline-block;
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-quiet);
  margin-bottom: 8px;
}
.wellbeing.crisis .wellbeing-tag { color: var(--plymouth-red); }
.wellbeing h3 { font-size: 19px; margin-bottom: 6px; }
.wellbeing p {
  color: var(--ink-soft); font-size: 14px;
  margin: 0 0 10px;
  max-width: 50ch;
}
.wellbeing-foot {
  display: flex; flex-wrap: wrap; gap: 14px;
  font-size: 13px;
}
.wellbeing-foot a { color: var(--ink-soft); }
.wellbeing-foot a:hover { color: var(--ink); }
.wellbeing-phone {
  color: var(--ink);
  font-family: 'Times New Roman', serif;
  font-size: 15px;
}


/* side-by-side row used to put two sections at half-width */
.row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 880px) {
  .row-2col { grid-template-columns: 1fr; gap: 28px; }
}
.row-2col > section { margin-top: 0; }
.row-2col .wellbeing-grid { grid-template-columns: 1fr; gap: 12px; }


/* support page featured guides: magazine row of vertical cards. */
.guidance-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
@media (max-width: 1080px) { .guidance-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .guidance-grid { grid-template-columns: 1fr; } }

.guidance-card {
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  transition: border-color .2s, transform .25s, box-shadow .2s;
  height: 100%;
}
.guidance-card:hover {
  border-color: var(--ink-soft);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(20,20,30,.08);
  text-decoration: none;
}
.guidance-card-img {
  width: 100%; aspect-ratio: 4 / 3;
  object-fit: cover; display: block;
}
.guidance-card-img--blank {
  background:
    linear-gradient(135deg, var(--line-soft) 0%, var(--card) 60%);
}
.guidance-card-body {
  padding: 14px 16px 16px;
  display: flex; flex-direction: column; gap: 4px;
  flex: 1;
}
.guidance-card .guide-card-tag {
  margin-bottom: 2px;
}
.guidance-card h3 {
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -0.005em;
  margin: 2px 0 6px;
}
.guidance-card-foot {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px;
  font-size: 12.5px;
  color: var(--ink-soft);
  font-family: 'Times New Roman', serif;
  font-style: italic;
}
.guidance-card .guide-card-author {
  color: var(--ink-2);
  font-weight: 500;
  font-style: normal;
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 12px;
}
.guidance-card .guide-card-meta {
  color: var(--ink-quiet);
}


/* support rail extras */
.crisis-box {
  padding: 16px 18px;
  border: 1px solid rgba(217,52,38,.35);
  border-radius: var(--radius-sm);
  background: var(--card);
}
.crisis-box h3 { color: var(--plymouth-red); margin-bottom: 8px; }
.crisis-box ul li {
  display: block;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
}
.crisis-box ul li:last-child { border-bottom: none; }
.crisis-box .num {
  font-family: 'Times New Roman', serif;
  color: var(--ink); font-size: 14.5px;
  display: block;
}
.crisis-box .label {
  color: var(--ink-quiet); font-style: italic;
  font-family: 'Times New Roman', serif; font-size: 12.5px;
}

/* support page: two-row layout */
.support-row1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 28px;
  align-items: start;
}
/* Grid items default to min-width: auto, which lets a wide child (e.g.
   a select2 widget) push the column wider than the track. Reset so the
   ask card and its descendants honour the column width on mobile. */
.support-row1 > * { min-width: 0; }

.handbook-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  min-width: 0;
  position: relative;
  z-index: 5;
  box-shadow: 0 1px 1px rgba(0,0,0,.02), 0 18px 50px rgba(20,20,30,.10);
}
.handbook-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

/* handbook-card: cats stacked on the left, page links on the right */
.handbook-card .browse {
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.handbook-card .browse-cats {
  flex-direction: column;
  flex-wrap: nowrap;
  margin: 0;
  padding-right: 14px;
  border-right: 1px solid var(--line-soft);
  gap: 2px;
}
.handbook-card .browse-cats li {
  display: block;
  border-bottom: none;
  padding: 0;
}
.handbook-card .browse-cat {
  width: 100%;
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  background: transparent;
  font-size: 12.5px;
  justify-content: space-between;
}
.handbook-card .browse-cat:hover {
  background: var(--paper-2);
  border-color: transparent;
  color: var(--ink);
}
.handbook-card .browse-cat[aria-selected="true"] {
  background: var(--paper-2);
  color: var(--ink);
  border-color: transparent;
  font-weight: 600;
}
.handbook-card .browse-cat[aria-selected="true"] .browse-cat-count {
  background: var(--ink-soft);
  color: var(--paper);
}
.handbook-card .browse-pages {
  display: block;
  grid-template-columns: none;
  gap: 0;
}
.handbook-card .browse-page {
  display: block;
  padding: 4px 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
}
.handbook-card .browse-page:hover {
  border: none;
  background: transparent;
  transform: none;
  color: var(--ink);
}
.handbook-card .browse-page-title {
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 0;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}
.handbook-card .browse-page:hover .browse-page-title {
  text-decoration-color: var(--ink-soft);
}
.handbook-card .browse-page-meta { display: none; }
.handbook-card-head h2 {
  font-size: 20px;
  font-weight: 400;
  margin: 0;
}
.handbook-card-head h2 em {
  font-style: italic;
  color: var(--ink-quiet);
  font-size: 14px;
  margin-left: 6px;
}
.handbook-index-link {
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
  flex-shrink: 0;
}
.handbook-index-link:hover { color: var(--ink); }

.support-row2 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 28px;
  align-items: start;
}
@media (max-width: 960px) {
  .support-row2 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .support-row2 { grid-template-columns: 1fr; }
}

.support-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.support-card h3 {
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.support-card-intro {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-bottom: 12px;
}
.support-pill-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.support-card-cta {
  display: inline-block;
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 4px;
}
.support-card-cta:hover { color: var(--ink); }

.support-wellbeing-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
}
.support-wellbeing-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}
.support-wellbeing-list li:last-child { border-bottom: none; }
.support-wellbeing-list li strong { color: var(--ink); }
.support-wellbeing-list li a { color: var(--ink-soft); font-size: 12px; }
.support-wellbeing-list li a:hover { color: var(--ink); }
.support-wellbeing-crisis strong { color: var(--plymouth-red); }

/* handbook: persistent nav + content layout */
.handbook-page { padding-top: 32px; }
.handbook-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
@media (max-width: 880px) {
  .handbook-layout { grid-template-columns: 1fr; gap: 28px; }
}

.handbook-nav {
  position: sticky;
  top: 84px;
  align-self: start;
  font-size: 14px;
}
@media (max-width: 880px) {
  .handbook-nav { position: static; top: auto; }
}
.handbook-nav-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px;
  padding-bottom: 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.handbook-nav-head h2 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  margin: 0;
}
.handbook-nav-home {
  font-size: 12px;
  color: var(--ink-soft);
}
.handbook-nav-home:hover { color: var(--ink); }

.handbook-nav-cat { margin-bottom: 2px; }
.handbook-nav-cat > summary {
  list-style: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
}
.handbook-nav-cat > summary::-webkit-details-marker { display: none; }
.handbook-nav-cat > summary::before {
  content: "›";
  display: inline-block;
  width: 12px;
  margin-right: 4px;
  color: var(--ink-quiet);
  transition: transform .15s;
}
.handbook-nav-cat[open] > summary::before {
  transform: rotate(90deg);
}
.handbook-nav-cat-label { flex: 1; }
.handbook-nav-cat-count {
  font-size: 11px;
  color: var(--ink-quiet);
  font-family: 'Helvetica Neue', sans-serif;
  background: var(--paper-2);
  padding: 1px 7px;
  border-radius: 999px;
}
.handbook-nav-cat ul {
  list-style: none;
  padding: 2px 0 6px 18px;
  margin: 0;
}
.handbook-nav-cat li {
  padding: 3px 0;
}
.handbook-nav-cat li a {
  color: var(--ink-soft);
  font-size: 13.5px;
  text-decoration: none;
  line-height: 1.35;
  display: block;
  padding: 2px 8px 2px 10px;
  border-left: 2px solid transparent;
  margin-left: -10px;
}
.handbook-nav-cat li a:hover {
  color: var(--ink);
  border-left-color: var(--line);
}
.handbook-nav-cat li.active a {
  color: var(--ink);
  font-weight: 600;
  border-left-color: var(--ink);
  background: var(--paper-2);
}

.handbook-content {
  min-width: 0;
  max-width: 70ch;
}
.handbook-content.doc-surface { max-width: none; }
.handbook-content.doc-surface .prose { max-width: 68ch; }
.handbook-content-head { margin-bottom: 24px; }
.handbook-content-head h1 {
  font-size: 36px;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 8px 0 6px;
}
.handbook-crumb {
  font-size: 13px;
  color: var(--ink-quiet);
}
.handbook-crumb a { color: var(--ink-soft); }
.handbook-crumb a:hover { color: var(--ink); }
.handbook-blurb,
.handbook-intro {
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.55;
  margin: 4px 0 0;
}
.handbook-cat-block { margin-top: 36px; }
.handbook-cat-block h2 {
  font-size: 22px;
  font-weight: 400;
  margin-bottom: 10px;
}
.handbook-cat-pages {
  list-style: none;
  padding: 0;
  margin: 0;
}
.handbook-cat-pages li {
  padding: 6px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14.5px;
}
.handbook-cat-pages li:last-child { border-bottom: none; }
.handbook-cat-blurb {
  color: var(--ink-quiet);
  font-style: italic;
}
.handbook-updated {
  margin-top: 32px;
  color: var(--ink-quiet);
  font-size: 13px;
}

.recent-q { font-size: 14px; line-height: 1.45; }
.recent-q .q-text {
  font-family: 'Times New Roman', serif;
  font-style: italic;
  color: var(--ink-2);
}
.recent-q .q-meta,
.rail .q-meta {
  color: var(--ink-quiet);
  font-size: 12px;
  font-family: 'Times New Roman', serif;
  font-style: italic;
  margin-top: 2px;
  margin-left: 0;
}


/* =====================================================================
   15. SUPPORT-GUIDES (magazine listing)
   ===================================================================== */

.theme-filter {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 0 0 22px;
}
.theme-chip {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-family: 'Helvetica Neue', sans-serif;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.theme-chip:hover { color: var(--ink); border-color: var(--ink-soft); }
.theme-chip[aria-pressed="true"] {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}

.guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
@media (max-width: 720px) { .guide-grid { grid-template-columns: 1fr; } }

.guide-card {
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  transition: border-color .2s, transform .25s, box-shadow .2s;
}
.guide-card:hover {
  border-color: var(--ink-soft);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(20,20,30,.08);
  text-decoration: none;
}
.guide-card-img {
  width: 100%; aspect-ratio: 16 / 9;
  object-fit: cover; display: block;
}
.guide-card-body {
  padding: 16px 20px 20px;
  display: flex; flex-direction: column; gap: 6px;
  flex: 1;
}
.guide-card-tag {
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-quiet);
  line-height: 1.6;
}
.guide-card-tag.dissertation  { color: var(--plymouth-azure); }
.guide-card-tag.studying      { color: var(--kelp); }
.guide-card-tag.communication { color: var(--rockpool); }
.guide-card-tag.wellbeing     { color: var(--plymouth-red); }
.guide-card-tag.assessment    { color: var(--ink-2); }
.guide-card-tag.career        { color: var(--plymouth-azure-deep); }
.guide-card-tag.programme     { color: var(--ink-2); }
.guide-card h3 {
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 2px 0 6px;
}
.guide-card-blurb {
  color: var(--ink-soft);
  font-size: 14px;
  margin: 0 0 10px;
  line-height: 1.55;
}
.guide-card-foot {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px;
  color: var(--ink-soft);
  font-family: 'Times New Roman', serif;
  font-style: italic;
}
.guide-card-author {
  color: var(--ink-2);
  font-weight: 500;
  font-style: normal;
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 12.5px;
}
.guide-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--ink-soft);
  font-style: italic;
  font-family: 'Times New Roman', serif;
  padding: 40px 0;
}


/* =====================================================================
   16. CALENDAR / WHAT'S ON

   Sparse listing of school events grouped by week, then day. Reuses
   .filters / .chip / .timetable-cta / .section-label / .rail. Calendar-
   specific bits live here, prefixed .cal- to avoid collisions with
   homepage stream's .event-when / .event-date.
   ===================================================================== */

.cal-intro {
  max-width: 60ch;
  color: var(--ink-soft);
  font-family: 'Times New Roman', Times, serif;
  font-style: italic;
  font-size: 16px;
  margin: 0 0 28px;
}

/* The .filters bar from the homepage already exists; the calendar adds
   only a soft underline to mark it off from the listing below. */
.cal-filterbar { border-bottom: 1px solid var(--line-soft); padding-bottom: 16px; margin-bottom: 8px; }

/* ---- range navigation ---- */
.cal-rangebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 0 18px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 14px;
}
.cal-rangebar-foot {
  border-bottom: none;
  border-top: 1px solid var(--line-soft);
  margin-top: 36px;
  margin-bottom: 0;
  padding: 18px 0 4px;
  justify-content: center;
}
.cal-rangenav {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}
.cal-navbtn {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-soft);
  font-size: 13px;
  text-decoration: none;
  line-height: 1.4;
  transition: background-color 0.12s, color 0.12s, border-color 0.12s;
}
.cal-navbtn:hover {
  color: var(--ink);
  border-color: var(--ink-soft);
  background: var(--card);
  text-decoration: none;
}
.cal-navbtn.cal-today {
  border-color: var(--plymouth-azure);
  color: var(--plymouth-azure);
}
.cal-navbtn.cal-today:hover {
  background: var(--plymouth-azure);
  color: #fff;
  border-color: var(--plymouth-azure);
}
.cal-navbtn.cal-past-link { font-style: italic; }
.cal-range-label {
  font-size: 14px;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.cal-range-label strong {
  color: var(--ink);
  font-weight: 600;
}
.cal-range-tag {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--ink-quiet);
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-quiet);
}
.cal-empty { margin: 16px 0 12px; }
.cal-empty a { color: var(--plymouth-azure); }

/* ---- highlighted "today" event ---- */
.cal-highlight {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin: 0 0 28px;
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 28px;
  align-items: center;
}
.cal-highlight-thumb {
  width: 200px; height: 130px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}
.cal-highlight .label {
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 11.5px; font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--plymouth-red);
  margin-bottom: 10px;
}
.cal-highlight h2 {
  font-size: 26px; font-weight: 400;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.cal-highlight h2 a { color: inherit; text-decoration: none; }
.cal-highlight h2 a:hover { text-decoration: underline; }
.cal-highlight .when {
  font-family: 'Times New Roman', Times, serif;
  font-style: italic;
  color: var(--ink-2);
  font-size: 15px;
}
.cal-highlight p {
  color: var(--ink-soft);
  margin: 8px 0 12px;
  font-size: 14.5px;
  max-width: 60ch;
}
.cal-highlight-actions a {
  color: var(--ink-soft);
  font-size: 13px;
  margin-right: 18px;
}
.cal-highlight-actions a:hover { color: var(--ink); }
@media (max-width: 720px) {
  .cal-highlight { grid-template-columns: 1fr; }
  .cal-highlight-thumb { width: 100%; height: 180px; order: -1; }
}

/* ---- week divider ---- */
/* listing is sparse -- a few events per week -- so weeks need their
   own header to orient. Heavier rule above each week. */
.cal-week-head {
  margin: 36px 0 4px;
  padding-top: 24px;
  border-top: 2px solid var(--ink);
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.cal-week-head:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.cal-week-head h2 {
  font-size: 22px; font-weight: 400;
  letter-spacing: -0.01em;
}
.cal-week-head .week-range {
  font-family: 'Times New Roman', Times, serif;
  font-style: italic;
  font-size: 14px;
  color: var(--ink-quiet);
}
.cal-week-head .week-count {
  margin-left: auto;
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-quiet);
}

/* ---- day grouping ---- */
.cal-day {
  border-top: 1px solid var(--line);
  padding: 24px 0 8px;
}
.cal-day:first-of-type { border-top: none; padding-top: 24px; }
.cal-day-head {
  display: flex; align-items: baseline; gap: 14px;
  margin-bottom: 14px;
}
.cal-day-head .num {
  font-family: 'Times New Roman', Times, serif;
  font-size: 32px;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.cal-day-head .day-name {
  font-family: 'Times New Roman', Times, serif;
  font-style: italic;
  font-size: 18px;
  color: var(--ink-2);
}
.cal-day-head .day-relative {
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-quiet);
  margin-left: auto;
}
.cal-day-head .day-relative.today { color: var(--plymouth-red); }

/* ---- event row ---- */
/* prefixed .cal-event because the homepage stream already uses
   .event-when / .event-date for a different pattern. */
.cal-event {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 22px;
  align-items: start;
  padding: 14px 0;
  border-top: 1px solid var(--line-soft);
}
.cal-event:first-child { border-top: none; padding-top: 4px; }
.cal-event-time {
  font-family: 'Times New Roman', Times, serif;
  font-size: 14.5px;
  color: var(--ink-2);
  line-height: 1.5;
}
.cal-event-time .end {
  color: var(--ink-quiet);
  font-style: italic;
  font-size: 13px;
  display: block;
}
.cal-event-body { min-width: 0; }
.cal-event-body h3 {
  font-size: 18px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.005em;
  margin-bottom: 4px;
}
.cal-event-body h3 a { color: var(--ink); }
.cal-event-body h3 a:hover { color: var(--plymouth-azure); text-decoration: none; }
.cal-event-meta {
  color: var(--ink-soft);
  font-size: 13.5px;
  font-family: 'Times New Roman', Times, serif;
  font-style: italic;
  margin-bottom: 4px;
}
.cal-event-meta .dot { margin: 0 6px; color: var(--ink-quiet); }
.cal-event-blurb {
  color: var(--ink-soft);
  font-size: 14px;
  max-width: 56ch;
  margin-top: 4px;
}
.cal-event-actions {
  display: flex; flex-direction: column; gap: 4px;
  text-align: right;
  font-size: 12.5px;
}
.cal-event-actions a { color: var(--ink-soft); white-space: nowrap; }
.cal-event-actions a:hover { color: var(--ink); }

/* small audience / type tag, lives inside .cal-event h3 */
.cal-tag {
  display: inline-block;
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-quiet);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
  margin-right: 6px;
  vertical-align: 1px;
}
.cal-tag.seminar  { color: var(--plymouth-azure); border-color: var(--plymouth-azure); }
.cal-tag.social   { color: var(--plymouth-red);   border-color: var(--plymouth-red); }
.cal-tag.workshop { color: var(--kelp);            border-color: var(--kelp); }
.cal-tag.dropin   { color: var(--rockpool);        border-color: var(--rockpool); }
.cal-tag.outdoor  { color: var(--kelp);            border-color: var(--kelp); }
.cal-tag.talk     { color: var(--plymouth-azure-deep); border-color: var(--plymouth-azure-deep); }
.cal-tag.deadline { color: var(--plymouth-red);   border-color: var(--plymouth-red); }
.cal-deadline .cal-event-time { font-weight: 500; color: var(--plymouth-red); }

@media (max-width: 720px) {
  .cal-event { grid-template-columns: 1fr; gap: 4px; }
  .cal-event-actions { flex-direction: row; gap: 16px; text-align: left; margin-top: 6px; }
}

/* ---- end-state ---- */
.cal-end-state {
  margin: 48px 0 0;
  padding: 32px 0 0;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--ink-quiet);
  font-family: 'Times New Roman', Times, serif;
  font-style: italic;
  font-size: 15px;
}
.cal-end-state strong {
  display: block;
  font-style: normal;
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

/* ---- subscribe (iCal) block ---- */
.cal-subscribe {
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.cal-subscribe p {
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-family: 'Times New Roman', Times, serif;
  font-style: italic;
  font-size: 13.5px;
  line-height: 1.5;
}
.cal-subscribe-row { display: flex; gap: 8px; align-items: stretch; }
.cal-subscribe-url {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-family: 'Helvetica Neue', monospace;
  font-size: 11.5px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.cal-subscribe-copy {
  background: var(--card);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  width: 34px;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  transition: color .15s, border-color .15s, background .15s;
}
.cal-subscribe-copy:hover { color: var(--ink); border-color: var(--ink-soft); background: var(--paper-2); }
.cal-subscribe-copy .copy-icon-done { display: none; color: var(--kelp, #4a7); }
.cal-subscribe-copy.is-copied .copy-icon { display: none; }
.cal-subscribe-copy.is-copied .copy-icon-done { display: block; }
.cal-subscribe-foot {
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-quiet);
}
.cal-subscribe-foot a { color: var(--ink-soft); }

/* ---- audience pills (rail filter) ---- */
.cal-audience { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.cal-audience-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12.5px;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
}
.cal-audience-pill.on {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}
.cal-audience-pill:hover { color: var(--ink); }
.cal-audience-pill.on:hover { color: var(--paper); }

/* ---- "suggest an event" link ---- */
.cal-suggest {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink-soft);
  font-size: 13.5px;
}
.cal-suggest:hover { color: var(--ink); }
.cal-suggest-note {
  color: var(--ink-quiet);
  font-family: 'Times New Roman', serif;
  font-style: italic;
  font-size: 13px;
  margin: 8px 0 0;
}

/* ============================================================
   Comments (app: comments)
   ============================================================ */
.comments {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.comments-heading {
  font-size: 1.05rem;
  margin: 0 0 0.75rem;
}
.comments-count { color: var(--ink-soft); font-weight: normal; }
.comments-empty { color: var(--ink-soft); font-style: italic; font-size: 0.9rem; }
.comments-list, .comment-replies {
  list-style: none; margin: 0; padding: 0;
}
.comment {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.75rem;
  border-left: 2px solid var(--line);
}
.comment-reply {
  margin-left: 1.5rem;
  border-left-color: var(--line-soft);
  background: var(--paper-2);
}
.comment-removed .comment-text { color: var(--ink-quiet); font-style: italic; }

.comment-meta {
  display: flex; flex-wrap: nowrap; gap: 0.5rem; align-items: center;
  font-size: 0.82rem; color: var(--ink-soft);
  min-height: 1.4rem;
}
.comment-author { font-weight: 600; color: var(--ink); }
.comment-time { color: var(--ink-quiet); }
.comment-badge {
  background: var(--paper-2); color: var(--plymouth-red, #b71c1c);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 0.4rem; font-size: 0.7rem; line-height: 1.4;
}
.comment-text { margin: 0.3rem 0 0; line-height: 1.5; font-size: 0.95rem; }

/* Right-aligned icon button cluster in the meta row */
.comment-actions {
  margin-left: auto;
  display: inline-flex; gap: 2px; align-items: center;
}
.comment-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  padding: 0; margin: 0;
  background: transparent; border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--ink-quiet);
  cursor: pointer;
  transition: color .12s, background .12s, border-color .12s;
}
.comment-icon-btn:hover,
.comment-icon-btn:focus-visible {
  color: var(--ink);
  background: var(--paper-2);
  border-color: var(--line);
  outline: none;
}
.comment-icon-btn-danger:hover,
.comment-icon-btn-danger:focus-visible {
  color: var(--plymouth-red, #b71c1c);
}
.comment-icon-btn svg { display: block; }

.comment-delete-form { display: inline; margin: 0; padding: 0; }

/* Flag popover */
.comment-flag { position: relative; display: inline-block; }
.comment-flag > summary { list-style: none; }
.comment-flag > summary::-webkit-details-marker { display: none; }
.comment-flag[open] > summary { color: var(--ink); background: var(--paper-2); border-color: var(--line); }
.comment-flag-form {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 5;
  display: grid; gap: 0.5rem;
  width: min(20rem, 90vw);
  padding: 0.75rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  font-size: 0.85rem;
}
.comment-flag-form label { display: grid; gap: 0.2rem; }
.comment-flag-form label span { font-size: 0.75rem; color: var(--ink-soft); }
.comment-flag-form select,
.comment-flag-form textarea {
  font: inherit; padding: 0.35rem 0.45rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
}
.comment-flag-actions { display: flex; justify-content: flex-end; }

/* Post / reply / submit-flag primary button — matches hub button style */
.comment-btn {
  font: inherit;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card, var(--paper));
  color: var(--ink);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.comment-btn:hover { background: var(--paper-2); border-color: var(--ink-soft); }
.comment-btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.comment-btn-primary:hover {
  background: var(--ink-2);
  border-color: var(--ink-2);
  color: var(--paper);
}

/* Post form */
.comment-form {
  display: grid; gap: 0.5rem; margin-top: 1rem;
}
.comment-form textarea {
  width: 100%; padding: 0.55rem 0.65rem; font: inherit;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  resize: vertical;
  min-height: 4.5em;
}
.comment-form textarea:focus {
  outline: none; border-color: var(--ink-soft);
}
.comment-form-actions { display: flex; justify-content: flex-end; }
.comment-reply-form { margin-top: 0.5rem; }
.comments-login { color: var(--ink-soft); font-size: 0.9rem; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* notification inbox */
.inbox-page { padding-top: 32px; }
.inbox-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 16px; margin-bottom: 16px;
  border-bottom: 1px solid var(--line); padding-bottom: 16px;
}
.inbox-head h1 {
  font-family: 'Source Serif 4', 'Times New Roman', serif;
  font-size: 28px; line-height: 1.1; margin: 0;
  letter-spacing: -0.01em;
}
.inbox-sub { color: var(--ink-soft); margin: 4px 0 0; font-size: 14px; }
.inbox-mark-all {
  background: none; border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 6px 12px;
  color: var(--ink-soft); cursor: pointer; font-size: 13px;
}
.inbox-mark-all:hover { color: var(--ink); background: var(--paper-2); }

.inbox-list { list-style: none; padding: 0; margin: 0; max-width: 70ch; }
.inbox-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.inbox-item-unread .inbox-item-title { font-weight: 600; }
.inbox-item-row { display: flex; gap: 10px; align-items: flex-start; }
.inbox-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--plymouth-red, var(--accent));
  margin-top: 7px; flex-shrink: 0;
}
.inbox-item-body { flex: 1; min-width: 0; }
.inbox-item-title { font-size: 15px; line-height: 1.4; }
.inbox-item-title a { color: var(--ink); text-decoration: none; }
.inbox-item-title a:hover { text-decoration: underline; }
.inbox-item-blurb {
  color: var(--ink-soft); font-size: 14px; margin-top: 4px;
  line-height: 1.45;
}
.inbox-item-meta {
  color: var(--ink-quiet); font-size: 12px; margin-top: 4px;
}
.inbox-empty { padding: 24px 0; color: var(--ink-soft); }
.inbox-push {
  margin: 8px 0 24px; padding: 12px 14px;
  background: var(--paper-2); border-radius: var(--radius-sm);
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  max-width: 70ch;
}
.inbox-push #webpush-subscribe-button[disabled] { opacity: 0.6; cursor: wait; }
.inbox-push-msg { color: var(--ink-soft); font-size: 13px; }
.inbox-push-hint {
  flex: 1 1 100%; margin: 4px 0 0;
  color: var(--ink-quiet); font-size: 12px; line-height: 1.4;
}

/* moderation queue */
.comments-queue { list-style: none; padding: 0; }
.queue-item {
  margin: 0 0 1.25rem; padding: 0.75rem 1rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.queue-item-removed { opacity: 0.7; background: var(--paper-2); }
.queue-body { margin: 0.4rem 0; padding-left: 0.8rem; border-left: 2px solid var(--line); }
.queue-meta { font-size: 0.85rem; color: var(--ink-soft); }
.queue-flag-note { font-size: 0.85rem; color: var(--ink-quiet); }


/* ---------- mobile polish ---------------------------------------------
   Targeted shrinks/hides for narrow viewports. The macro layouts already
   linearise correctly via the existing 960/720 breakpoints; this section
   tightens content density that was tuned for a desktop column width.   */

@media (max-width: 720px) {
  /* Preserve the topnav search on mobile as a tiny pill that expands
     into a near-full-width search field when focused. While focused
     we hide the bell, the me-pill (user avatar + name) and the brand
     wordmark to free up space; the input is sized as flex:1 so it
     fills whatever horizontal room remains. */
  .topnav .search-wrap {
    display: block;
    min-width: 0;
    flex: 1 1 auto;
  }
  .topnav .search {
    width: 100%;
    min-width: 0;
    padding: 6px 10px 6px 26px;
    font-size: 12.5px;
  }
  .topnav .search::placeholder { font-size: 12px; }
  .topnav .search-icon { left: 8px; width: 12px; height: 12px; }
  /* Defeat the desktop :focus rule that fixes width to 320px. iOS
     Safari auto-zooms when an input's computed font-size is < 16px;
     bumping to 16px on focus prevents that surprise. */
  .topnav .search:focus {
    width: 100%;
    font-size: 16px;
  }
  .topnav-inner:has(.search:focus) .search-wrap { flex: 1 1 auto; }
  /* Hide neighbours that compete for the row when search is active. */
  .topnav-right:has(.search:focus) .bell,
  .topnav-right:has(.search:focus) .me-pill { display: none; }
  /* Hide the "psyhub" wordmark text without removing the shield --
     font-size:0 collapses the text node; the img keeps its intrinsic
     width/height from the markup. The gap also disappears so the
     row tightens up. */
  .topnav-inner:has(.search:focus) .brand {
    font-size: 0;
    gap: 0;
  }

  /* Mobile-flavoured suggestions panel: full viewport width, sits
     just below the topnav, and styled as a vertical list of
     tappable rows rather than the desktop pop-over. The .topnav
     prefix gives these rules higher specificity than topnav.js's
     injected defaults, which are loaded later in the cascade. */
  .topnav .search-suggestions {
    position: fixed;
    top: calc(var(--topnav-h) + 4px);
    left: 8px;
    right: 8px;
    width: auto;
    max-height: calc(100vh - var(--topnav-h) - 24px);
    overflow-y: auto;
    padding: 6px 0 8px;
    border-radius: 12px;
    box-shadow: 0 12px 36px rgba(20,20,30,.18);
  }
  .topnav .search-suggestions-label {
    padding: 10px 16px 6px;
    font-size: 11px;
    letter-spacing: 0.14em;
  }
  .topnav .search-suggestion {
    padding: 12px 16px;
    font-family: 'Helvetica Neue', sans-serif;
    font-style: normal;
    font-size: 15px;
    color: var(--ink);
    border-radius: 0;
    border-bottom: 1px solid var(--line-soft);
    min-height: 44px;
    /* Stack title above snippet -- on narrow widths a row layout
       gives two narrow columns and truncates both. */
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 2px;
  }
  .topnav .search-suggestion:last-child { border-bottom: none; }
  .topnav .search-suggestion:hover,
  .topnav .search-suggestion.is-highlighted {
    background: var(--paper-2);
  }
  .topnav .search-suggestions-foot {
    padding: 10px 16px 6px;
    font-size: 11.5px;
  }
  .topnav .search-ask-cta {
    margin: 4px 8px 6px;
    border-radius: 8px;
    padding: 12px 14px;
  }

  /* stream filter chips overflow horizontally when there are 7 of them.
     Allow horizontal scroll rather than wrapping (keeps the row neat). */
  .stream-head { flex-wrap: wrap; gap: 8px; }
  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 100%;
    padding-bottom: 2px;
  }
  .filters::-webkit-scrollbar { display: none; }
  .chip { flex-shrink: 0; }

  /* footer: stack rather than squeeze the photo against the text. */
  footer { flex-direction: column; align-items: flex-start; gap: 16px; }
  footer img { width: 100%; height: 120px; }
}

@media (max-width: 480px) {
  /* tighter page edges so cards aren't pinched against the viewport. */
  .container { padding-left: 12px; padding-right: 12px; }

  /* hero headlines were tuned for a desktop column. Shrink hard. */
  .hero h1 { font-size: 34px; }
  .hero.hero-compact h1 { font-size: 26px; }
  .hero-meta { font-size: 16px; }
  .page-hero { padding-left: 12px; padding-right: 12px; }
  .page-hero h1 { font-size: 36px; }
  .page-hero-sub { font-size: 16px; }

  /* ask-card: reduce padding and tighten the search input. */
  .ask-card { padding: 16px 14px; }
  .ask-head h2 { font-size: 22px; }
  .ask-head h2 em { font-size: 16px; }
  /* Keep the input font-size at 16px on iOS to prevent the
     auto-zoom that fires when a focused input reads <16px. */
  .ask-input { padding: 12px 50px 12px 42px; font-size: 16px; }
  .ask-input::placeholder { font-size: 14px; }
  .ask-input-icon { left: 14px; }
  /* icon-only submit and hide the "AI" badge so the input has room. */
  .ask-ai-badge { display: none; }
  .ask-submit { padding: 8px 10px; font-size: 0; gap: 0; }
  .ask-submit svg { width: 16px; height: 16px; }

  /* example-question pills: slightly smaller so 2-3 fit per line. */
  .ask-pill { padding: 5px 11px; font-size: 12.5px; }

  /* handbook-card: stack cats above pages instead of 2-col. */
  .handbook-card { padding: 16px; }
  .handbook-card .browse { grid-template-columns: 1fr; gap: 12px; }
  .handbook-card .browse-cats {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid var(--line-soft);
    padding-right: 0;
    padding-bottom: 10px;
    gap: 6px;
  }
  .handbook-card .browse-cats li { display: inline-block; }
  .handbook-card .browse-cat { width: auto; padding: 4px 10px; }

  /* support row-2 CTAs: trim padding so two-line titles don't dominate. */
  .support-cta { padding: 18px 18px 16px; }
  .support-cta-title { font-size: 20px; }

  /* ask-team form: tighter pill button so it fits short widths. */
  .ask-team-card { padding: 18px 16px 16px; }
  .ask-team-card h2 { font-size: 22px; }
  .ask-team-submit { padding: 10px 20px; }

  /* topnav: shrink the brand wordmark so it doesn't shove the menu. */
  .brand { font-size: 19px; }
  .brand-mark { height: 22px; }

  /* Auto-fill grids with a fixed minmax floor overflow when the viewport
     is narrower than that floor. Switch them to the min(100%, N) pattern
     so a single column shrinks to fit instead of forcing horizontal
     scroll. Pages affected: practice activities, opportunities, staff
     who-to-contact (also inline-style-overridden in the template). */
  .activity-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  }
  .opp-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  }
  .res-grid {
    grid-template-columns: 1fr;
  }

  /* Practice submission: tabs row needs to wrap on narrow widths so the
     third tab doesn't push off the right edge. */
  .upload-tabs { flex-wrap: wrap; }
  .upload-tab { padding: 8px 10px; font-size: 13px; }
  .upload-panel h2 { font-size: 22px; }
  .upload-lede { font-size: 14px; }
  .upload-foot { flex-direction: column; align-items: stretch; gap: 10px; }
  .upload-cta { width: 100%; text-align: center; }
  .activities-head { gap: 8px; }

  /* Opportunity spotlight: the right-aligned meta block has white-space:
     nowrap so it forces overflow; stack it below the headline instead. */
  .opp-spotlight {
    grid-template-columns: 1fr;
    padding: 18px 16px;
  }
  .opp-spotlight h2 { font-size: 22px; }
  .opp-spotlight-meta { text-align: left; white-space: normal; }

  /* Profile assessment list: the date column min-width pushes the title
     into a cramped second line. Let it size to content on tight widths. */
  .profile-list .when {
    min-width: 0;
    display: block;
    margin-bottom: 2px;
  }

  /* who-to-contact: badge facets carry inline styles that win over CSS
     classes; the !important is necessary to shrink them at mobile. */
  .who-badge { font-size: 12px !important; padding: 5px 10px !important; }
}

@media (max-width: 720px) {
  /* Opportunity spotlight on mid-mobile: keep two-up but tighten gap. */
  .opp-spotlight { gap: 12px; }

  /* Headsup grid: existing rule stacks at 720; reinforce gap. */
  .headsup-grid { gap: 12px; }
}
