/* ============================================
   UNIHIVE: shared design system
   One stylesheet for every page. Colours live only in the
   two token sets below; pages never hard-code colours.
   ============================================ */

/* ---------- Font: Poppins, served from our own server ----------
   Weak campus networks: one less outside server to reach before text shows (no Google Fonts lookup).
   Files in assets/fonts (SIL Open Font License, OFL.txt). latin-ext holds the naira sign (U+20A6);
   the phone only downloads it when a page uses one of its letters. head.php preloads 400 and 700 latin. */
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/poppins-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/poppins-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('../fonts/poppins-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('../fonts/poppins-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 800; font-display: swap;
  src: url('../fonts/poppins-800-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 800; font-display: swap;
  src: url('../fonts/poppins-800-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- Tokens: light (default) ---------- */
:root {
  --primary: #6C63FF;
  --primary-deep: #4F46E5;
  --primary-text: #4F46E5;          /* indigo for small text and links */
  --primary-soft: #E0DFFF;
  --on-primary: #FFFFFF;
  --accent: #F59E0B;
  --accent-soft: rgba(245, 158, 11, .14);
  --accent-text: #B45309;   /* amber for words on light backgrounds (plain amber is too pale to read) */

  --bg: #E0DFFF;                    /* Lavender: the brand tint is the page, cards stay white */
  --surface: #FFFFFF;
  --field: #FFFFFF;
  --text: #1A1A2E;
  --muted: #5B6070;                 /* a notch darker than grey so small text reads on lavender */
  --border: #CDCBF3;

  --danger: #F43F5E;
  --danger-soft: rgba(244, 63, 94, .10);
  --success: #22C55E;
  --success-soft: rgba(34, 197, 94, .12);

  --seg-bg: #CFCDF6;                /* choice controls sit on the lavender page: a deeper tint so they show */
  --skeleton: #D3D1F6;
  --skeleton-shine: #E9E8FF;
  --shadow-lift: 0 8px 24px rgba(26, 26, 46, .08);
  --shadow-soft: 0 1px 2px rgba(26, 26, 46, .04), 0 4px 12px rgba(26, 26, 46, .05);   /* cards: a calm lift */
  --card-edge: transparent;         /* cards on the lavender page: no outline, the soft shadow lifts them (D9, every page) */
  --scrim: rgba(15, 15, 30, .45);
  /* Over a cover photo behind white text (Home hero): the same in light and dark, the photo decides the colour. */
  --photo-shade: linear-gradient(180deg, rgba(15, 15, 30, .30) 0%, rgba(15, 15, 30, .78) 100%);
  /* Home v1.5: the same shade, tinted by the hour (the photo stays the student's own) */
  --photo-shade-morning: linear-gradient(180deg, rgba(108, 99, 255, .18) 0%, rgba(15, 15, 30, .62) 100%);
  --photo-shade-evening: linear-gradient(180deg, rgba(79, 70, 229, .45) 0%, rgba(26, 26, 46, .85) 100%);
  --photo-shade-night: linear-gradient(180deg, rgba(15, 15, 30, .62) 0%, rgba(15, 15, 30, .9) 100%);
  --photo-floor: linear-gradient(90deg, rgba(15, 15, 30, .62) 0%, rgba(15, 15, 30, .5) 60%, rgba(15, 15, 30, .4) 100%);   /* Home hero: a dark floor under every mood, so white text reads on any photo (even a white one) */
  --on-photo: #FFFFFF;              /* text and icons over a photo (both themes) */
  --photo-scrim: rgba(15, 15, 30, .85);

  /* Brand gradient: hero and waitlist only. Indigo leads, amber glows in one corner. */
  --brand-gradient:
    radial-gradient(75% 55% at 100% 100%, rgba(245, 158, 11, .75), rgba(245, 158, 11, 0) 70%),
    linear-gradient(160deg, #4F46E5 0%, #6C63FF 100%);
  --hero-glass: rgba(255, 255, 255, .16);
  --hero-line: rgba(255, 255, 255, .22);
  --hero-line-quiet: rgba(255, 255, 255, .09);   /* Home hero honeycomb: a quiet texture behind the greeting */
  --hero-quote: linear-gradient(140deg, #C7C3FF 15%, #F59E0B 95%);   /* the opening quote mark on the Home hero (always on the dark panel) */
  --hero-ghost: rgba(255, 255, 255, .55);
  --on-accent: #1A1A2E;

  /* Indigo panel (dashboard welcome): indigo only, no amber */
  --panel:
    radial-gradient(70% 90% at 100% 0%, rgba(108, 99, 255, .95), rgba(108, 99, 255, 0) 70%),
    #4F46E5;
  --panel-border: transparent;
  --on-panel-muted: rgba(255, 255, 255, .82);

  /* Printed posters stay dark ink on white paper in both themes (a QR code must scan). */
  --print-paper: #FFFFFF;
  --print-ink: #1A1A2E;

  /* Night: the brand's dark navy as a whole section (homepage "Sounds familiar?"); the dark theme tints it indigo */
  --night: #1A1A2E;

  --page-max: 1120px;

  --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --fs-sm: 13px;
  --fs-body: 15px;
  --fs-md: 17px;
  --fs-lg: 20px;
  --fs-xl: 24px;
  --fs-2xl: 30px;

  --r-sm: 10px;    /* inputs, buttons */
  --r-md: 14px;    /* list items, small cards */
  --r-lg: 22px;    /* main panels, sheets */

  --header-h: 56px;
  --bottom-nav-h: 64px;
  --tap: 44px;

  color-scheme: light;
}
/* Phones (desk fixes 2, Josh: "sized for a phone, not a PC"): smaller headings, same body text */
@media (max-width: 767px) {
  :root { --fs-md: 16px; --fs-lg: 18px; --fs-xl: 21px; --fs-2xl: 24px; }
}

/* ---------- Tokens: white (Lavender is the set above; White keeps the brand colours and swaps the lavender page and lines for white and soft grey) ---------- */
[data-theme="white"] {
  --card-edge: var(--border);       /* on a white page a card needs its outline */
  --bg: #FFFFFF;
  --seg-bg: var(--primary-soft);
  --muted: #6B7280;
  --border: #E6E6EF;
  --skeleton: #F1F1F6;
  --skeleton-shine: #FAFAFD;
  color-scheme: light;
}

/* ---------- Tokens: dark ---------- */
[data-theme="dark"] {
  --card-edge: var(--border);       /* a shadow barely shows on dark: keep a faint edge */
  --seg-bg: var(--primary-soft);
  --primary-text: #8F89FF;          /* lifted indigo so links stay readable on navy */
  --primary-soft: rgba(108, 99, 255, .18);
  --accent-soft: rgba(245, 158, 11, .16);
  --accent-text: #FBBF24;

  --bg: #0F0F1E;
  --surface: #1A1A2E;
  --field: #0F0F1E;
  --text: #F9F9FF;
  --muted: #9CA3AF;
  --border: #2D2A52;

  --danger-soft: rgba(244, 63, 94, .16);
  --success-soft: rgba(34, 197, 94, .16);

  --skeleton: #24223F;
  --skeleton-shine: #2F2C52;
  --shadow-lift: 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, .25);
  --scrim: rgba(0, 0, 0, .6);

  --brand-gradient:
    radial-gradient(75% 55% at 100% 100%, rgba(245, 158, 11, .45), rgba(245, 158, 11, 0) 70%),
    linear-gradient(160deg, #1A1A2E 0%, #4F46E5 115%);
  --hero-glass: rgba(255, 255, 255, .10);
  --hero-line: rgba(143, 137, 255, .22);
  --hero-line-quiet: rgba(143, 137, 255, .12);
  --hero-ghost: rgba(255, 255, 255, .40);
  --panel:
    radial-gradient(80% 100% at 100% 0%, rgba(108, 99, 255, .6), rgba(108, 99, 255, 0) 70%),
    #1A1A2E;
  --panel-border: #2D2A52;
  --on-panel-muted: rgba(249, 249, 255, .75);
  --night: #1C1A3D;                 /* a step lighter and bluer than the dark page, so the section still shows */

  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--primary-text); text-decoration: none; font-weight: 700; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; font-weight: 800; }
h1 { font-size: var(--fs-xl); }
h2 { font-size: var(--fs-md); }
h3 { font-size: var(--fs-body); font-weight: 700; letter-spacing: 0; }
p { max-width: 65ch; text-wrap: pretty; }
[hidden] { display: none !important; }

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

.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;
}
.muted { color: var(--muted); }
.icon { width: 20px; height: 20px; flex-shrink: 0; }

/* ---------- Hexagon (the brand shape) ---------- */
.hex { clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }

/* ---------- Wordmark ---------- */
.brand { display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { width: 26px; height: 28px; object-fit: contain; }
.wordmark { font-size: 19px; font-weight: 800; letter-spacing: .02em; line-height: 1; }
.wordmark .wm-uni { color: var(--text); }
.wordmark .wm-hive { color: var(--primary); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 10px 20px;
  border: 1.5px solid transparent; border-radius: var(--r-sm);
  font-size: var(--fs-body); font-weight: 700; line-height: 1.2;
  text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--primary-deep); color: var(--on-primary); }
.btn-primary:hover:not(:disabled) { background: var(--primary); }
.btn-secondary { background: var(--primary-soft); color: var(--primary-text); }
.btn-secondary:hover:not(:disabled) { border-color: var(--primary); }
.btn-ghost { background: transparent; color: var(--primary-text); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { border-color: var(--primary); }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-accent:hover:not(:disabled) { box-shadow: 0 0 0 4px var(--accent-soft); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: var(--fs-sm); position: relative; }
/* Looks 36px tall, but the touch area reaches 44px (--tap): -6px from inside the 1.5px border = 45px. */
.btn-sm::after { content: ""; position: absolute; left: 0; right: 0; top: -6px; bottom: -6px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--tap); height: var(--tap);
  background: none; border: 0; border-radius: 50%;
  color: var(--muted); position: relative;
}
.icon-btn:hover { color: var(--text); background: var(--primary-soft); }
.icon-btn .dot {
  position: absolute; top: 10px; right: 11px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary); box-shadow: 0 0 0 2px var(--surface);
}
.icon-btn .dot-important { background: var(--accent); }   /* important = amber (Josh, 2026-11-03): red is for danger */

.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Theme toggle: show the icon for the theme you would switch to */
.theme-toggle .i-sun { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: block; }
[data-theme="dark"] .theme-toggle .i-moon { display: none; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field-row { display: grid; gap: 18px; }
.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.field label, .label { font-size: var(--fs-sm); font-weight: 700; color: var(--text); }
.field label .opt { font-weight: 400; color: var(--muted); }
.field-head a { font-size: var(--fs-sm); }

.input, .select {
  width: 100%; min-height: 48px;
  padding: 12px 14px;
  font-size: 16px;                  /* 16px stops mobile browsers zooming in */
  background: var(--field);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--muted); opacity: 1; }
.input:focus, .select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}

/* ---------- Place picker (includes/place_picker.php, assets/js/place_picker.js) ----------
   The list sits under the box in the page flow (never clipped by a sheet), at most about six rows tall. */
.pp { display: grid; gap: 6px; min-width: 0; }
.pp-box { position: relative; display: flex; gap: 8px; align-items: center; }
.pp-box .input { flex: 1; min-width: 0; }
.pp-tick {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  display: none; width: 22px; height: 22px; border-radius: 50%;
  align-items: center; justify-content: center; color: var(--on-primary); background: var(--primary);
}
.pp-tick .icon { width: 14px; height: 14px; stroke-width: 2.6; }
.pp.is-picked .pp-tick { display: inline-flex; }
.pp.is-picked .input { padding-right: 44px; }
.pp-add { flex: none; min-height: 48px; }
.pp-list {
  max-height: 264px; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r-sm);
  box-shadow: var(--shadow-lift);
}
.pp-group + .pp-group { border-top: 1px solid var(--border); }
.pp-part {
  position: sticky; top: 0; z-index: 1; margin: 0; padding: 8px 14px 4px;
  font-size: 12px; font-weight: 700; color: var(--primary-text); background: var(--surface);
}
.pp-opt {
  display: grid; gap: 1px; min-height: var(--tap); padding: 8px 14px; cursor: pointer;
}
.pp-opt:hover, .pp-opt[aria-selected="true"] { background: var(--primary-soft); }
.pp-name { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.pp-meta { font-size: 12px; color: var(--muted); }
.pp-note { margin: 0; padding: 10px 14px; font-size: var(--fs-sm); color: var(--muted); border-top: 1px solid var(--border); }
.pp-note:first-child { border-top: 0; }
.pp-error { color: var(--danger); }
.pp-skel { padding: 14px; }
.pp-skel + .pp-skel { padding-top: 0; }

.pw { position: relative; }
.pw .input { padding-right: 52px; }
.pw-toggle {
  position: absolute; right: 2px; top: 50%; transform: translateY(-50%);
  width: var(--tap); height: var(--tap);
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; color: var(--muted); border-radius: var(--r-sm);
}
.pw-toggle:hover { color: var(--text); }
.pw-toggle .i-eye-off { display: none; }
.pw-toggle[aria-pressed="true"] .i-eye { display: none; }
.pw-toggle[aria-pressed="true"] .i-eye-off { display: block; }

/* Search box over a long <select> (assets/js/uni_pick.js: the university on sign-up) */
.pick { position: relative; }
.pick .input { padding-left: 44px; padding-right: 48px; }
.pick-ico { position: absolute; left: 14px; top: 24px; transform: translateY(-50%); color: var(--muted); display: flex; pointer-events: none; }
.pick-clear {
  position: absolute; right: 2px; top: 24px; transform: translateY(-50%);
  width: var(--tap); height: var(--tap); display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; color: var(--muted); border-radius: var(--r-sm);
}
.pick-clear:hover { color: var(--text); }
.pick-list {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px);
  margin: 0; padding: 6px; list-style: none; max-height: min(60vh, 340px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md, 16px); box-shadow: var(--shadow-lift);
}
.pick-opt { display: flex; align-items: center; gap: 12px; min-height: var(--tap); padding: 8px 10px; border-radius: 12px; cursor: pointer; color: var(--text); }
.pick-opt:hover, .pick-opt.is-active { background: var(--primary-soft); }
.pick-opt[aria-selected="true"] .pick-text strong { color: var(--primary-text); }
.pick-code {
  flex-shrink: 0; min-width: 64px; padding: 3px 8px; border-radius: 8px; text-align: center;
  background: var(--primary-soft); color: var(--primary-text); font-size: 13px; font-weight: 800; white-space: nowrap;
}
.pick-text { display: grid; min-width: 0; }
.pick-text strong { font-size: var(--fs-sm); line-height: 1.3; }
.pick-text small { font-size: 13px; color: var(--muted); }
.pick-empty { padding: 10px; font-size: var(--fs-sm); color: var(--muted); }
.pick-full { justify-self: start; padding: 4px 0; background: none; border: 0; color: var(--primary-text); font-size: var(--fs-sm); font-weight: 700; }

.meter { height: 4px; border-radius: 4px; background: var(--border); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; border-radius: inherit; transition: width .2s, background-color .2s; }
.meter[data-level="1"] span { width: 25%;  background: var(--danger); }
.meter[data-level="2"] span { width: 50%;  background: var(--accent); }
.meter[data-level="3"] span { width: 75%;  background: var(--success); }
.meter[data-level="4"] span { width: 100%; background: var(--primary); }

.disclose summary {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: var(--tap); cursor: pointer; list-style: none;
  font-size: var(--fs-sm); font-weight: 700; color: var(--primary-text);
}
.disclose summary::-webkit-details-marker { display: none; }
.disclose summary .icon { width: 16px; height: 16px; transition: transform .2s; }
.disclose[open] summary .icon { transform: rotate(180deg); }
.disclose .field { margin-top: 4px; }

/* ---------- Alerts ---------- */
.alert {
  display: block;
  padding: 12px 14px; border-radius: var(--r-sm);
  border-left: 4px solid; font-size: var(--fs-sm); color: var(--text);
}
/* Flex only with an icon inside: a plain alert with a <strong> or a link in its sentence split into columns
   (launch check 2026-11-06, the fresher deadline on business/start.php and Settings). */
.alert:has(> .icon) { display: flex; gap: 10px; align-items: flex-start; }
.alert-error   { background: var(--danger-soft);  border-color: var(--danger); }
.alert-success { background: var(--success-soft); border-color: var(--success); }
.alert-info    { background: var(--primary-soft); border-color: var(--primary); }
.wl-card .alert { margin-bottom: 14px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 6px; border-radius: 999px;
  font-size: var(--fs-sm); font-weight: 700;
  background: var(--primary-soft); color: var(--primary-text);
}
.badge .hex { width: 12px; height: 14px; background: currentColor; }
.badge-basic   { background: var(--border); color: var(--muted); }
.badge-trusted { background: var(--success-soft); color: var(--text); }
.badge-trusted .hex { background: var(--success); }
.badge-gold    { background: var(--accent-soft); color: var(--text); }
.badge-gold .hex { background: var(--accent); }
.badge-team    { background: var(--primary-soft); color: var(--text); }
.badge-team .hex { background: var(--primary); }

/* ---------- Cards ---------- */
/* One card style on every page (D9, 2026-11-05: the Home look everywhere): no outline on the lavender page, a soft
   shadow instead; white and dark themes keep a faint edge (--card-edge). Cards with a meaning (unread, Trusted,
   warnings) still set their own border colour. */
.card {
  background: var(--surface);
  border: 1px solid var(--card-edge);
  border-radius: var(--r-md);
  padding: 16px;
  box-shadow: var(--shadow-soft);
}
@media (max-width: 767px) { .card { padding: 14px; } }
.card-lg { border-radius: var(--r-lg); padding: 20px; }

/* ---------- Progress ---------- */
.progress { height: 8px; border-radius: 8px; background: var(--accent-soft); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }

/* ---------- Empty state ---------- */
.empty {
  display: grid; justify-items: center; gap: 8px; text-align: center;
  padding: 28px 16px;   /* D9: no dashed box, the empty state sits on the page like on Home */
}
.empty .hex-mark {
  width: 48px; height: 55px; margin-bottom: 4px;
  display: grid; place-items: center;
  background: var(--surface);   /* D9: white on the lavender page (primary-soft vanished there) */ color: var(--primary-text);
}
.empty p { color: var(--muted); font-size: var(--fs-sm); max-width: 32ch; text-wrap: balance; }
.empty .btn { margin-top: 8px; }

/* ---------- Sent panel (D4): after a share or report, stays until closed (UH.done in app.js) ---------- */
.sent {
  display: grid; justify-items: center; gap: 6px; text-align: center;
  padding: 20px 4px 4px;
  animation: sent-in .22s cubic-bezier(.2, .8, .2, 1);
}
.sent:focus { outline: none; }
.sent .sent-mark {
  width: 56px; height: 64px; margin-bottom: 6px;
  display: grid; place-items: center;
  background: var(--primary); color: #fff;
}
.sent .sent-mark .icon { width: 26px; height: 26px; stroke-width: 2.4; }
.sent .sent-mark.is-wait { background: var(--primary-soft); color: var(--primary-text); }
.sent-title { font-size: var(--fs-lg, 1.125rem); font-weight: 700; }
.sent-text { color: var(--muted); font-size: var(--fs-sm); max-width: 36ch; text-wrap: balance; }
.sent-btns { display: grid; gap: 8px; width: 100%; margin-top: 14px; }
@keyframes sent-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .sent { animation: none; } }

/* ---------- Skeleton loaders ---------- */
.skeleton {
  display: block; border-radius: 6px;
  background: linear-gradient(90deg, var(--skeleton) 25%, var(--skeleton-shine) 50%, var(--skeleton) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.skeleton-line { height: 12px; }
.skeleton-line + .skeleton-line { margin-top: 8px; }
.skeleton-line.short { width: 60%; }
.skeleton-avatar { width: 34px; height: 38px; border-radius: 0; }
.skeleton-row { display: flex; gap: 12px; align-items: center; }
.skeleton-row > div { flex: 1; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ============================================
   AUTH PAGES (login, register)
   ============================================ */
.auth-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 12px 0 20px; max-width: 520px; margin: 0 auto;
}
.auth-tagline { font-size: var(--fs-sm); color: var(--muted); margin-top: 2px; }
.auth-main { padding: 28px 20px 40px; max-width: 520px; margin: 0 auto; }
.auth-panel h1 { margin-bottom: 24px; }
.auth-panel .alert { margin-bottom: 18px; }
.auth-switch { margin-top: 24px; font-size: var(--fs-body); color: var(--muted); }
.auth-fine { margin-top: 16px; font-size: var(--fs-sm); color: var(--muted); }
.auth-fine a { font-weight: 400; text-decoration: underline; color: inherit; }

@media (min-width: 420px) {
  .field-row { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 640px) {
  .auth-top { padding-top: 24px; }
  .auth-main { padding-top: 40px; }
  .auth-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 32px;
  }
  .auth-panel .input, .auth-panel .select { background: var(--bg); }
}

/* Business sign-up (business/join.php): steps, photo pickers, summary */
.bj-steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: -8px 0 22px; padding: 0; counter-reset: none; }
.bj-steps li { display: grid; justify-items: center; gap: 4px; font-size: var(--fs-sm); color: var(--muted); text-align: center; position: relative; }
.bj-steps li span {
  width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%;
  border: 1.5px solid var(--border); background: var(--surface); font-weight: 700; position: relative; z-index: 1;
}
.bj-steps li + li::before { content: ""; position: absolute; top: 15px; right: 50%; width: 100%; height: 2px; background: var(--border); }
.bj-steps li.is-on { color: var(--text); font-weight: 700; }
.bj-steps li.is-on span { border-color: var(--primary); background: var(--primary); color: var(--on-primary); }
.bj-steps li.is-done span { border-color: var(--primary); color: var(--primary-text); background: var(--primary-soft); }
.bj-steps li.is-done + li::before, .bj-steps li.is-on::before { background: var(--primary); }
.bj-h { font-size: var(--fs-lg); outline: none; }
.bj-photo {
  position: relative; display: block; cursor: pointer;
  border: 1.5px dashed var(--border); border-radius: var(--r-md); background: var(--field);
  padding: 14px; min-height: 76px;
}
.bj-photo:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.bj-photo.is-picked { border-style: solid; }
.bj-photo input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.bj-photo input[aria-invalid="true"] + .bj-photo-empty { color: var(--danger); }
.bj-photo-empty, .bj-photo-pick { display: flex; align-items: center; gap: 12px; pointer-events: none; }
.bj-photo-empty > .icon { flex: none; width: 28px; height: 28px; color: var(--primary-text); }
.bj-photo strong { display: block; font-size: var(--fs-body); }
.bj-photo small { display: block; font-size: var(--fs-sm); color: var(--muted); }
.bj-thumb { flex: none; width: 56px; height: 56px; border-radius: var(--r-sm); overflow: hidden; background: var(--skeleton); }
.bj-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bj-thumb.is-pdf { display: grid; place-items: center; background: var(--primary-soft); }
.bj-thumb.is-pdf img { display: none; }
.bj-thumb.is-pdf::after { content: "PDF"; font-weight: 700; font-size: var(--fs-sm); color: var(--primary-text); }
.bj-at { position: relative; }
.bj-at > span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.bj-at .input { padding-left: 32px; }
.bj-sum { display: grid; gap: 10px; font-size: var(--fs-sm); }
.bj-sum div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 8px; }
.bj-sum dt { color: var(--muted); }
.bj-sum dd { overflow-wrap: anywhere; font-weight: 700; }
.bj-nav { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.bj-nav .btn { flex: 1; }
.bj-nav .btn-ghost { flex: 0 0 auto; }
.bj-done { display: grid; gap: 14px; justify-items: start; }
.bj-done .hex-mark {
  width: 48px; height: 55px; display: grid; place-items: center;
  background: var(--success-soft); color: var(--success);
}
.bj-done h1 { margin-bottom: 0; }
.bj-done p { color: var(--muted); }
.bj-done .field { width: 100%; }
.bj-copy { display: flex; gap: 8px; }
.bj-copy .input { flex: 1; font-weight: 700; }
/* vouch.php: a student answers "Do you know this business?" */
.vc-card { display: grid; gap: 14px; max-width: 560px; }
.vc-card .hex-mark { width: 48px; height: 55px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); }
.vc-card h1 { font-size: var(--fs-xl); }
.vc-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.vc-actions .btn { flex: 1 1 10rem; }

/* ============================================
   APP SHELL (signed-in pages)
   ============================================ */
.app-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 max(8px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.app-header-actions { display: flex; align-items: center; gap: 2px; }

.avatar-link { display: inline-flex; align-items: center; justify-content: center; min-width: var(--tap); min-height: var(--tap); margin-left: 2px; border-radius: 6px; }
.avatar-link:hover { text-decoration: none; }
.avatar {
  width: 34px; height: 38px;
  display: grid; place-items: center; overflow: hidden;
  background: var(--primary); color: var(--on-primary);
  font-size: var(--fs-sm); font-weight: 800;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.app-layout { display: flex; }
.app-main {
  flex: 1; min-width: 0;
  padding: 20px 16px calc(var(--bottom-nav-h) + 32px);
  max-width: 720px;
}
/* Phones: a little less air above the page and inside cards and heroes */
@media (max-width: 767px) {
  .app-main { padding-top: 14px; }
}

/* Sidebar (tablet and up) */
.sidebar { display: none; }
.side-group { display: grid; gap: 2px; }
.side-group + .side-group { margin-top: 20px; }
.side-label { font-size: var(--fs-sm); color: var(--muted); padding: 0 12px 4px; }
.side-link {
  display: flex; align-items: center; gap: 12px;
  min-height: var(--tap); padding: 0 12px; border-radius: var(--r-sm);
  font-size: var(--fs-body); font-weight: 400; color: var(--muted);
}
.side-link:hover { text-decoration: none; color: var(--text); background: var(--primary-soft); }
.side-link[aria-current="page"] { color: var(--primary-text); background: var(--primary-soft); font-weight: 700; }
button.side-link { width: 100%; border: 0; background: none; font-family: inherit; text-align: left; cursor: pointer; }
.side-form { margin: 0; }

/* Bottom nav (phones) */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.bottom-nav.bn-short { grid-template-columns: repeat(3, 1fr); }
.bottom-nav.bn-four { grid-template-columns: repeat(4, 1fr); }
.bn-link {
  display: grid; justify-items: center; gap: 2px;
  min-height: var(--tap); padding: 6px 0;
  font-size: 11px; font-weight: 400; color: var(--muted);
}
.bn-link:hover { text-decoration: none; color: var(--text); }
.bn-link[aria-current="page"] { color: var(--primary-text); font-weight: 700; }
/* Icon sits in a flat hexagon; it fills with soft indigo on the current tab */
.bn-ico {
  position: relative; width: 48px; height: 30px;
  display: grid; place-items: center;
  clip-path: polygon(22% 0, 78% 0, 100% 50%, 78% 100%, 22% 100%, 0 50%);
  transition: background-color .15s, transform .12s;
}
.bn-link[aria-current="page"] .bn-ico { background: var(--primary-soft); }
.bn-link:active .bn-ico { transform: scale(.9); }
.bn-link .dot {
  position: absolute; top: 3px; right: 12px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
}
.bn-post {
  justify-self: center; margin-top: -22px;
  background: none; border: 0; padding: 4px; border-radius: 8px;
  filter: drop-shadow(0 4px 10px rgba(79, 70, 229, .35));
}
.bn-post .hex {
  width: 52px; height: 60px;
  display: grid; place-items: center;
  background: var(--primary-deep); color: var(--on-primary);
}
.bn-post .icon { width: 24px; height: 24px; }
/* Under 18, waiting for a parent: the (+) is greyed with a small lock (includes/layout/bottom_nav.php) */
.bn-post { position: relative; }
.bn-locked { filter: none; }
.bn-locked .hex { background: var(--muted); }
.bn-lock {
  position: absolute; right: 0; bottom: 4px; width: 22px; height: 22px; display: grid; place-items: center;
  border-radius: 50%; background: var(--surface); color: var(--text); border: 1.5px solid var(--border);
}
.bn-post .bn-lock .icon { width: 12px; height: 12px; }
.wait-lock .hex-mark { color: var(--primary-text); }

@media (min-width: 768px) {
  .bottom-nav { display: none; }
  .sidebar {
    display: block; flex-shrink: 0; width: 232px;
    position: sticky; top: var(--header-h);
    height: calc(100vh - var(--header-h)); overflow-y: auto;
    padding: 20px 12px;
    background: var(--surface); border-right: 1px solid var(--border);
  }
  .app-main { padding: 28px 32px 48px; }
  .app-header { padding: 0 16px 0 24px; }
}

/* ---------- Sheet (bottom sheet on phones, dialog on desktop) ---------- */
.sheet {
  border: 0; padding: 0; margin: auto auto 0;
  width: 100%; max-width: 480px;
  background: var(--surface); color: var(--text);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  max-height: calc(100dvh - 16px); overflow-y: auto; overscroll-behavior: contain;
}
.sheet::backdrop { background: var(--scrim); }
.sheet[open] { animation: sheet-up .18s cubic-bezier(.2, .8, .2, 1); }
.sheet-inner:focus { outline: none; }
.sheet-inner { padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px)); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sheet-list { list-style: none; padding: 0; display: grid; gap: 4px; }
.sheet-list a, .sheet-list button {
  display: flex; align-items: center; gap: 14px; width: 100%;
  min-height: 52px; padding: 0 12px; border-radius: var(--r-sm);
  color: var(--text); font-weight: 400;
}
.sheet-list button { border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.sheet-list a:hover, .sheet-list button:hover { text-decoration: none; background: var(--primary-soft); }
/* D3: the Post sheet puts this page's own choice first */
.sheet-list a.bn-here { font-weight: 700; }
.sheet-list .icon { color: var(--primary-text); }
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 640px) {
  .sheet { margin: auto; border-radius: var(--r-lg); }
}

/* ============================================
   DASHBOARD
   ============================================ */
.dash { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-content: start; }   /* minmax: a long chip row or filter row scrolls inside, never widens the page */
.dash-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: var(--fs-sm); }

/* Welcome panel: indigo with a honeycomb in the corner. Amber only for rewards. */
.dash-hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; gap: 18px; padding: 20px;
  border-radius: var(--r-lg); border: 1px solid var(--panel-border);
  background: var(--panel); color: var(--on-primary);
}
.dash-hero .hex-pattern { color: var(--hero-line); }
/* Your cover photo behind "Hey, ...", darkened so the white text and the badges stay readable. */
.dash-hero-cover { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.dash-hero-photo::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--photo-shade), var(--photo-floor); }   /* the floor: readable on any photo (D9) */
.dash-hero-photo .dash-meta { color: var(--on-primary); }
.dash-hero h1 { font-size: var(--fs-2xl); letter-spacing: -0.03em; margin-bottom: 8px; }
@media (max-width: 767px) { .dash-hero { gap: 14px; padding: 16px; } }
.dash-hero .dash-meta { color: var(--on-panel-muted); }
.dash-hero .badge { background: var(--hero-glass); color: var(--on-primary); }
.dash-hero .badge-basic .hex { background: var(--on-panel-muted); }
.dash-reward {
  display: grid; gap: 10px; padding: 14px;
  border-radius: var(--r-md); background: var(--hero-glass);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.dash-reward-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dash-reward-count { font-size: var(--fs-xl); font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.dash-reward-count small { font-size: var(--fs-sm); font-weight: 400; color: var(--on-panel-muted); letter-spacing: 0; }
.dash-reward .progress { background: var(--hero-glass); }
.dash-reward p { font-size: var(--fs-sm); color: var(--on-panel-muted); }
.dash-reward p strong { color: var(--on-primary); }

/* Quick actions: six hexagons (Lost & Found, Market, Shops, Gigs, Events, Campus Guide), 3 by 2 on a phone */
.dash-tiles { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 6px; }
@media (min-width: 600px) { .dash-tiles { grid-template-columns: repeat(6, 1fr); } }
.dash-tile {
  display: grid; justify-items: center; gap: 6px; padding: 2px 0;
  text-align: center; font-size: 12px; font-weight: 700; line-height: 1.25; color: var(--text);
}
.dash-tile:hover { text-decoration: none; }
.dash-tile .hex {
  width: 56px; height: 64px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary-text);
  transition: background-color .15s, color .15s, transform .12s;
}
.dash-tile .icon { width: 24px; height: 24px; }
@media (max-width: 400px) {
  .dash-tile { font-size: 11px; }
  .dash-tile .hex { width: 50px; height: 57px; }
  .dash-tile .icon { width: 22px; height: 22px; }
}
.dash-tile:hover .hex, .dash-tile:focus-visible .hex { background: var(--primary-deep); color: var(--on-primary); }
.dash-tile:active .hex { transform: scale(.92); }

.verify-card { display: flex; align-items: center; gap: 14px; border-color: var(--success); }
.verify-card > .hex { flex-shrink: 0; width: 40px; height: 46px; display: grid; place-items: center; background: var(--success-soft); color: var(--text); }
.verify-card > div { flex: 1; min-width: 0; }
.verify-card p { font-size: var(--fs-sm); color: var(--muted); margin-top: 2px; }
/* Under 18, waiting for a parent's OK */
.wait-card { align-items: flex-start; border-color: var(--primary); }
.wait-card > .hex { background: var(--primary-soft); }
.wait-card .disclose { margin-top: 10px; }
.wait-card .form { margin-top: 10px; }
.dash-feed { grid-template-columns: 1fr; }
.dash-note { font-size: var(--fs-sm); color: var(--muted); margin-bottom: 10px; }
.dash-note a { color: var(--primary-text); font-weight: 700; }

/* Business area (business/) */
.bz { max-width: 720px; }
.bz-chats { margin-top: 0; }
.bz-details { display: grid; gap: 12px; }
.bz-details h2 { font-size: var(--fs-md); }
.bz-details dl { display: grid; gap: 10px; }
.bz-details dl > div { display: grid; grid-template-columns: minmax(96px, 120px) 1fr; gap: 12px; font-size: var(--fs-sm); }
.bz-details dt { color: var(--muted); }
.bz-details dd { overflow-wrap: anywhere; }
.bz-details .btn { justify-self: start; }
.bz-status { display: flex; align-items: flex-start; gap: 14px; }
.bz-status > .hex { flex-shrink: 0; width: 40px; height: 46px; display: grid; place-items: center; color: var(--text); }
.bz-status h2, .bz-next h2 { font-size: var(--fs-lg); }
.bz-status p, .bz-next p { font-size: var(--fs-sm); color: var(--muted); margin-top: 4px; }
.bz-success { border-color: var(--success); }
.bz-success > .hex { background: var(--success-soft); }
.bz-info { border-color: var(--primary); }
.bz-info > .hex { background: var(--primary-soft); }
.bz-danger { border-color: var(--danger); }
.bz-danger > .hex { background: var(--danger-soft); }
.bz-next .btn { margin-top: 12px; }
.bz-more { display: block; width: fit-content; margin-top: 4px; padding-block: 12px; font-size: var(--fs-sm); font-weight: 700; }
/* Small text links: 44px touch area (--tap); the negative margin keeps the row the same height. */
.section-head a { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); min-height: var(--tap); margin-block: -12px; }
.section-head a .icon { width: 16px; height: 16px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }

/* ============================================
   PUBLIC PAGES (waitlist now, homepage later)
   ============================================ */
.site-top {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--page-max); margin: 0 auto; padding: 6px 8px 6px 20px;
}
.site-main {
  display: grid; gap: 48px;
  max-width: var(--page-max); margin: 0 auto; padding: 40px 20px 0;
}
.site-h2 { font-size: clamp(22px, 6vw, 30px); margin-bottom: 16px; text-wrap: balance; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  margin: 0 12px; padding: 22px 20px 20px;
  border-radius: var(--r-lg);
  background: var(--brand-gradient);
  color: var(--on-primary);
}
.hex-pattern {
  position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%;
  color: var(--hero-line);
  -webkit-mask-image: radial-gradient(90% 70% at 100% 0%, #000 0%, transparent 100%);
          mask-image: radial-gradient(90% 70% at 100% 0%, #000 0%, transparent 100%);
}
.hero-inner { display: grid; gap: 24px; }
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 6px;
  padding: 6px 12px 6px 10px; border-radius: 999px;
  background: var(--hero-glass);
  font-size: var(--fs-sm); font-weight: 700; white-space: nowrap;
}
.hero-eyebrow .hex { width: 10px; height: 12px; background: var(--accent); }
.hero h1 {
  margin-top: 4px;
  font-size: clamp(30px, 8.6vw, 54px); line-height: 1.08; letter-spacing: -0.03em;
  text-wrap: balance;
}
.hero-sub { margin-top: 12px; max-width: 42ch; }

.hive-cluster {
  width: 116px; flex-shrink: 0; margin: -6px -8px 0 0;
  animation: hive-float 6s ease-in-out infinite;
}
.hc-cell   { fill: var(--hero-glass); }
.hc-core   { fill: var(--on-primary); }
.hc-accent { fill: var(--accent); }
.hc-ghost  { fill: none; stroke: var(--hero-ghost); stroke-width: 1.5; stroke-dasharray: 5 4; }
.hc-icon   { color: var(--on-primary); }
.hc-icon-ghost { color: var(--hero-ghost); }
@keyframes hive-float { 50% { transform: translateY(-6px); } }

/* ---------- Waitlist card ---------- */
.wl-card { color: var(--text); box-shadow: var(--shadow-lift); }
.wl-card h2 { font-size: var(--fs-lg); }
.wl-card .card-sub { margin: 4px 0 20px; font-size: var(--fs-sm); color: var(--muted); }
.wl-card .input, .wl-card .select { background: var(--bg); }
.wl-card .badge { margin-bottom: 12px; }
/* Checkbox with a sentence (agree to Privacy and Terms) */
.check { display: flex; gap: .6rem; align-items: center; min-height: var(--tap); font-size: var(--fs-sm); color: var(--text); cursor: pointer; }
.check input { flex: none; width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--primary-deep); }
.check a { color: var(--primary-text); }

.wl-fine { font-size: var(--fs-sm); color: var(--muted); text-align: center; }
.wl-fine a { font-weight: 400; color: inherit; text-decoration: underline; }

/* Two-way choice (Student / Business) */
.choice { border: 0; padding: 0; min-width: 0; }
.choice legend { padding: 0; margin-bottom: 6px; }
.seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  padding: 4px; border-radius: var(--r-sm); background: var(--seg-bg);
}
.seg-3 { grid-template-columns: repeat(3, 1fr); }
.seg-4 { grid-template-columns: repeat(4, 1fr); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); border-radius: 8px; cursor: pointer;
  font-size: var(--fs-body); font-weight: 700; color: var(--primary-text);
  transition: background-color .15s, color .15s;
}
.seg label .icon { width: 18px; height: 18px; }
.seg input:checked + label { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(26, 26, 46, .12); }
.seg input:focus-visible + label { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Joined state */
.wl-done { display: grid; justify-items: center; gap: 6px; text-align: center; }
.wl-done .hex-mark, .done-state .hex-mark {
  width: 56px; height: 64px; margin-bottom: 6px;
  display: grid; place-items: center;
  background: var(--primary-deep); color: var(--on-primary);
}
.wl-done .hex-mark .icon, .done-state .hex-mark .icon { width: 26px; height: 26px; }
.wl-done p { color: var(--muted); }
.wl-done p strong { color: var(--text); }
.wl-done .field { width: 100%; margin-top: 14px; text-align: left; }
.wl-done .btn-block { margin-top: 8px; }
.wl-step { width: 100%; margin-top: 14px; padding: 14px; border-radius: var(--r-md); background: var(--primary-soft); text-align: left; font-size: var(--fs-sm); }
.wl-step .btn-block { margin-top: 10px; }
.wl-step .wl-fine { margin-top: 8px; text-align: left; }
.wl-channel {
  display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 14px; padding: 12px;
  border: 1px solid var(--border); border-radius: var(--r-md); text-align: left; color: var(--text);
}
.wl-channel:hover { text-decoration: none; border-color: var(--primary); }
.wl-channel .hex { flex-shrink: 0; width: 36px; height: 41px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); }
.wl-channel .icon { width: 18px; height: 18px; }
.wl-channel span:last-child { display: grid; font-size: var(--fs-sm); }
.wl-channel small { font-size: 12px; font-weight: 400; color: var(--muted); }
.copy-row { position: relative; }
.copy-row .input { padding-right: 84px; text-overflow: ellipsis; }
.copy-row .btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }

/* ---------- Features ---------- */
.feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.feature .hex {
  width: 40px; height: 46px; margin-bottom: 12px;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary-text);
}
.feature p { margin-top: 2px; font-size: var(--fs-sm); color: var(--muted); }
.feature-lead { grid-column: 1 / -1; border-color: var(--primary); }
.feature-parts { list-style: none; padding: 0; margin-top: 12px; display: grid; gap: 10px; }
.feature-parts li { display: grid; gap: 2px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--primary-soft); font-size: var(--fs-sm); }
.feature-parts span { color: var(--muted); }
.feature .feature-later { margin-top: 10px; font-size: 12px; }
@media (min-width: 640px) { .feature-parts { grid-template-columns: 1fr 1fr; } }

/* ---------- Referral ladder ---------- */
.ladder { list-style: none; padding: 0; display: grid; gap: 12px; }
.ladder li { display: flex; align-items: center; gap: 14px; }
.ladder .hex {
  width: 44px; height: 50px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--primary-deep); color: var(--on-primary);
  font-size: var(--fs-md); font-weight: 800;
}
.ladder li:last-child .hex { background: var(--accent); color: var(--on-accent); }
.ladder strong { display: block; line-height: 1.3; }
.ladder span { font-size: var(--fs-sm); color: var(--muted); }
.ladder-note { margin-top: 16px; font-size: var(--fs-sm); color: var(--muted); }

/* ---------- Business call-out ---------- */
.biz-card { display: grid; gap: 16px; border-color: var(--primary); }
.biz-card > .hex {
  width: 40px; height: 46px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.biz-card p { margin-top: 4px; color: var(--muted); }
.biz-grid { margin-bottom: 12px; }
.biz-perks { list-style: none; padding: 0; margin-top: 10px; display: grid; gap: 6px; font-size: var(--fs-sm); }
.biz-perks li { display: flex; align-items: flex-start; gap: 8px; }
.biz-perks .icon { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; color: var(--accent); }
.biz-card .biz-fine { margin-top: 10px; font-size: 12px; }
.site-lead { margin: -4px 0 14px; color: var(--muted); }
.wl-next { width: 100%; margin-top: 14px; padding-left: 20px; display: grid; gap: 8px; text-align: left; font-size: var(--fs-sm); }

/* ---------- FAQ ---------- */
.faq-groups { display: grid; gap: 28px; }
.faq-group { margin-bottom: 10px; color: var(--muted); }
.faq-list { padding: 0 16px; }
.faq + .faq { border-top: 1px solid var(--border); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px; padding: 12px 0; cursor: pointer; list-style: none;
  font-weight: 700;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { color: var(--muted); transition: transform .2s; }
.faq[open] summary .icon { transform: rotate(180deg); }
.faq p { padding-bottom: 16px; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer {
  display: grid; gap: 16px;
  max-width: var(--page-max); margin: 56px auto 0;
  padding: 24px 20px calc(28px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  font-size: var(--fs-sm); color: var(--muted);
}
.site-footer-tag { margin-top: 4px; }
.site-footer-about { margin-top: 2px; font-size: 12px; color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0 20px; }
.site-footer nav a { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--muted); font-weight: 400; }
.site-footer nav a:hover { color: var(--text); }
/* Follow UniHive icons (includes/layout/social_links.php): footer, Help, desktop side menu */
.social-row { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; }
.social-row a {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--tap); height: var(--tap); border-radius: 50%; color: var(--muted);
}
.social-row a:hover, .social-row a:focus-visible { text-decoration: none; color: var(--primary-text); background: var(--primary-soft); }
.social-row .icon { width: 20px; height: 20px; }
.social-row-footer { margin: 8px 0 0 -10px; }
.social-row-side { padding: 0 2px; }

@media (min-width: 768px) {
  .feature-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .biz-card { grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; }
  .ladder { grid-template-columns: repeat(4, 1fr); gap: 20px; }
  .ladder li { flex-direction: column; align-items: flex-start; gap: 12px; }
  .faq-groups { grid-template-columns: 1fr 1fr; align-items: start; gap: 24px; }
  .site-footer { grid-template-columns: 1fr auto; align-items: center; }
  .site-top { padding: 12px 16px 12px 24px; }
}
@media (min-width: 960px) {
  .hero { max-width: calc(var(--page-max) - 40px); margin: 8px auto 0; padding: 56px; }
  .hero-inner { grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
  .hive-cluster { width: 168px; margin: -16px 0 0; }
  .hero-sub { margin-top: 16px; font-size: var(--fs-md); }
  .wl-card.card-lg { padding: 28px; }
  .site-main { padding-top: 64px; gap: 64px; }
}

/* ============================================
   HOMEPAGE (home.php, assets/js/home.js)
   One motif: the hive cell. The logo's hexagon is the hero photo cell, the icon cells, the photo honeycomb,
   the ladder and the two long bands (numbers, closing call). Bold fields of colour: an indigo hero,
   a navy "Sounds familiar?" section, an amber-tinted rewards section. No gradient, no shadows at rest.
   ============================================ */
.site-top-actions { display: flex; align-items: center; gap: 4px; }
.home {
  --hm-tile: var(--surface);                    /* a tone step off the page for tiles */
  --hm-band: var(--surface);                    /* the numbers band */
  --hm-pt: 26px;                                /* how far the pointed ends of a band reach in */
  --hm-hex: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  --hm-ease: cubic-bezier(.2, .7, .2, 1);
  overflow-x: clip;
}
[data-theme="white"] .home { --hm-tile: color-mix(in srgb, var(--primary-soft) 55%, var(--surface)); }
[data-theme="dark"] .home { --hm-band: color-mix(in srgb, var(--primary) 26%, var(--surface)); }

/* ---------- Hero: an indigo field, the words, then the photo cell with a real course card on it ---------- */
.hm-hero { position: relative; overflow: hidden; padding: 32px 20px 0; background: var(--primary-deep); color: var(--on-primary); }
.hm-hero-in { position: relative; z-index: 1; max-width: var(--page-max); margin: 0 auto; }
.hm-hero-copy { min-width: 0; }
.hm-hero h1 { font-size: clamp(42px, 12.6vw, 64px); font-weight: 800; line-height: .98; letter-spacing: -0.04em; }
.hm-lead { margin-top: 16px; max-width: 40ch; font-size: 16px; line-height: 1.55; }

/* The course search */
.hm-search { position: relative; margin-top: 24px; max-width: 520px; color: var(--text); }
.hm-search-box {
  display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px;
  background: var(--field); border-radius: 16px; border: 2px solid transparent; transition: box-shadow .15s;
}
.hm-search-box:focus-within { box-shadow: 0 0 0 4px var(--hero-line); }
.hm-search-box > .icon { color: var(--muted); }
.hm-search-input { flex: 1; min-width: 0; min-height: 44px; border: 0; background: none; outline: none; font-size: 16px; color: var(--text); }
.hm-search-input::placeholder { color: var(--muted); opacity: 1; }
.hm-search-input::-webkit-search-cancel-button { display: none; }
.hm-search-go {
  flex-shrink: 0; width: 44px; height: 44px; display: grid; place-items: center;
  border: 0; border-radius: 12px; background: var(--primary-deep); color: var(--on-primary); transition: background-color .15s, transform .15s;
}
.hm-search-go:hover { background: var(--primary); }
.hm-search-go:active { transform: scale(.94); }
.hm-suggest {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 8px);
  display: grid; padding: 6px; max-height: 60vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lift);
}
.hm-sg, .hm-sg-skel { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; color: var(--text); }
.hm-sg:hover, .hm-sg:focus { background: var(--primary-soft); text-decoration: none; outline: none; }
.hm-sg-skel > div { flex: 1; }
.hm-sg-text { display: grid; min-width: 0; }
.hm-sg-text strong { font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-sg-text small { font-size: 13px; font-weight: 400; color: var(--muted); }
.hm-sg-note { padding: 12px 10px 4px; font-size: var(--fs-sm); color: var(--muted); }
.hm-sg-head { padding: 10px 10px 2px; font-size: 12px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); }
/* The same suggestions under the Study Hub search boxes (assets/js/course_suggest.js) */
form[data-course-suggest] { position: relative; }
.st-search-box .hm-suggest, #stFilters .hm-suggest { top: calc(100% + 6px); }
.st-search-miss { font-size: var(--fs-sm); color: var(--muted); }
.hm-sg-all { display: flex; align-items: center; min-height: var(--tap); padding: 0 10px; font-size: var(--fs-sm); }

.hm-code {
  flex-shrink: 0; display: inline-block; padding: 3px 8px; border-radius: 8px;
  background: var(--primary-soft); color: var(--primary-text);
  font-size: 13px; font-weight: 800; white-space: nowrap;
}

.hm-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 24px; }
.hm-btn { min-height: 52px; padding: 12px 24px; font-size: 16px; }
.hm-btn .icon { width: 18px; height: 18px; transition: transform .2s var(--hm-ease); }
.hm-btn:hover .icon { transform: translateX(3px); }
.hm-btn-light { background: var(--on-primary); color: var(--primary-deep); }
.hm-btn-light:hover { background: var(--primary-soft); }
[data-theme="dark"] .hm-btn-light:hover { background: var(--on-primary); box-shadow: 0 0 0 4px var(--hero-line); }
.hm-cta-link { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--on-primary); font-size: 15px; font-weight: 700; }

/* The photo cell: on a phone it sits under the words, cropped at the sides, the course card overlapping its foot */
.hm-cell { position: relative; margin: 32px -20px 0; padding-bottom: 128px; overflow: hidden; }
.hm-cell-in {
  position: relative; left: 56%; width: min(94vw, 500px); aspect-ratio: .866;
  margin-bottom: calc(-1 * min(14vw, 72px)); transform: translateX(-50%);  /* the card covers only the photo's foot: the laptop shows */
}
.hm-cell-back, .hm-cell-photo { position: absolute; inset: 0; margin: 0; }
.hm-cell-back { background: var(--primary); transform: translate(-16%, -7%); }
.hm-cell-photo { overflow: hidden; background: var(--primary); }
.hm-cell-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }

/* The course card: a small working preview of the app. Course tabs on top (links without script; home.js swaps the topics) */
.hm-try {
  position: relative; z-index: 2; max-width: 360px; margin: 0 20px; padding: 16px 18px 18px;
  border-radius: var(--r-lg); background: var(--surface); color: var(--text);
}
.hm-try-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.hm-try-tabs a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary-text); font-size: 13px; font-weight: 800; white-space: nowrap;
  transition: background-color .15s, color .15s, transform .15s;
}
.hm-try-tabs a:hover { text-decoration: none; background: color-mix(in srgb, var(--primary) 30%, var(--surface)); }
.hm-try-tabs a:active { transform: scale(.95); }
.hm-try-tabs a[aria-current="true"] { background: var(--primary-deep); color: var(--on-primary); }
.hm-try-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.hm-try-count { font-size: 13px; font-weight: 700; color: var(--muted); }
.hm-try-card[hidden] { display: none; }
.hm-try-title { font-size: 18px; font-weight: 800; line-height: 1.25; letter-spacing: -0.01em; }
.hm-try ul { list-style: none; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.hm-try li { min-width: 0; }
.hm-try li a {
  display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 6px 8px; margin: 0 -8px;
  border-radius: 10px; color: var(--text); font-size: 15px; transition: background-color .15s;
}
.hm-try li a:hover { text-decoration: none; background: var(--primary-soft); }
.hm-try li .hex { flex-shrink: 0; width: 10px; height: 12px; background: var(--primary); }
.hm-try li span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-try li small { flex-shrink: 0; font-size: 13px; color: var(--muted); }
.hm-try-more { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; color: var(--primary-text); }
.hm-try-more .icon { width: 16px; height: 16px; transition: transform .2s var(--hm-ease); }
.hm-try-more:hover .icon { transform: translateX(3px); }

/* ---------- Bands: a long cell with pointed ends (numbers, closing call) ---------- */
.hm-band {
  clip-path: polygon(var(--hm-pt) 0, calc(100% - var(--hm-pt)) 0, 100% 50%, calc(100% - var(--hm-pt)) 100%, var(--hm-pt) 100%, 0 50%);
  background: var(--primary-deep); color: var(--on-primary);
}
.hm-stats {
  position: relative; z-index: 3;
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px 16px;
  max-width: calc(var(--page-max) - 40px); margin: 0 auto; padding: 30px 40px; translate: 0 -50%;
  background: var(--hm-band); color: var(--text);
}
.hm-stats div { display: contents; }
.hm-stats strong { font-size: 38px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--primary-text); }
.hm-stats span { font-size: 15px; }

/* ---------- Sounds familiar? A navy field, everyday problems and the fix ---------- */
.hm-night { padding: 0 20px 88px; background: var(--night); color: var(--on-primary); }
.hm-night-in { max-width: var(--page-max); margin: 0 auto; }
.hm-stats + .hm-night-in { margin-top: -32px; }
.hm-night .hm-h2 { color: var(--on-primary); }
.hm-probs { list-style: none; padding: 0; margin-top: 28px; display: grid; gap: 10px; }
/* One row per problem: the problem large, the fix beside it (under it on a phone) */
.hm-prob {
  display: grid; gap: 10px; padding: 22px 20px; margin: 0 -20px;
  border-radius: var(--r-lg); transition: background-color .2s;
}
.hm-prob:hover { background: color-mix(in srgb, var(--on-primary) 7%, transparent); }
.hm-prob strong { font-size: 24px; font-weight: 800; line-height: 1.15; letter-spacing: -0.025em; text-wrap: balance; }
.hm-prob p { display: flex; gap: 12px; align-items: baseline; font-size: 17px; line-height: 1.5; }
.hm-prob p .hex { flex-shrink: 0; width: 12px; height: 14px; background: var(--primary); transition: transform .3s var(--hm-ease); }
.hm-prob:hover p .hex { transform: rotate(30deg) scale(1.2); }
.hm-prob a { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); margin-left: 24px; color: var(--on-primary); font-size: 15px; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.hm-prob a .icon { width: 16px; height: 16px; transition: transform .2s var(--hm-ease); }
.hm-prob a:hover .icon { transform: translateX(3px); }

/* ---------- Sections ---------- */
.hm-main { gap: 88px; padding-top: 80px; }
.hm-main > * { min-width: 0; }
.hm-h2 {
  font-size: clamp(28px, 7.8vw, 52px); font-weight: 800; line-height: 1.04; letter-spacing: -0.035em;
  text-wrap: balance; color: var(--text);
}
.hm-h3 { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.hm-text { margin-top: 14px; max-width: 42ch; font-size: 16px; line-height: 1.6; color: var(--text); }
.hm-fine { margin-top: 20px; font-size: 15px; color: var(--muted); }
.hm-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 20px; margin-bottom: 8px; }
.hm-head a { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); font-size: 15px; font-weight: 700; color: var(--primary-text); }
.hm-head a .icon { width: 16px; height: 16px; transition: transform .2s var(--hm-ease); }
.hm-head a:hover .icon { transform: translateX(3px); }

/* Study: the words and tools beside the course list */
.hm-study { display: grid; gap: 48px; }
.hm-study-side { min-width: 0; }
.hm-tools { list-style: none; padding: 0; margin-top: 24px; display: grid; gap: 4px; }
.hm-tools a {
  display: flex; align-items: center; gap: 14px; padding: 10px; margin: 0 -10px;
  border-radius: var(--r-md); color: var(--text); transition: background-color .15s;
}
.hm-tools a:hover { text-decoration: none; background: var(--hm-tile); }
.hm-tools .hex { flex-shrink: 0; width: 44px; height: 50px; display: grid; place-items: center; background: var(--hm-tile); color: var(--primary-text); transition: background-color .15s, color .15s; }
.hm-tools a:hover .hex { background: var(--primary-deep); color: var(--on-primary); }
.hm-tools .hex .icon { width: 20px; height: 20px; }
.hm-tools a > span:last-child { display: grid; gap: 2px; font-size: 15px; color: var(--muted); }
.hm-tools strong { font-size: 17px; color: var(--text); }
.hm-courses { min-width: 0; padding: 20px; border-radius: var(--r-lg); background: var(--hm-tile); }
.hm-list { list-style: none; padding: 0; display: grid; }
.hm-list a {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: baseline;
  padding: 10px 12px; margin: 0 -12px; border-radius: var(--r-md); color: var(--text); transition: background-color .15s;
}
.hm-list a:hover { text-decoration: none; background: var(--primary-soft); }
.hm-list-code { display: inline-flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 800; color: var(--primary-text); }
.hm-list-code .hex { width: 11px; height: 13px; background: var(--primary); transition: transform .25s var(--hm-ease); }
.hm-list a:hover .hm-list-code .hex { transform: rotate(30deg) scale(1.2); }
.hm-list-title { grid-column: 1 / -1; padding-left: 21px; font-size: 15px; line-height: 1.4; }
.hm-list-meta { grid-column: 2; grid-row: 1; font-size: 13px; color: var(--muted); white-space: nowrap; }

/* On your phone: the screenshot on an indigo cell, three tabs swap it */
.hm-phones { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "h" "t" "s" "tabs"; }
.hm-phones-copy { display: contents; }
.hm-phones .hm-h2 { grid-area: h; }
.hm-phones .hm-text { grid-area: t; }
.hm-stage { grid-area: s; position: relative; display: grid; place-items: center; min-height: 440px; margin: 20px 0 8px; }
.hm-stage-cell {
  position: absolute; left: 50%; top: 50%; width: min(330px, 88vw); aspect-ratio: .866;
  background: var(--primary); transform: translate(-50%, -50%);
}
.hm-phone {
  position: relative; width: 200px; aspect-ratio: 1 / 2; overflow: hidden; margin: 0;
  border: 6px solid var(--night); border-radius: 30px; background: var(--surface);
}
.hm-phone[hidden] { display: none; }
.hm-phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.hm-shot-dark, [data-theme="dark"] .hm-shot-light { display: none; }
[data-theme="dark"] .hm-shot-dark { display: block; }
.hm-tabs { grid-area: tabs; display: grid; gap: 4px; }
.hm-tab {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px;
  border: 0; border-radius: var(--r-md); background: none; text-align: left;
  font: inherit; font-size: 16px; font-weight: 400; color: var(--muted); cursor: pointer;
  transition: background-color .15s, color .15s;
}
.hm-tab .hex { flex-shrink: 0; width: 14px; height: 16px; background: var(--border); transition: background-color .15s, transform .25s var(--hm-ease); }
.hm-tab:hover { color: var(--text); }
.hm-tab[aria-selected="true"] { background: var(--hm-tile); color: var(--text); font-weight: 700; }
.hm-tab[aria-selected="true"] .hex { background: var(--primary); transform: scale(1.3); }

/* The hive: photos as honeycomb cells, two rows, the second set in by half a cell */
.hm-hive { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; margin: 0 -20px; padding: 0 20px; overflow-x: clip; }
/* On a phone the comb is wider than the screen and bleeds off both sides, so the cells stay big enough to see faces */
.hm-comb { --w: 118px; width: calc(3.5 * var(--w) + 12px); justify-self: center; }
.hm-comb-row { display: flex; gap: 6px; }
.hm-comb-row + .hm-comb-row { margin: calc(var(--w) * -0.2887 + 6px) 0 0 calc(var(--w) / 2 + 3px); }
.hm-comb-cell { flex: 0 0 var(--w); height: calc(var(--w) * 1.1547); margin: 0; overflow: hidden; background: var(--primary-soft); }
.hm-comb-cell img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--hm-ease); }
.hm-comb-cell:hover img { transform: scale(1.06); }
.hm-comb-word {
  display: grid; place-content: center; gap: 2px; padding: 0 8px; text-align: center;
  background: var(--primary-deep); color: var(--on-primary);
}
.hm-comb-word strong { font-size: 17px; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.hm-comb-word span { font-size: 13px; line-height: 1.3; color: var(--on-panel-muted); }
.hm-comb-join { background: color-mix(in srgb, var(--primary) 70%, var(--primary-deep)); transition: background-color .2s; }
.hm-comb-join:hover { text-decoration: none; background: var(--primary-deep); }
.hm-comb-join span { display: none; }

/* Trust: a board of tiles; the first is indigo and carries the heading */
.hm-trust { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.hm-tile { margin: 0; padding: 22px; border-radius: var(--r-lg); background: var(--hm-tile); }
.hm-tile strong { display: block; font-size: 17px; line-height: 1.3; }
.hm-tile p { margin-top: 6px; font-size: 15px; line-height: 1.5; color: var(--muted); }
.hm-tile-head {
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px; min-height: 180px;
  background: var(--primary-deep); color: var(--on-primary);
}
.hm-tile-head .hex { width: 48px; height: 55px; display: grid; place-items: center; background: var(--hero-glass); }
.hm-tile-head h2 { font-size: clamp(28px, 7.6vw, 48px); line-height: 1.04; letter-spacing: -0.035em; text-wrap: balance; }

/* Earn: the rewards section, the one place amber leads */
.hm-earn { padding: 32px 24px; border-radius: var(--r-lg); background: var(--hm-tile); }
.hm-earn-head { display: grid; gap: 12px; }
.hm-earn-big { font-size: 17px; font-weight: 700; color: var(--text); }
.hm-earn-big strong { display: block; font-size: clamp(56px, 16vw, 120px); font-weight: 800; line-height: .95; letter-spacing: -0.045em; white-space: nowrap; }
.hm-earn-big strong span { font-size: .3em; letter-spacing: -0.01em; }
.hm-ladder { list-style: none; padding: 0; margin-top: 32px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; }
.hm-ladder li { display: grid; gap: 12px; align-content: start; }
.hm-ladder .hex {
  width: 64px; height: 74px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) calc(35% + var(--step) * 22%), var(--surface));
  color: var(--text); font-size: 20px; font-weight: 800;
}
.hm-ladder li:nth-child(n+3) .hex { color: var(--on-accent); }
.hm-ladder li > span:last-child { display: grid; gap: 2px; font-size: 15px; line-height: 1.45; color: var(--muted); }
.hm-ladder strong { font-size: 17px; color: var(--text); }

/* Businesses */
.hm-biz { display: grid; gap: 16px; padding: 24px; border-radius: var(--r-lg); background: var(--hm-tile); }
.hm-biz > .hex { width: 48px; height: 55px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); }
.hm-biz h2 { font-size: 20px; letter-spacing: -0.02em; }
.hm-biz p { margin-top: 4px; font-size: 15px; color: var(--muted); }
.hm-biz .btn { justify-self: start; }

/* Closing call: the band again, with Josh's photo under a shade */
.hm-final { position: relative; isolation: isolate; overflow: hidden; display: grid; justify-items: start; align-content: end; gap: 10px; min-height: 340px; padding: 40px 40px; }
.hm-final h2 { font-size: clamp(32px, 9.4vw, 72px); line-height: 1; letter-spacing: -0.04em; }
.hm-final p { font-size: 16px; color: var(--on-panel-muted); }
.hm-final .btn { margin-top: 10px; }
.hm-final-photo > img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 55% 30%; }
.hm-final-photo::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--photo-shade); }
.hm-final-photo, .hm-final-photo p { color: var(--on-photo); }

/* ---------- Motion (home.js adds .hm-motion only without reduced motion) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hm-cell-photo { animation: hm-shutter 1.1s var(--hm-ease) both; }
  .hm-cell-photo img { animation: hm-settle 1.6s var(--hm-ease) both; }
  .hm-cell-back { animation: hm-back .9s .25s var(--hm-ease) both; }
  .hm-try { animation: hm-rise .8s .5s var(--hm-ease) both; }
  .hm-try-card.is-new { animation: hm-swap .35s var(--hm-ease); }
}
@keyframes hm-shutter {
  from { clip-path: polygon(50% 100%, 100% 100%, 100% 100%, 50% 100%, 0 100%, 0 100%); }
  to   { clip-path: var(--hm-hex); }
}
@keyframes hm-settle { from { transform: scale(1.14); } to { transform: none; } }
@keyframes hm-back { from { opacity: 0; transform: translate(-4%, 0); } }
@keyframes hm-rise { from { opacity: 0; transform: translateY(24px); } }
@keyframes hm-swap { from { opacity: .3; transform: translateY(6px); } }
.hm-motion .hm-reveal > *, .hm-motion .hm-phones-copy > *, .hm-motion .hm-night-in > *, .hm-motion .hm-prob {
  opacity: 0; transform: translateY(24px);
  transition: opacity .6s var(--hm-ease), transform .6s var(--hm-ease);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.hm-motion .hm-reveal > .hm-phones-copy, .hm-motion .hm-reveal > .hm-night-in, .hm-motion .hm-reveal > .hm-stats, .hm-motion .hm-probs { opacity: 1; transform: none; }
.hm-motion .hm-reveal.is-in > *, .hm-motion .hm-reveal.is-in .hm-phones-copy > *,
.hm-motion .hm-reveal.is-in .hm-night-in > *, .hm-motion .hm-reveal.is-in .hm-prob { opacity: 1; transform: none; }
.hm-motion .hm-comb-cell { opacity: 0; transform: scale(.82); transition: opacity .5s var(--hm-ease), transform .6s var(--hm-ease); transition-delay: calc(var(--c, 0) * 90ms + 150ms); }
.hm-motion .hm-reveal.is-in .hm-comb-cell { opacity: 1; transform: none; }
.hm-motion .hm-final-photo > img { transform: scale(1.08); transition: transform 1.6s var(--hm-ease), opacity .6s; }
.hm-motion .hm-final-photo.is-in > img { transform: none; }

@media (min-width: 560px) {
  .hm-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 30px 48px; }
  .hm-stats div { display: grid; gap: 6px; }
  .hm-stats strong { font-size: clamp(36px, 6vw, 88px); }
  .hm-trust { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hm-tile-head { grid-column: 1 / -1; }
  .hm-comb { --w: 150px; }
  .hm-comb-word strong { font-size: 22px; }
  .hm-comb-join span { display: block; }
}
@media (min-width: 760px) {
  .home { --hm-pt: 48px; }
  /* A staircase: each step starts a little higher than the one before */
  .hm-ladder { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 40px; }
  .hm-ladder li { padding-top: calc((3 - var(--step)) * 36px); }
  .hm-ladder .hex { width: 76px; height: 88px; font-size: 24px; }
  .hm-earn { padding: 48px; }
  .hm-biz { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 24px; padding: 28px 32px; }
  .hm-final { min-height: 420px; padding: 64px 96px; }
}
@media (min-width: 960px) {
  .hm-main { gap: 150px; padding-top: 140px; }
  .hm-text { font-size: 18px; }
  .hm-stats { padding: 40px 96px; }
  .hm-stats span { font-size: 17px; }
  .hm-night { padding: 0 20px 140px; }
  .hm-stats + .hm-night-in { margin-top: -16px; }
  .hm-probs { margin-top: 40px; gap: 4px; }
  .hm-prob { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px; align-items: baseline; padding: 26px 20px; margin: 0 -20px; }
  .hm-prob strong { font-size: clamp(30px, 3.2vw, 40px); }
  .hm-prob p { font-size: 18px; }

  .hm-study { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 72px; align-items: start; }
  .hm-courses { padding: 28px; }

  .hm-phones {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 64px; align-items: center;
    grid-template-areas: "s h" "s t" "s tabs";
  }
  .hm-phones .hm-h2 { align-self: end; }
  .hm-stage { min-height: 600px; margin: 0; }
  .hm-stage-cell { width: 440px; }
  .hm-phone { width: 250px; border-radius: 36px; }
  .hm-tabs { align-self: start; margin-top: 28px; }
  .hm-tab { font-size: 18px; }

  .hm-earn-head { grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 32px; }
  .hm-hive { grid-template-columns: minmax(0, 3fr) minmax(0, 7fr); align-items: center; gap: 48px; margin: 0; padding: 0; overflow: visible; }
  .hm-comb { --w: 200px; justify-self: end; }
  .hm-comb-word strong { font-size: 28px; }
  .hm-comb-word span { font-size: 15px; }

  .hm-trust { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); grid-auto-rows: auto; }
  .hm-tile-head { grid-column: 1; grid-row: 1 / 4; min-height: 360px; padding: 36px; }
  .hm-trust > .hm-tile:not(.hm-tile-head) { grid-column: 2; display: grid; align-content: center; padding: 26px 28px; }
}
@media (min-width: 1100px) {
  .hm-hero { display: flex; align-items: center; min-height: clamp(640px, calc(100svh - 64px), 820px); padding: 40px 0 120px; }
  .hm-hero-in { width: 100%; padding: 0 20px; }
  .hm-hero-copy { max-width: 580px; }
  .hm-hero h1 { font-size: clamp(64px, 5.6vw, 84px); }
  .hm-lead { margin-top: 24px; font-size: 18px; max-width: 38ch; }
  .hm-cell { position: absolute; inset: 0; margin: 0; padding: 0; overflow: visible; pointer-events: none; }
  .hm-cell-in {
    position: absolute; left: auto; right: calc(-1 * clamp(60px, 7vw, 160px)); top: 50%;
    width: clamp(600px, 52vw, 860px); margin: 0; transform: translateY(-64%);  /* lifted: the faces sit above the course card */
  }
  /* The photo is cut wide: show its left part, so the laptop lands right of the card */
  .hm-cell-photo img { object-position: 0% 50%; }
  .hm-cell-back { transform: translate(-12%, 9%); }
  /* The card sits on the lower left of the cell, clear of the words */
  .hm-try {
    position: absolute; z-index: 2; bottom: 88px; width: 340px; max-width: none; margin: 0; pointer-events: auto;
    right: calc(clamp(600px, 52vw, 860px) - clamp(60px, 7vw, 160px) - 380px);
  }
}
@media (min-width: 1280px) {
  /* Room to spare: the card straddles the cell's left edge, half on the indigo, clear of the faces */
  .hm-try { right: calc(clamp(600px, 52vw, 860px) - clamp(60px, 7vw, 160px) - 300px); }
}

/* ============================================
   CONSENT, DELETE AND ADMIN PAGES
   ============================================ */
.btn-danger { background: var(--danger-soft); color: var(--text); border-color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: var(--danger); color: var(--on-primary); }

.lead { margin: -12px 0 20px; color: var(--muted); }
.done-state { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 12px 0; }
.done-state h1 { margin: 0; }
.done-state p { color: var(--muted); max-width: 36ch; text-wrap: balance; }
.done-state .btn { margin-top: 12px; }

.facts { display: grid; gap: 1px; margin-bottom: 24px; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; background: var(--border); }
.facts div { display: grid; gap: 2px; padding: 10px 14px; background: var(--surface); }
.facts dt { font-size: var(--fs-sm); color: var(--muted); }
.facts dd { font-weight: 700; overflow-wrap: anywhere; }
.panel-h2 { margin-bottom: 10px; }
.tick-list { display: grid; gap: 10px; list-style: none; padding: 0; font-size: var(--fs-sm); }
.tick-list + .panel-h2 { margin-top: 20px; }   /* the second heading on the parent page sat on the list above */
.tick-list li { display: flex; gap: 10px; align-items: flex-start; }
.tick-list .icon { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; color: var(--success); }
.consent-actions { margin-top: 24px; gap: 10px; }
code { font-size: .92em; padding: 1px 5px; border-radius: 6px; background: var(--primary-soft); }

/* Delete link under the joined state */
.wl-delete { width: 100%; margin-top: 10px; }
.wl-delete summary { color: var(--muted); font-weight: 400; }
.wl-delete form { display: grid; justify-items: center; gap: 10px; padding-bottom: 4px; }

/* Admin */
.adm { display: grid; gap: 28px; max-width: 760px; margin: 0 auto; padding: 16px 16px 48px; }
.adm-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.adm-top h1 { flex: 1 1 auto; }
.adm-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.adm-stats .card { display: grid; gap: 2px; padding: 12px 14px; }
.adm-stats strong { font-size: var(--fs-xl); font-weight: 800; line-height: 1.1; }
.adm-stats span { font-size: var(--fs-sm); color: var(--muted); }
.adm-stats .card:last-child:nth-child(odd) { grid-column: 1 / -1; }
.adm-list { display: grid; gap: 10px; list-style: none; padding: 0; }
.adm-item { display: grid; gap: 12px; }
/* adminOpenChat(): the one-tap "Open WhatsApp" after a send */
.adm-chat { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; border-left: 4px solid var(--primary); }
.adm-chat .btn { flex: 0 0 auto; }
.adm-item .alert { margin: 0; }
.adm-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.adm-head strong { overflow-wrap: anywhere; }
.adm-head .badge { flex-shrink: 0; padding-left: 10px; }
.adm-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; font-size: var(--fs-sm); }
.adm-meta dt { color: var(--muted); }
.adm-meta dd { overflow-wrap: anywhere; }
.adm-vouch { font-size: var(--fs-sm); display: grid; gap: 6px; }
.adm-vouch ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.adm-vouch li { display: flex; gap: 6px; align-items: flex-start; color: var(--muted); }
.adm-vouch li .icon { flex: none; width: 16px; height: 16px; margin-top: 2px; }
.adm-vouch li.adm-vouch-yes { color: var(--success); }
.adm-vouch li.adm-vouch-no { color: var(--danger); }
.adm-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.adm-search { display: flex; gap: 8px; }
.adm-search .btn { flex-shrink: 0; width: 48px; padding: 0; }
.adm-note { margin-top: 10px; font-size: var(--fs-sm); }
.adm-item .adm-note { margin-top: -6px; }
/* Growth → Rewards due (ADM6): one section with several short lists. */
.adm-rewards { display: grid; gap: 10px; }
.adm-rewards > .section-head { margin-bottom: 2px; }
.adm-rewards > h3.section-head { margin: 14px 0 0; }
.adm-nowrap { white-space: nowrap; flex-shrink: 0; }
.adm-test { display: flex; flex-wrap: wrap; gap: 8px; }
.adm-test .input { flex: 1 1 200px; }
.adm-errors { display: grid; gap: 4px; padding-left: 18px; overflow-wrap: anywhere; }
.adm-item > .btn-ghost { justify-self: start; }
.adm-sub { margin: 18px 0 10px; }
.adm-msg { border-color: var(--primary); }
.adm-msg textarea { min-height: 10rem; font-size: var(--fs-sm); resize: vertical; }

/* Admin control room shell (ADM1: includes/layout/adm_shell_top.php). Side menu on wide screens,
   a drawer from the left on phones; search in the top bar from 768px, a search page below that. */
.adm-bar {
  position: sticky; top: 0; z-index: 60;
  height: var(--header-h);
  display: flex; align-items: center; gap: 6px;
  padding: 0 max(8px, env(safe-area-inset-right, 0px)) 0 max(8px, env(safe-area-inset-left, 0px));
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.adm-brand { margin-right: auto; gap: 6px; }
.adm-brand .wordmark { font-size: 17px; }
.adm-tag { padding: 2px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-text); font-size: 12px; font-weight: 700; }
.adm-bar-search { display: none; }
.adm-frame { display: flex; min-height: calc(100vh - var(--header-h)); }
.adm-content { flex: 1; min-width: 0; }
.adm-side {
  position: fixed; top: var(--header-h); bottom: 0; left: 0; z-index: 55;
  width: min(280px, 86vw); overflow-y: auto;
  padding: 16px 12px calc(24px + env(safe-area-inset-bottom, 0px));
  background: var(--surface); border-right: 1px solid var(--border);
  transform: translateX(-102%); transition: transform .2s ease; visibility: hidden;
}
.adm-side.is-open { transform: none; visibility: visible; box-shadow: var(--shadow-lift); }
.adm-scrim { position: fixed; inset: var(--header-h) 0 0 0; z-index: 54; background: var(--scrim); }
.adm-locked { overflow: hidden; }
.adm-side .side-link { position: relative; }
.adm-side-label { flex: 1; }
.adm-who { display: flex; align-items: center; gap: 10px; padding: 4px 12px 16px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.adm-who > span:last-child { display: grid; min-width: 0; }
.adm-who strong, .adm-who .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-who .muted { font-size: 12px; }
.adm-count {
  min-width: 24px; padding: 1px 7px; border-radius: 999px; text-align: center;
  background: var(--primary-soft); color: var(--primary-text); font-size: 12px; font-weight: 700;
}
.adm-count.is-urgent { background: var(--danger); color: var(--on-primary); }
.adm-soon { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 0 7px; }
.adm-side .side-link:not([aria-current]) .adm-soon { opacity: .8; }
@media (min-width: 768px) {
  .adm-menu-btn, .adm-search-link, .adm-scrim { display: none !important; }
  .adm-bar { padding: 0 16px; gap: 12px; }
  .adm-brand { margin-right: 0; width: 220px; }
  .adm-bar-search { display: flex; align-items: center; gap: 4px; flex: 1; max-width: 460px; margin-right: auto; }
  .adm-bar-search .input { min-height: 40px; padding-top: 6px; padding-bottom: 6px; }
  .adm-side {
    position: sticky; top: var(--header-h); z-index: auto; flex-shrink: 0;
    width: 240px; height: calc(100vh - var(--header-h));
    transform: none; visibility: visible; box-shadow: none; transition: none;
  }
  .adm-content .adm { padding: 28px 32px 48px; }
}
.adm-content .adm { max-width: 820px; margin: 0; }

/* Dashboard, search and log */
.adm-clock { display: flex; align-items: center; gap: 10px; color: var(--text); }
.adm-clock:hover { text-decoration: none; }
.adm-clock span { flex: 1; }
.adm-clock .icon { flex-shrink: 0; width: 18px; height: 18px; }
.adm-queue { list-style: none; padding: 0; overflow: hidden; }
.adm-queue li + li { border-top: 1px solid var(--border); }
.adm-queue a { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; color: var(--text); }
.adm-queue a:hover { text-decoration: none; background: var(--primary-soft); }
.adm-queue a > .icon { flex-shrink: 0; width: 16px; height: 16px; color: var(--muted); transform: rotate(-90deg); }
.adm-queue-ico { flex-shrink: 0; width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--primary-soft); color: var(--primary-text); }
.adm-queue-ico .icon { width: 18px; height: 18px; }
.adm-queue-label { flex: 1; min-width: 0; display: grid; overflow-wrap: anywhere; }
.adm-queue-label small { color: var(--muted); font-size: 12px; }
.adm-small { font-size: var(--fs-sm); }
/* Settings (ADM4b) */
.adm-dot { display: inline-block; flex-shrink: 0; width: 9px; height: 9px; margin-left: 6px; border-radius: 50%; background: var(--danger); vertical-align: middle; }
.chip .adm-dot { margin-left: 6px; }
.adm-set-alert { display: grid; gap: 6px; }
.ast-card { scroll-margin-top: calc(var(--header-h) + 12px); }
.ast-meta .ast-wide { grid-column: 1 / -1; }
.ast-form { gap: 14px; }
.ast-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ast-row { display: grid; gap: 8px; padding: 10px 0; border-top: 1px solid var(--border); }
.ast-row:first-of-type { border-top: 0; padding-top: 0; }
.ast-row-ladder { grid-template-columns: 1fr 1fr; align-items: end; }
.ast-row-ladder .field:nth-child(1) { grid-area: 1 / 1; }
.ast-row-ladder .field:nth-child(2) { grid-area: 2 / 1 / 3 / 3; }
.ast-row-ladder .field:nth-child(3) { grid-area: 1 / 2; }
.ast-meta dd { white-space: pre-line; }
.ast-row-pair { grid-template-columns: 1fr 1fr; }
.ast-row-ladder .field label { font-size: 12px; }
textarea.ast-lines { min-height: 8rem; resize: vertical; font-size: var(--fs-sm); line-height: 1.5; }
.ast-reached { display: grid; gap: 6px; padding: 12px; border-radius: var(--r-sm); background: var(--primary-soft); }
.ast-reached ul { list-style: none; padding: 0; display: grid; gap: 4px; font-size: var(--fs-sm); }
.ast-reached li { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ast-sched { display: grid; gap: 8px; }
.ast-sched form { justify-self: start; }
.ast-history { list-style: none; padding: 0; display: grid; gap: 14px; }
.ast-history li { display: grid; gap: 4px; padding-top: 14px; border-top: 1px solid var(--border); min-width: 0; }
.ast-history li:first-child { padding-top: 0; border-top: 0; }
.ast-hist-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.ast-hist-value { overflow-wrap: anywhere; white-space: pre-line; }
.ast-restore { display: grid; gap: 8px; margin-top: 6px; }
.ast-restore .btn { justify-self: start; }
.ast-choice { display: grid; gap: 10px; }
.ast-choice .seg-3 { grid-template-columns: 1fr 1.6fr 1fr; }
.ast-choice .seg label { font-size: var(--fs-sm); text-align: center; padding: 0 6px; }
.ast-card .adm-head { flex-wrap: wrap; }
.ast-card .adm-head strong { flex: 1 1 9rem; overflow-wrap: normal; }
.ast-state { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.ast-state::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--success); }
.ast-state-paused::before { background: var(--accent); }
.ast-state-off::before, .ast-state-hidden::before { background: var(--danger); }
.ast-maint { display: grid; gap: 12px; }
/* Switches (ADM4c): the red bar staff see while maintenance is on, and the "Paused for now" bar on a page. */
.maint-bar { padding: 8px 16px; text-align: center; font-size: var(--fs-sm); font-weight: 700; background: var(--danger-soft); border-bottom: 3px solid var(--danger); color: var(--text); overflow-wrap: anywhere; }
.pause-bar { display: grid; gap: 2px; margin-bottom: 12px; font-size: var(--fs-sm); }
.pause-bar strong { font-size: var(--fs-body); }
/* Emergency buttons (ADM4d): the red bar staff see, the notice students see (a .pause-bar), the Emergency cards. */
.emg-bar { border-top: 3px solid var(--danger); border-bottom-width: 3px; }
.emg-bar a { color: inherit; text-decoration: underline; }
.emg-notice { margin: 0; border-radius: 0; }
.emg-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.emg-list li { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; min-width: 0; }
.emg-list li > span { overflow-wrap: anywhere; min-width: 0; }
.ast-lock { display: grid; gap: 10px; padding: 12px 0; border-top: 1px solid var(--border); }
.ast-lock h3 { font-size: var(--fs-body); }
/* Content (ADM5b): the list of texts, the edit card, counters, the 360px preview frame, the FAQ editor, and the
   "Preview, not live" bar an Owner sees on a page. */
.cnt-row { display: grid; gap: 4px; color: var(--text); min-width: 0; }
.cnt-row:hover { text-decoration: none; border-color: var(--primary); }
.cnt-row[aria-current="true"] { border-color: var(--primary); }
.cnt-row-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.cnt-row-head strong { flex: 1 1 10rem; }
.cnt-snip { overflow-wrap: anywhere; }
.cnt-edit { scroll-margin-top: calc(var(--header-h) + 12px); }
.cnt-count { display: block; text-align: right; margin-top: 4px; }
.cnt-count.cnt-over { color: var(--danger); font-weight: 700; }
/* Content → Daily lines (Home v2a) */
.badge-hot { background: var(--primary-soft); color: var(--primary-text); }
.ln-days { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: var(--fs-sm); }
.ln-days li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 8px; overflow-wrap: anywhere; }
.ln-days li:first-child { font-weight: 700; }
.ln-days .badge { margin-left: 6px; }
.ln-day { color: var(--muted); }
.ln-close { margin-left: auto; }
.ln-add > summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.ln-filter { display: flex; flex-wrap: wrap; gap: 8px; }
.ln-filter .input[type=search] { flex: 1 1 12rem; }
.ln-filter .select { flex: 1 1 8rem; width: auto; }
.ln-hidden .cnt-snip { color: var(--muted); text-decoration: line-through; }
.cnt-body { font-family: inherit; line-height: 1.5; }
.cnt-prev { display: grid; gap: 8px; }
.cnt-prev-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.cnt-theme { min-width: 10rem; }
.cnt-frame { display: block; width: 100%; max-width: 360px; min-height: 120px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--bg); }
/* Admin → Content → Flyers (migration 109) */
.fl-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; }
.fl-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0 12px; }
.fl-set { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 6px; }
.fl-set legend { padding: 0; margin-bottom: 6px; font-size: var(--fs-sm); font-weight: 700; color: var(--text); }
.fl-set legend .opt { font-weight: 400; color: var(--muted); }
.fl-set .cnt-hide { font-weight: 400; }
.fl-levels { display: flex; flex-wrap: wrap; gap: 6px; }
.fl-levels .chip { cursor: pointer; }
.fl-frame { height: 420px; }
.fl-row { display: flex; align-items: center; gap: 12px; }
.fl-row-body { display: grid; gap: 2px; min-width: 0; }
.fl-thumb { flex: none; width: 48px; height: 48px; border-radius: var(--r-sm); object-fit: cover; }
.fl-thumb-none { display: grid; place-items: center; width: 44px; height: 50px; border-radius: 0; background: var(--primary-soft); color: var(--primary-text); }
.fl-thumb-none .icon { width: 22px; height: 22px; }
.cnt-faq { list-style: none; padding: 0; display: grid; gap: 10px; }
.cnt-faq-row { display: grid; grid-template-columns: auto 1fr; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-sm); min-width: 0; }
.cnt-faq-move { display: grid; gap: 4px; align-content: start; }
.cnt-faq-body { display: grid; gap: 8px; min-width: 0; }
.cnt-faq-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.cnt-faq-head .select { width: auto; flex: 1 1 9rem; }
.cnt-faq-locked { opacity: .8; overflow-wrap: anywhere; }
.cnt-hide { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); }
.cnt-faq-read { padding-left: 18px; display: grid; gap: 10px; overflow-wrap: anywhere; }
.cnt-skel-a { width: 55%; }
.cnt-live-bar.maint-bar { display: block; background: var(--primary-soft); border-bottom-color: var(--primary); }
.cnt-live-bar.maint-bar a { color: inherit; text-decoration: underline; }
/* Site banner (ADM5c): under the header (and under the emergency notice). Info = indigo; Warning = amber border,
   never red (red stays for emergencies). The admin preview draws the same markup. */
.site-banner { display: flex; align-items: flex-start; gap: 8px; padding: 10px 8px 10px 16px; font-size: var(--fs-sm); color: var(--text); background: var(--primary-soft); border-bottom: 3px solid var(--primary); overflow-wrap: anywhere; }
.site-banner p { flex: 1; min-width: 0; margin: 0; align-self: center; }
.site-banner a { color: inherit; font-weight: 700; text-decoration: underline; }
.site-banner-warning { background: var(--accent-soft); border-bottom-color: var(--accent); border-left: 4px solid var(--accent); }
.site-banner-x { flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 22px; line-height: 1; cursor: pointer; }
.site-banner-x:hover, .site-banner-x:focus-visible { background: var(--surface); }
.bnr-frame { min-height: 80px; }
/* Legal versions (ADM5d): the "Our Terms change on ..." bar with "Got it" (under the emergency notice, above the
   site banner), the notes on the legal pages, "Earlier versions", and the draft in Admin → Content → Legal. */
.legal-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 10px 16px; font-size: var(--fs-sm); color: var(--text); background: var(--primary-soft); border-bottom: 3px solid var(--primary); overflow-wrap: anywhere; }
.legal-bar p { flex: 1 1 14rem; min-width: 0; margin: 0; }
.legal-bar a { color: inherit; font-weight: 700; text-decoration: underline; }
.legal-note { margin: 0 0 16px; }
.legal-note a { font-weight: 700; }
.legal-versions ul { display: grid; gap: 8px; }
.lgl-draft { max-height: 420px; overflow: auto; padding: 0 4px; border: 1px solid var(--border); border-radius: var(--r-sm); }
.lgl-card { scroll-margin-top: calc(var(--header-h) + 12px); }
.adm-log { list-style: none; padding: 0; overflow: hidden; }
.adm-log li { display: grid; gap: 2px; padding: 12px 14px; font-size: var(--fs-sm); min-width: 0; }
.adm-log li + li { border-top: 1px solid var(--border); }
.adm-log-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.adm-log-action { font-weight: 700; color: var(--primary-text); overflow-wrap: anywhere; }
.adm-log-sum { overflow-wrap: anywhere; }
.adm-log-detail summary { cursor: pointer; color: var(--muted); }
.adm-log-detail pre { margin-top: 6px; padding: 10px; max-height: 320px; overflow: auto; border-radius: var(--r-sm); background: var(--bg); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.adm-roles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.adm-role-help { display: grid; gap: 4px; padding-left: 18px; font-size: var(--fs-sm); }
.adm-mini { display: grid; gap: 4px; padding-left: 18px; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.adm-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; padding-left: 24px; }
.adm-codes code { font-size: var(--fs-body); letter-spacing: .04em; }

/* People (admin → People, ADM3) */
.ppl { display: grid; gap: 18px; }
.ppl > p { margin: 0; }
.ppl-name { font-size: var(--fs-lg); overflow-wrap: anywhere; }
.ppl-who .adm-actions { margin-top: 2px; }
.ppl-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ppl-stats span { overflow-wrap: anywhere; }
.ppl-do { display: grid; gap: 10px; }
.ppl-do > .section-head { margin-bottom: 0; }
.ppl-do .mk-more-body > form { display: grid; gap: 10px; }
.ppl-do .mk-more-body > form + form { padding-top: 12px; border-top: 1px solid var(--border); }
.ppl-note { white-space: normal; }
.ppl-note-form { margin-top: 12px; }
.ppl .adm-log form { margin-top: 4px; }
.ppl .adm-item > details.mk-more { margin-top: 2px; }
@media (max-width: 479px) { .ppl .sa-grid { grid-template-columns: 1fr; } }
@media (min-width: 560px) { .ppl-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Admin sign-in */
.adm-signin { display: grid; gap: 16px; }
.adm-signin .form { margin: 0; }
.adm-signin-alt { text-align: center; }
.adm-code { font-size: var(--fs-lg); letter-spacing: .2em; text-align: center; }
.adm-steps { display: grid; gap: 6px; padding-left: 20px; font-size: var(--fs-sm); }
.adm-qr { justify-self: center; width: 208px; padding: 8px; border-radius: var(--r-md); background: var(--print-paper); color: var(--print-ink); }
.adm-qr .qr { display: block; width: 100%; height: auto; }
.adm-qr .qr-bg { fill: var(--print-paper); }
.adm-key { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; font-size: var(--fs-sm); }
.adm-key code { font-size: var(--fs-body); letter-spacing: .06em; overflow-wrap: anywhere; }
.adm-open-app { justify-self: center; }
@media (min-width: 768px) { .adm-open-app { display: none; } }

/* Study Hub admin (admin_study.php) */
.sa .chips { margin: 0; padding: 0 0 2px; }
.sa textarea.input { min-height: 5.5rem; resize: vertical; line-height: 1.5; }
.sa-lines { font-family: ui-monospace, Consolas, monospace; font-size: var(--fs-sm); }
.sa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.sa-grid > *, .sa .adm-search .select { min-width: 0; }
.sa-grid .input, .sa-grid .select { width: 100%; min-width: 0; }
.sa .adm-search .select { flex: 1; }
.sa-filters { display: grid; gap: 10px; margin-bottom: 12px; }
.sa-title { font-weight: 400; }
.sa-meta { font-size: var(--fs-sm); overflow-wrap: anywhere; }
.sa-warn { color: var(--danger); }
/* My school queues (includes/layout/sa_school.php) */
.sa-item { display: grid; gap: 4px; min-width: 0; }
.sa-item-title { font-weight: 700; overflow-wrap: anywhere; }
.sa-item-desc { font-size: var(--fs-sm); overflow-wrap: anywhere; }
.sa-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 6px; margin-top: 4px; }
.sa-photos a { display: block; aspect-ratio: 3 / 4; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--border); }
.sa-photos img { width: 100%; height: 100%; object-fit: cover; }
.sa-pair { display: grid; gap: 14px; }
/* Reports and takedowns (admin_study.php → Reports, S5) */
.sa-clock { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--primary-soft); color: var(--primary-text); }
.sa-clock .icon { width: 13px; height: 13px; }
.sa-clock.red { background: var(--danger-soft); color: var(--danger); }
.sa-clock.paused { background: var(--border); color: var(--muted); }
.sa-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.sa-reports { display: grid; gap: 6px; margin: 4px 0 0; padding: 0; list-style: none; font-size: var(--fs-sm); }
.sa-reports li { padding: 6px 10px; border-radius: var(--r-sm); background: var(--bg); overflow-wrap: anywhere; }
.sa-targets { display: grid; gap: 8px; margin: 4px 0 0; padding: 0; list-style: none; }
.sa-targets li { display: grid; gap: 4px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r-sm); min-width: 0; overflow-wrap: anywhere; }
.sa-targets .badge { justify-self: start; }
.sa-mail { display: grid; gap: 6px; margin-top: 6px; }
.sa-mail textarea { font-size: 13px; min-height: 120px; }
.sa-mail .adm-actions { margin: 0; }
.sa-quote { padding: 8px 12px; border-left: 3px solid var(--primary); background: var(--bg); border-radius: 0 var(--r-sm) var(--r-sm) 0; overflow-wrap: anywhere; white-space: pre-line; }
@media (min-width: 720px) { .sa-pair { grid-template-columns: 1fr 1fr; } }
.sa-check { min-height: 48px; align-items: center; }
/* Campus Guide admin (admin_guide.php): Leaflet map for pins and the campus area */
.ga-map { position: relative; isolation: isolate; height: 300px; margin-top: 8px; border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; background: var(--bg); }
.ga-map-tall { height: 380px; }
.ga-map .leaflet-control-attribution { font-size: 11px; }
[data-theme="dark"] .ga-map .leaflet-control-attribution { background: var(--surface); color: var(--muted); }
[data-theme="dark"] .ga-map .leaflet-control-attribution a { color: var(--primary-text); }
.ga-pin-tools { margin-top: 8px; }
/* D8 Pin here: the live accuracy line (grey dot waiting, hollow dot too rough, green ready, red only when location is off). */
.ga-here .form { display: grid; gap: 12px; }
.ga-here-fix { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--bg); font-weight: 700; }
.ga-here-dot { flex-shrink: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); }
.ga-here-fix[data-state="good"] .ga-here-dot { background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.ga-here-fix[data-state="rough"] .ga-here-dot { background: none; border: 2px solid var(--muted); }
.ga-here-fix[data-state="off"] .ga-here-dot { background: var(--danger); }
.ga-here-fix[data-state="off"] { color: var(--danger); font-weight: 400; }
.ga-here .adm-actions .btn { min-height: 48px; }
.ga-set { border: 0; margin: 0; padding: 0; min-width: 0; }
.ga-set legend { padding: 0; margin-bottom: 6px; font-weight: 700; font-size: var(--fs-sm); }
.ga-tags { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.ga-contact { margin-top: 10px; }
.ga-stage-h { list-style: none; margin-top: 8px; font-size: var(--fs-sm); font-weight: 700; color: var(--muted); }
.ga-bulk { display: grid; gap: 10px; justify-items: start; margin-bottom: 12px; }
.ga-move { margin: 4px 0; }
.ga-del { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.ga details > summary { list-style: none; cursor: pointer; justify-self: start; }
.ga details > summary::-webkit-details-marker { display: none; }
.sa-rows { display: grid; list-style: none; padding: 0; font-size: var(--fs-sm); }
.sa-rows li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.sa-rows li:first-child { border-top: 0; }
.sa-rows.card { padding: 4px 16px; }
.sa-rows .badge, .sa-rows form { flex-shrink: 0; }
.sa-fold summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
/* Papers (S6): one paper beside its photos */
.sa-paper { display: grid; gap: 16px; align-items: start; }
.sa-paper > * { min-width: 0; }
.sa-paper-photos .sa-photos { grid-template-columns: 1fr; }
.sa-paper-photos .sa-photos a { aspect-ratio: auto; }
.sa-paper-photos .sa-photos img { height: auto; object-fit: contain; }
.sa-qform { padding-top: 8px; }
.sa-opts { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; min-width: 0; }
.sa-opt { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.sa-opt .input { flex: 1; min-width: 0; }
.sa-inline { display: inline; }
@media (min-width: 1000px) {
  .sa-paper { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sa-paper-photos { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
}
.sa-faculties { display: grid; gap: 2px; padding: 8px 16px; }
.sa-plain { list-style: none; padding: 0 0 8px 12px; font-size: var(--fs-sm); color: var(--muted); display: grid; gap: 4px; }
.sa-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.sa-link { color: var(--text); }
.sa-link:hover { text-decoration: none; border-color: var(--primary); }
.sa-outline { display: grid; gap: 8px; list-style: none; padding: 0; margin-bottom: 12px; }
.sa-topic { padding: 0; }
.sa-topic summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; cursor: pointer; list-style: none; }
.sa-topic summary::-webkit-details-marker { display: none; }
.sa-topic details[open] summary { border-bottom: 1px solid var(--border); }
.sa-topic details > form, .sa-topic details > .adm-actions { padding: 12px 16px; }
.sa-topic details > .adm-actions { padding-top: 0; }
.sa-topic-title { overflow-wrap: anywhere; }
.sa-child { margin-left: 20px; }
.sa-merge { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sa-merge .card { display: grid; gap: 2px; padding: 12px 14px; overflow-wrap: anywhere; }
.sa-pager { margin-top: 12px; }
.sa-topics { display: grid; gap: 6px; border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 14px 12px; margin: 0; min-width: 0; }
.sa-topics legend { padding: 0 4px; font-size: var(--fs-sm); font-weight: 600; }
.sa-topics .sa-fold > .check { display: flex; padding: 4px 0 4px 8px; font-size: var(--fs-sm); }
.sa-publish { padding: 12px; border: 1px solid var(--primary); border-radius: var(--r-md); }
.sa-publish .btn { justify-self: start; }
/* Fast Library check: two big thumb buttons under the link */
.sa-check { gap: 12px; grid-template-columns: minmax(0, 1fr); }
.sa-check .adm-head { flex-wrap: wrap; }
.sa-check-open { min-height: 52px; }
.sa-check-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sa-check-actions .btn { min-height: 56px; font-size: var(--fs-md, 1rem); font-weight: 700; }
.sa .alert.sa-block { display: block; overflow-wrap: anywhere; }   /* text with links and bold inside: one flowing line */
.sa-meta a { overflow-wrap: anywhere; }

/* Library bulk accept (sa_library_bulk.php) */
.sa-bulk-panel { display: grid; gap: 12px; margin-bottom: 16px; border-color: var(--primary); }
.sa-bulk-samples { list-style: none; padding: 0; display: grid; gap: 8px; }
.sa-bulk-samples li, .sa-bulk-sources li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border-radius: var(--r-sm); background: var(--bg);
}
.sa-bulk-samples li > div, .sa-bulk-sources li > div { display: grid; gap: 2px; min-width: 0; font-size: var(--fs-sm); }
.sa-bulk-samples strong, .sa-bulk-sources strong { overflow-wrap: anywhere; }
.sa-bulk-samples .muted, .sa-bulk-sources .muted { font-size: 12px; }
.sa-bulk-samples li.is-opened { background: var(--success-soft); }
.sa-bulk-group { padding: 0; margin-bottom: 8px; }
.sa-bulk-group summary {
  display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px;
  cursor: pointer; list-style: none;
}
.sa-bulk-group summary::-webkit-details-marker { display: none; }
.sa-bulk-group summary > span:first-child { flex: 1; display: grid; }
.sa-bulk-group summary .muted { font-size: 12px; }
.sa-bulk-group summary > .icon { color: var(--muted); transition: transform .2s; }
.sa-bulk-group[open] summary > .icon { transform: rotate(180deg); }
.sa-bulk-n { text-align: right; font-size: var(--fs-sm); line-height: 1.3; }
.sa-bulk-all { margin: 0 14px 8px; }
.sa-bulk-sources { list-style: none; padding: 0 14px 14px; display: grid; gap: 6px; }
@media (min-width: 640px) {
  .adm { padding-top: 24px; }
  .adm-stats { grid-template-columns: repeat(5, 1fr); }
  .adm-stats .card:last-child:nth-child(odd) { grid-column: auto; }
  .adm-stats.adm-stats-3 { grid-template-columns: repeat(3, 1fr); }
  .adm-meta { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================
   LEGAL PAGES (privacy, terms)
   ============================================ */
.legal { width: 100%; max-width: 720px; margin: 0 auto; padding: 24px 20px 56px; }
.legal-head { margin-bottom: 20px; }
.legal-head p { margin-top: 6px; font-size: var(--fs-sm); color: var(--muted); }
.legal-short { margin-bottom: 32px; background: var(--primary-soft); border-color: transparent; }
.legal-short h2 { margin-bottom: 8px; }
.legal-short ul { display: grid; gap: 6px; padding-left: 20px; }
.legal section { padding-top: 24px; scroll-margin-top: 16px; }
.legal section + section { border-top: 1px solid var(--border); margin-top: 24px; }
.legal section h2 { margin-bottom: 10px; }
.legal section > * + * { margin-top: 10px; }
.legal section ul { display: grid; gap: 6px; padding-left: 20px; max-width: 65ch; }
.legal section a, .legal-short a { font-weight: 400; text-decoration: underline; }
.legal-table { display: grid; gap: 1px; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; background: var(--border); }
.legal-table div { display: grid; gap: 2px; padding: 10px 14px; background: var(--surface); }
.legal-table dt { font-weight: 700; }
.legal-table dd { color: var(--muted); }
.legal-foot { margin-top: 40px; font-size: var(--fs-sm); color: var(--muted); }
@media (min-width: 640px) {
  .legal { padding-top: 48px; }
  .legal-table div { grid-template-columns: 200px 1fr; gap: 16px; }
}
/* Copyright takedown form (copyright.php) */
.cr-form { display: grid; gap: 14px; }
.cr-form h2 { font-size: var(--fs-md, 1.05rem); margin-top: 6px; }
.cr-form h2:first-of-type { margin-top: 0; }
.legal-short code { font-size: .9em; background: var(--surface); padding: 0 4px; border-radius: 4px; }
.field-msg { margin-top: 4px; font-size: var(--fs-sm); color: var(--danger); }

/* ============================================
   LOST & FOUND
   ============================================ */
.lf { display: grid; gap: 16px; align-content: start; }
.lf-public { max-width: var(--page-max); margin: 0 auto; padding: 20px 16px 48px; }
.app-main.lf { max-width: 960px; }
.lf-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.lf-filters { gap: 10px; }
.lf-search { display: flex; gap: 8px; }
.lf-search .input { flex: 1; min-width: 0; }
.lf-search .btn { flex-shrink: 0; width: 48px; padding: 0; }
.lf-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lf-selects .select { padding-left: 12px; padding-right: 32px; }
.lf-selects .select:only-child { grid-column: 1 / -1; }

.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; display: inline-flex; align-items: center;
  min-height: var(--tap); padding: 0 16px; border-radius: 999px;
  background: var(--surface); border: 1.5px solid var(--border);
  font-size: var(--fs-sm); font-weight: 700; color: var(--muted);
}
.chip:hover { text-decoration: none; color: var(--text); border-color: var(--primary); }
.chip[aria-current="page"] { background: var(--primary-deep); border-color: transparent; color: var(--on-primary); }

.lf-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 10px; }
.lf-card {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px 12px 12px;
  text-align: left; color: var(--text); font: inherit; cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.lf-card:hover { text-decoration: none; border-color: var(--primary); box-shadow: var(--shadow-lift); }
.lf-card:active { transform: scale(.985); }
/* Hexagon thumbnail: the photo, or the category icon */
.lf-thumb {
  flex-shrink: 0; width: 60px; height: 68px; overflow: hidden;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary-text);
}
.lf-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lf-thumb .icon { width: 26px; height: 26px; }
.lf-body { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; }
/* "Who posted this" in a detail sheet (UH.person in app.js): opens their profile. */
.person-slot { margin: 14px 0; }
.person-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; color: var(--text); min-width: 0; }
.person-row:hover { text-decoration: none; border-color: var(--primary); }
.person-ava { flex: none; width: 40px; height: 46px; display: grid; place-items: center; overflow: hidden;
  background: var(--primary-soft); color: var(--primary-text); font-weight: 800; }
.person-ava img { width: 100%; height: 100%; object-fit: cover; }
.person-body { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: start; gap: 2px; }
.person-body strong, .person-sub { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-sub { font-size: 12px; color: var(--muted); }
.person-go { flex: none; font-size: var(--fs-sm); font-weight: 700; color: var(--primary-text); }
.lf-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.lf-title, .lf-place span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lf-title { font-weight: 700; line-height: 1.35; }
.lf-place { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: var(--fs-sm); color: var(--muted); }
.lf-place .icon { width: 14px; height: 14px; }
.lf-foot { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.lf-trust { display: inline-flex; align-items: center; gap: 4px; color: var(--text); font-weight: 700; }
.lf-trust .hex { width: 9px; height: 10px; background: var(--success); }
.lf-trust-gold .hex { background: var(--accent); }
.lf-trust-team .hex { background: var(--primary); }
.lf-type {
  display: inline-flex; align-items: center; padding: 1px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; color: var(--text); background: var(--primary-soft);
}
.lf-type-lost  { background: var(--danger-soft); }
.lf-type-found { background: var(--success-soft); }
.lf-type-back  { gap: 3px; background: var(--success-soft); }
.lf-type .icon { width: 12px; height: 12px; stroke-width: 2.6; }
.st-card-meta.tt-venue { display: inline-flex; align-items: center; gap: 4px; color: var(--primary-text); }
.tt-venue .icon { width: 14px; height: 14px; flex: none; }
.lf-more { justify-self: center; }
/* Lost & Found post sheet: the pin row and the "Mark as found" step (D2). */
.lf-pin { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.lf-pin-state { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--muted); }
.lf-pin-state .icon { width: 16px; height: 16px; color: var(--primary); }
.lf-pin-state.is-on { color: var(--text); font-weight: 600; }
.lf-found-ask { display: grid; gap: 10px; padding: 14px; margin-bottom: 12px; border-radius: var(--r-md); background: var(--success-soft); }
.lf-found-ask p { margin: 0; }
.lf-found-row { display: flex; gap: 8px; flex-wrap: wrap; }
.lf-found-row .btn { flex: 1 1 140px; }
.facts dd a { color: var(--primary-text); }

.lf-skel .lf-card { cursor: default; pointer-events: none; }
.lf-skel .lf-thumb { background: linear-gradient(90deg, var(--skeleton) 25%, var(--skeleton-shine) 50%, var(--skeleton) 75%); background-size: 200% 100%; }
.lf-skel .skeleton-line { height: 12px; }
.lf-skel .skeleton-line + .skeleton-line { margin-top: 6px; }
.lf-sheet-icon { width: 64px; height: 72px; display: grid; place-items: center; margin-bottom: 12px; background: var(--primary-soft); color: var(--primary-text); }
.lf-sheet-icon .icon { width: 30px; height: 30px; }

/* Detail sheet and post sheet */
.lf-sheet-photo { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--r-md); margin-bottom: 12px; }
.lf-sheet-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.lf-sheet h2 { margin-bottom: 8px; overflow-wrap: anywhere; }
.lf-desc { white-space: pre-line; overflow-wrap: anywhere; margin-bottom: 16px; }
.lf-sheet .facts { margin-bottom: 16px; }
.lf-sheet .btn-block + .btn-block { margin-top: 8px; }
.lf-sheet .alert { margin-bottom: 12px; }
.lf-form textarea.input { min-height: 96px; resize: vertical; }
.lf-form input[type="file"].input { min-height: 0; padding: 10px; font-size: var(--fs-sm); }
.lf-form input[type="file"]::file-selector-button {
  margin-right: 12px; padding: 6px 12px; border: 0; border-radius: 8px;
  background: var(--primary-soft); color: var(--primary-text); font: inherit; font-weight: 700; cursor: pointer;
}
.lf-preview { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--r-sm); }

/* ---------- Page changes ---------- */
/* Moving between our pages cross-fades the content in .2s (Chrome on Android; other browsers just load the page).
   The header and bottom bar are left out of the fade, so they stay put. */
@view-transition { navigation: auto; }
.app-header { view-transition-name: uh-header; }
.bottom-nav { view-transition-name: uh-nav; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .2s; animation-timing-function: ease-out; }
::view-transition-group(uh-header), ::view-transition-group(uh-nav),
::view-transition-old(uh-header), ::view-transition-new(uh-header),
::view-transition-old(uh-nav), ::view-transition-new(uh-nav) { animation: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  @view-transition { navigation: none; }
}

/* ---------- Marketplace (shares the .lf-* card, chips, sheet and form styles) ---------- */
.lf-card.mk-card { display: block; padding: 0; position: relative; }
.mk-open {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px 12px 12px;
  background: none; border: 0; border-radius: inherit; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.mk-card.has-save .mk-open { padding-right: 48px; }
.mk-price { font-weight: 800; color: var(--text); font-size: var(--fs-body); }
.mk-price small { font-weight: 400; font-size: 12px; color: var(--muted); }
.mk-dot { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.mk-dot-good { background: var(--success); }
.mk-dot-info { background: var(--primary); }
.mk-dot-bad  { background: var(--danger); }
.mk-save {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  width: 44px; height: 44px; display: grid; place-items: center;
  background: none; border: 0; border-radius: 50%; color: var(--muted); cursor: pointer;
}
.mk-save:hover { color: var(--text); background: var(--primary-soft); }
.mk-save .icon { width: 22px; height: 22px; }
.mk-save[aria-pressed="true"] { color: var(--danger); }
.mk-save[aria-pressed="true"] .icon { fill: currentColor; }

.mk-more { border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); }
.mk-more summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 14px; font-weight: 700; font-size: var(--fs-sm); cursor: pointer; list-style: none; }
.mk-more summary::-webkit-details-marker { display: none; }
.mk-more summary .icon { width: 18px; height: 18px; transition: transform .15s; }
.mk-more[open] summary .icon { transform: rotate(180deg); }
.mk-more-body { display: grid; gap: 10px; padding: 0 14px 14px; }
.mk-range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mk-more-body .btn { justify-self: start; }

.mk-sheet-price { font-size: var(--fs-lg); font-weight: 800; margin-bottom: 4px; }
.mk-sheet-price small { font-size: var(--fs-sm); font-weight: 400; color: var(--muted); }
.mk-photos { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; margin-bottom: 12px; scrollbar-width: none; }
.mk-photos::-webkit-scrollbar { display: none; }
.mk-photos img { flex: 0 0 100%; min-width: 0; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--r-md); scroll-snap-align: start; }
.mk-photos-many img { flex-basis: 88%; }
.mk-previews { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mk-previews img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-sm); }
.mk-actions { display: grid; gap: 8px; }
.mk-note { color: var(--muted); font-size: var(--fs-sm); text-align: center; }
.mk-field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.mk-field-row .input { min-width: 0; }
.mk-facts { grid-template-columns: 1fr 1fr; }
.mk-facts div:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* ---------- Gigs (shares the .lf-* card, chips, sheet and form styles) ---------- */
.lf-type-offer   { background: var(--success-soft); }
.lf-type-request { background: var(--accent-soft); }
.lf-row > span:first-child { display: inline-flex; gap: 6px; }
.gig-apps { margin-top: 20px; }
.gig-apps h3 { font-size: var(--fs-md); margin-bottom: 10px; }
.gig-apps ul { list-style: none; padding: 0; display: grid; gap: 10px; }
.gig-app { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg); }
.gig-app-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.gig-app-name { font-weight: 700; color: var(--text); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.gig-app-user, .gig-app-meta { font-size: var(--fs-sm); color: var(--muted); }
.gig-app-msg { white-space: pre-line; overflow-wrap: anywhere; }
.gig-app-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* Post sheet: four choices in a 2 x 2 grid, quick-pick chips that fill a box, the errand money line */
.gig-kinds label { font-size: var(--fs-sm); text-align: center; padding: 0 6px; }
.gig-picks { display: flex; gap: 6px; margin: 0 0 8px; overflow-x: auto; scrollbar-width: none; }
.gig-picks::-webkit-scrollbar { display: none; }
.field .gig-picks:last-child { margin: 8px 0 0; }
.gig-picks .chip { font-family: inherit; cursor: pointer; padding: 0 12px; }
.gig-safe { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-sm); background: var(--primary-soft); color: var(--text); font-size: var(--fs-sm); }
.gig-safe .icon { flex: none; width: 18px; height: 18px; color: var(--primary-text); margin-top: 1px; }

/* ---------- Notifications (shares the .lf-* chips, empty and skeleton styles) ---------- */
.app-main.nt { max-width: 720px; }
.nt-day-group + .nt-day-group { margin-top: 16px; }
.nt-day { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.nt-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.nt-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px 12px 12px; color: var(--text);
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.nt-item:hover { text-decoration: none; border-color: var(--primary); box-shadow: var(--shadow-lift); }
.nt-item:active { transform: scale(.985); }
.nt-unread { border-color: var(--primary); background: linear-gradient(90deg, var(--primary-soft), var(--surface) 70%); }
.nt-ico { flex-shrink: 0; width: 44px; height: 50px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); }
.nt-ico .icon { width: 22px; height: 22px; }
.nt-ico.nt-good { background: var(--success-soft); color: var(--success); }
.nt-ico.nt-bad { background: var(--danger-soft); color: var(--danger); }
.nt-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.nt-title { font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.nt-msg { font-size: var(--fs-sm); color: var(--muted); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nt-time { font-size: 12px; color: var(--muted); }
.nt-dot { flex-shrink: 0; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--primary); }
.nt-clear-note { color: var(--muted); margin-bottom: 16px; }
/* Important (NOTIFICATION_LEVELS in auth.php): on top until opened, with the red dot like the bell. */
.nt-day-important { color: var(--accent-text); }
.nt-important.nt-unread { border-color: var(--accent); background: linear-gradient(90deg, var(--accent-soft), var(--surface) 70%); }
.nt-important .nt-dot { background: var(--accent); }
/* Opened (open-first sheet): quieter card with a check; the just-opened one pops (notifications.php) */
.nt-item { position: relative; }
.nt-opened { background: var(--bg); border-color: var(--border); }
.nt-opened .nt-title { font-weight: 600; color: var(--muted); }
.nt-opened::after {
  content: ""; position: absolute; right: 12px; top: 12px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--success) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5L20 7'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.nt-just-opened::after { animation: nt-check .45s cubic-bezier(.2, .9, .3, 1.4) both; }
@keyframes nt-check { from { transform: scale(0); } to { transform: scale(1); } }
.nt-sheet .sheet-head { align-items: flex-start; }
.nt-open-ico .nt-ico { width: 52px; height: 60px; }
.nt-open-title { margin: 6px 0 8px; font-size: var(--fs-lg); line-height: 1.3; overflow-wrap: anywhere; }
.nt-open-msg { font-size: var(--fs-body); line-height: 1.6; overflow-wrap: anywhere; white-space: pre-line; }
.nt-open-time { margin: 8px 0 18px; font-size: var(--fs-sm); }
.nt-sheet [data-nt-proceed] .icon { width: 16px; height: 16px; }
@media (prefers-reduced-motion: reduce) { .nt-just-opened::after { animation: none; } }
.nt-skel { margin-top: 0; }

/* ---------- Get Trusted (verify.php) ---------- */
.trust { display: grid; gap: 16px; align-content: start; }
.trust-status { display: flex; align-items: flex-start; gap: 14px; border-color: var(--success); }
.trust-status > .hex { flex-shrink: 0; width: 40px; height: 46px; display: grid; place-items: center; background: var(--success-soft); color: var(--text); }
.trust-status p { margin-top: 6px; font-size: var(--fs-sm); color: var(--muted); }
.trust h2 { margin-bottom: 10px; }
.trust-list { list-style: none; padding: 0; display: grid; gap: 8px; font-size: var(--fs-sm); }
.trust-list li { display: flex; align-items: flex-start; gap: 10px; }
.trust-list .icon { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; color: var(--success); }
.trust-list .i-arrow { color: var(--primary-text); }
.trust-ways { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.trust-way { display: grid; gap: 14px; align-content: start; min-width: 0; }
.trust-for { margin-top: 6px; font-size: var(--fs-sm); color: var(--muted); }
/* The 100 level JAMB way, shown as a perk (verify.php) */
.trust-way-perk { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.trust-perk {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px; padding: 4px 10px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary-text); font-size: 13px; font-weight: 700;
}
.trust-perk .icon { width: 14px; height: 14px; }
.trust-note { font-size: var(--fs-sm); color: var(--muted); }

/* ---------- Profile (shares the .lf-* card, chips, sheet and form styles) ---------- */
.app-main.pf { max-width: 1120px; }
.pf-layout { display: grid; gap: 16px; align-items: start; }
.pf-side, .pf-main { display: grid; gap: 16px; align-content: start; min-width: 0; }
.pf-main > [hidden] { display: none; }

/* Header card: short cover, hexagon avatar beside the share button, then who they are */
.pf-head { padding: 0; overflow: hidden; }
.pf-cover { position: relative; isolation: isolate; height: 92px; background: var(--panel); }
.pf-cover > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pf-id { padding: 0 16px 18px; }
.pf-top { display: flex; align-items: flex-end; justify-content: space-between; margin-top: -40px; }
.pf-avatar-ring { display: grid; place-items: center; width: 84px; height: 96px; background: var(--surface); }
.pf-avatar {
  display: grid; place-items: center; width: 76px; height: 88px; overflow: hidden;
  background: var(--primary); color: var(--on-primary); font-size: var(--fs-2xl); font-weight: 800;
}
.pf-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pf-avatar-sm { width: 52px; height: 60px; font-size: var(--fs-md); flex-shrink: 0; }
.pf-share { border: 1px solid var(--border); margin-bottom: 2px; }
.pf-name { margin-top: 10px; font-size: var(--fs-xl); letter-spacing: -0.02em; line-height: 1.2; overflow-wrap: anywhere; }
.pf-badge { margin-top: 6px; }
.pf-meta { display: flex; flex-wrap: wrap; margin-top: 8px; font-size: var(--fs-sm); color: var(--muted); }
.pf-meta span { overflow-wrap: anywhere; }
.pf-meta span + span::before { content: "\00B7"; padding: 0 7px; }
.pf-bio { margin-top: 12px; white-space: pre-line; overflow-wrap: anywhere; }

/* Trust strip: only real numbers */
.pf-stats { list-style: none; padding: 12px 0 0; margin-top: 14px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 10px 22px; }
.pf-stats li, .pf-stats a { display: grid; gap: 1px; }
.pf-stats a { color: inherit; }
.pf-stats a:hover { text-decoration: none; }
.pf-stats a:hover span { color: var(--primary-text); }
.pf-stats strong { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-md); font-weight: 800; line-height: 1.2; }
.pf-stats span { font-size: 12px; color: var(--muted); }
.pf-star-on { width: 16px; height: 16px; color: var(--accent); fill: var(--accent); }

/* Reach: WhatsApp / Call buttons and links */
.pf-reach { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pf-reach .btn .icon { width: 16px; height: 16px; }
.pf-reach-own { flex-basis: 100%; display: flex; align-items: center; gap: 6px; margin: 0; }
.pf-reach-own .icon { width: 16px; height: 16px; flex-shrink: 0; }
.pf-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; max-width: 100%;
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px;
  font-size: var(--fs-sm); font-weight: 700; color: var(--text);
}
.pf-link:hover { text-decoration: none; border-color: var(--primary); }
.pf-link .icon { width: 14px; height: 14px; color: var(--primary-text); flex-shrink: 0; }
.pf-link small { font-weight: 400; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pf-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pf-actions:empty { display: none; }
.pf-actions .icon { width: 16px; height: 16px; }
.pf-hint { font-size: var(--fs-sm); }
.pf-id > .pf-hint { margin-top: 12px; }

.pf-trust { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border-color: var(--primary); }
.pf-trust-ico { flex-shrink: 0; width: 40px; height: 46px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); }
.pf-trust-body { flex: 1 1 180px; min-width: 0; }
.pf-trust h2 { font-size: var(--fs-body); }
.pf-trust p { margin-top: 2px; font-size: var(--fs-sm); color: var(--muted); }

/* Sections; on "All" each kind is a short sideways row */
#pfPosts { display: grid; gap: 22px; }
#pfPosts[hidden], #pfSkeleton[hidden] { display: none; }
.pf-sec { display: grid; gap: 10px; min-width: 0; }
.pf-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pf-sec-head h2 { font-size: var(--fs-md); }
.pf-sec-head a { font-size: var(--fs-sm); font-weight: 700; white-space: nowrap; }
.pf-rail {
  list-style: none; display: grid; grid-auto-flow: column; grid-auto-columns: min(84%, 300px); gap: 10px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none;
}
.pf-rail::-webkit-scrollbar { display: none; }
.pf-rail > li { scroll-snap-align: start; min-width: 0; display: grid; }
.pf-rail .lf-card { height: 100%; }
.pf .lf-foot:not(:has(*)) { display: none; }

/* Reviews and recommendations */
.pf-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.pf-review { display: grid; gap: 6px; }
.pf-review-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; }
.pf-review-when { display: inline-flex; align-items: center; gap: 10px; }
.pf-review-text { white-space: pre-line; overflow-wrap: anywhere; }
.pf-review-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: var(--fs-sm); color: var(--muted); }
.pf-review-meta strong { color: var(--text); }
.pf-review-who { color: inherit; text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }

.pf-text-btn { background: none; border: 0; padding: 6px 0; font: inherit; font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; }
.pf-text-btn:hover { color: var(--danger); }
.pf-text-btn[data-review-hide]:hover { color: var(--primary-text); }
.pf-stars { display: inline-flex; gap: 2px; }
.pf-stars .icon { width: 15px; height: 15px; }
.pf-stars .on { color: var(--accent); fill: var(--accent); }
.pf-stars .off { color: var(--border); fill: var(--border); }
.pf-stars-lg .icon { width: 20px; height: 20px; }
.pf-score { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.pf-score strong { font-size: var(--fs-2xl); font-weight: 800; line-height: 1; }
.pf-score .muted { font-size: var(--fs-sm); }

/* Review sheet: tap a star. The row is reversed in the page so a star and the ones before it light up. */
.pf-rate-about { margin: -4px 0 14px; overflow-wrap: anywhere; }
.pf-rate-stars { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 8px; }
.pf-rate-row { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.pf-rate-row label { display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--r-sm); cursor: pointer; color: var(--border); }
.pf-rate-row label .icon { width: 34px; height: 34px; fill: currentColor; }
.pf-rate-row label:hover, .pf-rate-row label:hover ~ label,
.pf-rate-row input:checked ~ label { color: var(--accent); }
.pf-rate-row input:focus-visible + label { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Edit and account */
.pf-back { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: var(--fs-sm); justify-self: start; }
.pf-back .icon { width: 16px; height: 16px; transform: rotate(180deg); }
.pf-form { gap: 16px; }
.pf-form-card { display: grid; gap: 14px; align-content: start; }
.pf-form-card h2 { font-size: var(--fs-md); }
.pf-form-card textarea.input { min-height: 96px; resize: vertical; }
.pf-photo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pf-file { cursor: pointer; }
.pf-file .icon { width: 16px; height: 16px; }
.pf-file:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.pf-file.is-busy { opacity: .6; pointer-events: none; }
.pf-link-row { display: grid; grid-template-columns: minmax(0, 7.25rem) minmax(0, 1fr); gap: 8px; }
.pf-link-row .select { padding-left: 12px; }
.pf-self-start { justify-self: start; }
.pf-privacy { display: grid; gap: 12px; border: 0; padding: 0; margin: 0; min-width: 0; }
.pf-danger { border-color: var(--danger); }
.pf-danger p { font-size: var(--fs-sm); }
.pf-del-note { margin-bottom: 16px; }

/* "Who was it with?" sheet (includes/layout/deal_sheet.php) */
.deal-note { margin-bottom: 12px; font-size: var(--fs-sm); }
.deal-list { display: grid; gap: 6px; margin-bottom: 16px; max-height: 50vh; overflow-y: auto; }
.deal-person {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; cursor: pointer;
  border: 1.5px solid var(--border); border-radius: var(--r-md);
}
.deal-person input { position: absolute; opacity: 0; pointer-events: none; }
.deal-person:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.deal-person:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.deal-ava { flex-shrink: 0; width: 36px; height: 41px; display: grid; place-items: center; background: var(--primary); color: var(--on-primary); font-weight: 800; }
.deal-who { display: grid; min-width: 0; }
.deal-who strong, .deal-who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal-who small { color: var(--muted); font-size: 12px; }
.deal-skel { pointer-events: none; }
.deal-skel .skeleton-line { flex: 1; }
#dealSheetDone .mk-actions { margin-top: 16px; }

@media (min-width: 1024px) {
  .pf-layout { grid-template-columns: 320px minmax(0, 1fr); }
  .pf-side { position: sticky; top: calc(var(--header-h) + 16px); }
  /* Room for a grid on a big screen: no sideways scrolling, 3 cards per kind */
  .pf-rail { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); overflow: visible; margin: 0; padding: 0; }
  .pf-rail > li:nth-child(n+4) { display: none; }
}
/* Editing on a phone: the form is what matters, the header card waits */
@media (max-width: 1023px) {
  .pf-editing .pf-side { display: none; }
}

/* ---------- Messages (shares the .lf-* list card, skeleton and empty styles) ---------- */
.app-main.ms { max-width: 1100px; }
.ms-count { font-size: var(--fs-sm); font-weight: 700; color: var(--primary-text); }
.ms-list { list-style: none; padding: 0; display: grid; gap: 8px; margin-top: 14px; }
.ms-list-skel { margin-top: 14px; }
.ms-ava { width: 48px; height: 55px; font-weight: 800; }
.ms-item .lf-row > .lf-title { display: block; min-width: 0; }
.ms-item[aria-current="page"] { border-color: var(--primary); background: var(--primary-soft); }
.ms-unread { border-color: var(--primary); }
.ms-unread .ms-last { color: var(--text); font-weight: 700; }
.ms-when { flex-shrink: 0; font-size: 12px; color: var(--muted); }
.ms-last { font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-dot { flex-shrink: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }

/* One chat. On phones it fills the screen between the header and the bottom bar,
   so the box stays above the bottom bar (and above the keyboard). */
.ms-chat, .ms-wait { display: none; }
.ms-open .ms-chat, .ms-wait:not([hidden]) {
  display: flex; flex-direction: column;
  position: fixed; z-index: 40; left: 0; right: 0; top: var(--header-h);
  bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
}
.ms-open .ms-chat.ms-kb { bottom: var(--ms-kb, 0px); }
.ms-open .ms-listpane { display: none; }
.ms-loading .ms-chat { display: none; }
.ms-loading-list .ms-chat { display: none; }
.ms-loading-list .ms-listpane { display: block; }
.ms-loading-list .ms-wait { display: none; }
.ms-solo .ms-chat { display: none; }

.ms-head { display: flex; align-items: center; gap: 10px; flex-shrink: 0; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--border); }
.ms-head .ms-ava { width: 40px; height: 46px; }
.ms-back .icon { transform: rotate(180deg); }
.ms-who { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; font-size: 12px; }
.ms-name { font-size: var(--fs-body); font-weight: 800; color: var(--text); overflow-wrap: anywhere; }
a.ms-name:hover { color: var(--primary-text); }

.ms-safety { display: flex; align-items: center; gap: 10px; flex-shrink: 0; margin: 0; max-width: none; padding: 6px 4px 6px 14px; background: var(--primary-soft); font-size: var(--fs-sm); }
.ms-safety .icon { flex-shrink: 0; width: 18px; height: 18px; color: var(--primary-text); }
.ms-safety span { flex: 1; }
/* Move to WhatsApp: shown only after one person asks; numbers only when both agree */
.ms-wa { flex-shrink: 0; display: grid; gap: 8px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.ms-wa p { display: flex; gap: 8px; align-items: flex-start; margin: 0; max-width: none; }
.ms-wa p .icon { flex-shrink: 0; width: 18px; height: 18px; color: var(--primary-text); margin-top: 1px; }
.ms-wa-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ms-wa-note { color: var(--muted); }
.ms-wa-intro { color: var(--muted); margin-bottom: 14px; }
.ms-offline { flex-shrink: 0; padding: 6px 14px; text-align: center; font-size: 12px; background: var(--danger-soft); }

.ms-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; padding: 14px 14px 10px; }
.ms-stack { display: flex; flex-direction: column; gap: 6px; }
.ms-stack:empty { display: none; }
#msPending { margin-top: 6px; }
.ms-day { text-align: center; margin: 10px 0 4px; }
.ms-day span { display: inline-block; padding: 2px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 12px; font-weight: 700; color: var(--muted); }
.ms-msg { display: grid; gap: 2px; max-width: min(82%, 460px); padding: 8px 12px 6px; border-radius: 16px; }
.ms-theirs { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.ms-mine { align-self: flex-end; background: var(--primary-deep); color: var(--on-primary); border-bottom-right-radius: 4px; }
.ms-text { max-width: none; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.ms-time { justify-self: end; font-size: 11px; opacity: .75; }
.ms-sending { opacity: .7; }
.ms-failed { outline: 2px solid var(--danger); outline-offset: 1px; }
.ms-failed .ms-time { opacity: 1; }
.ms-retry { min-height: 28px; padding: 2px 6px; border: 0; background: none; color: inherit; font-size: 11px; font-weight: 800; text-decoration: underline; }
.ms-hello { margin: auto; text-align: center; color: var(--muted); }

.ms-compose { display: flex; align-items: flex-end; gap: 8px; flex-shrink: 0; padding: 10px 12px; background: var(--surface); border-top: 1px solid var(--border); }
.ms-input { flex: 1; min-width: 0; min-height: 46px; max-height: 120px; resize: none; padding: 11px 16px; line-height: 1.35; border-radius: 23px; }
.ms-send { flex-shrink: 0; width: 46px; height: 52px; display: grid; place-items: center; border: 0; background: var(--primary-deep); color: var(--on-primary); transition: transform .12s; }
.ms-send:active { transform: scale(.92); }
.ms-send:focus-visible { background: var(--primary); }
.ms-closed { flex-shrink: 0; margin: 0; max-width: none; padding: 14px; text-align: center; font-size: var(--fs-sm); color: var(--muted); background: var(--surface); border-top: 1px solid var(--border); }
.ms-pick { margin: auto; }

.ms-wait-head { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--border); }
.ms-wait-head .ms-ava { width: 40px; height: 46px; }
.ms-wait-head .skeleton-line { flex: 1; max-width: 160px; }
.ms-wait-body { display: flex; flex-direction: column; gap: 10px; padding: 16px 14px; }
.ms-wait-bubble { width: 62%; height: 44px; border-radius: 16px; }
.ms-wait-mine { align-self: flex-end; width: 48%; }

/* Tablet and up: the list on the left, the chat on the right */
@media (min-width: 768px) {
  .app-main.ms:not(.ms-solo) {
    display: grid; grid-template-columns: 320px minmax(0, 1fr);
    height: calc(100vh - var(--header-h)); padding: 0;
  }
  .ms .ms-listpane, .ms-open .ms-listpane { display: block; overflow-y: auto; padding: 20px 14px; border-right: 1px solid var(--border); }
  .ms .ms-chat, .ms-open .ms-chat, .ms-wait:not([hidden]) {
    display: flex; position: static; min-height: 0; height: 100%; z-index: auto;
    grid-column: 2; grid-row: 1;
  }
  .ms-loading .ms-chat, .ms-loading-list .ms-chat { display: none; }
  .ms-loading-list .ms-wait { display: none; }
  .ms-loading .ms-wait:not([hidden]) { display: flex; }
  .ms-back { display: none; }
  .ms-head { padding: 10px 18px; }
  .ms-body { padding: 18px; }
}

/* ============================================
   INVITE FRIENDS (referrals.php). Shares the dashboard panel, .ladder, .lf-* rows and .chips.
   ============================================ */
.app-main.rf { max-width: 760px; }
.rf { display: grid; gap: 24px; align-content: start; }
.rf-h2 { font-size: var(--fs-lg); margin-bottom: 12px; }
.rf-invite { display: grid; gap: 10px; }
.rf-invite label { font-size: var(--fs-sm); font-weight: 700; color: var(--on-primary); }
.rf-invite .input { color: var(--text); }
.rf-code .input { font-size: var(--fs-lg); font-weight: 800; letter-spacing: .08em; }
.rf-hint { margin: -4px 0 4px; font-size: var(--fs-sm); color: var(--on-primary); opacity: .85; }

/* Ladder: reached steps in amber (rewards), the next one in indigo, later ones soft. */
.rf-ladder li.rf-later .hex,
.rf-ladder li:last-child.rf-later .hex { background: var(--primary-soft); color: var(--primary-text); }
.rf-ladder li.rf-next .hex,
.rf-ladder li:last-child.rf-next .hex { background: var(--primary-deep); color: var(--on-primary); }
.rf-ladder li.rf-done .hex { background: var(--accent); color: var(--on-accent); }
.rf-ladder .hex .icon { width: 22px; height: 22px; }

.rf-chips { margin-bottom: 12px; }
.rf-list { grid-template-columns: 1fr; }
.rf-item { gap: 12px; }
.rf-ava { width: 44px; height: 50px; font-weight: 800; }
.rf-meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rf-why {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.3;
}
.rf-why .icon { width: 14px; height: 14px; flex-shrink: 0; }
.rf-why-yes { background: var(--success-soft); color: var(--text); }
.rf-why-yes .icon { color: var(--success); }
.rf-why-no { background: var(--border); color: var(--muted); }

.rf-board { padding: 6px 16px; }
.rf-ranks { list-style: none; padding: 0; }
.rf-ranks li { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.rf-ranks li + li { border-top: 1px solid var(--border); }
.rf-ranks li.rf-me { margin: 0 -10px; padding: 10px; border-radius: var(--r-sm); border-top-color: transparent; background: var(--primary-soft); }
.rf-ranks li.rf-me + li { border-top-color: transparent; }
.rf-rank {
  flex-shrink: 0; width: 30px; height: 34px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary-text); font-size: var(--fs-sm); font-weight: 800;
}
.rf-rank.rf-top { background: var(--primary-deep); color: var(--on-primary); }
.rf-who { flex: 1; min-width: 0; display: grid; }
.rf-who strong, .rf-who span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rf-who span { font-size: 12px; color: var(--muted); }
.rf-num { font-size: var(--fs-lg); font-weight: 800; color: var(--primary-text); }
.rf-you { padding: 10px 0; border-top: 1px solid var(--border); font-size: var(--fs-sm); color: var(--muted); }
.rf-you strong { color: var(--text); }

/* ---------- Settings (settings.php; shares .lf-head, .seg, .check, .alert) ---------- */
.app-main.set { max-width: 720px; }
.set-stack { display: grid; gap: 16px; }
.set-card { display: grid; gap: 14px; align-content: start; }
.set-card h2 { font-size: var(--fs-md); }
.set-card .seg label { font-size: var(--fs-sm); padding: 0 6px; text-align: center; }
.set-note { font-size: var(--fs-sm); color: var(--muted); }
.set-links { list-style: none; padding: 0; margin: -6px 0; display: grid; }
.set-links li + li { border-top: 1px solid var(--border); }
.set-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 8px 0;
  background: none; border: 0; font: inherit; font-size: var(--fs-body); color: var(--text); text-align: left; cursor: pointer;
}
.set-row:hover { text-decoration: none; color: var(--primary-text); }
.set-row > .icon:first-child { flex-shrink: 0; width: 20px; height: 20px; color: var(--primary-text); }
.set-row > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.set-row > .icon:last-child:not(:first-child) { flex-shrink: 0; width: 16px; height: 16px; color: var(--muted); }
.set-row-danger, .set-row-danger > .icon:first-child { color: var(--danger); }
.set-foot { text-align: center; font-size: var(--fs-sm); color: var(--muted); }

/* ---------- My shop editor (business/shop.php) ---------- */
.shop-sum { display: grid; gap: 8px; justify-items: start; }
.shop-sum p { font-size: var(--fs-sm); color: var(--muted); }
.shop-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  font-size: var(--fs-md); font-weight: 700; color: var(--text); background: var(--border);
}
.shop-pill::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.shop-open   { background: var(--success-soft); }
.shop-open::before { background: var(--success); }
.shop-closed { background: var(--danger-soft); }
.shop-closed::before { background: var(--danger); }
.shop-back   { background: var(--primary-soft); }
.shop-back::before { background: var(--primary); }
.shop-card { display: grid; gap: 12px; align-content: start; }
.shop-card h2 { font-size: var(--fs-md); }
.shop-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.shop-radios { display: grid; gap: 12px; }
.shop-alert { margin-bottom: 12px; }
.shop-items { list-style: none; padding: 0; display: grid; gap: 8px; }
.shop-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: var(--tap); text-align: left; font: inherit; color: inherit; cursor: pointer;
  transition: border-color .15s, transform .12s;
}
.shop-item:hover { border-color: var(--primary); }
.shop-item:active { transform: scale(.99); }
.shop-item-main { display: grid; gap: 2px; min-width: 0; }
.shop-item-name { font-weight: 700; overflow-wrap: anywhere; }
.shop-item-meta { font-size: var(--fs-sm); color: var(--muted); overflow-wrap: anywhere; }
.shop-item-price { flex-shrink: 0; font-weight: 700; color: var(--primary-text); }
.shop-hidden { opacity: .6; }
.shop-confirm { display: grid; gap: 8px; justify-items: start; margin-top: 12px; }
.shop-item-actions { display: grid; gap: 8px; margin-top: 12px; }
.shop-danger, .shop-danger .icon { color: var(--danger); }
.shop-danger-armed { background: var(--danger-soft); border-color: var(--danger); }
.shop-days-list { display: grid; gap: 6px; }
.shop-days-list > div { display: grid; grid-template-columns: 72px 1fr; gap: 12px; font-size: var(--fs-sm); }
.shop-days-list dt { color: var(--muted); }
.shop-days-list dd { overflow-wrap: anywhere; }
.shop-days { display: grid; gap: 8px; }
.shop-day { display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; }
.shop-day .input { min-width: 0; min-height: 44px; padding: 8px 10px; }
.shop-day .input:disabled { opacity: .45; }
.shop-about { display: flex; align-items: center; gap: 12px; }
.shop-about p { min-width: 0; overflow-wrap: anywhere; }

/* ---------- Public shop page (shop.php) ---------- */
.sp { display: grid; gap: 16px; align-content: start; max-width: 720px; margin: 0 auto; width: 100%; }
.sp-public { padding: 20px 16px 48px; }
.sp-owner a { font-weight: 700; }
.shop-link-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.sp-head { padding: 0; overflow: hidden; }
.sp-cover { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--primary-soft); }
.sp-cover-empty { aspect-ratio: auto; height: 96px; display: grid; place-items: center; }
.sp-cover-empty .hex { width: 56px; height: 64px; display: grid; place-items: center; background: var(--surface); color: var(--primary-text); }
.sp-body { display: grid; gap: 10px; justify-items: start; padding: 16px; }
.sp-body h1 { font-size: var(--fs-xl); overflow-wrap: anywhere; }
.sp-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.sp-meta { font-size: var(--fs-sm); color: var(--muted); overflow-wrap: anywhere; }
.sp-about { overflow-wrap: anywhere; }
.sp-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; width: 100%; margin-top: 4px; }
.sp-actions .btn-primary { grid-column: 1 / -1; }
/* On phones Share is just the icon (the phone's own share menu answers). */
@media (max-width: 479px) {
  #spShare [data-copy-label] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
.sp-section { display: grid; gap: 10px; }
.sp-section h2, .shop-card h2 { font-size: var(--fs-md); }
.sp-item { position: relative; }
.sp-item[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); }
.sp-tick {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; display: none; place-items: center;
  background: var(--primary-deep); color: var(--on-primary);
}
.sp-tick .icon { width: 14px; height: 14px; }
.sp-item[aria-pressed="true"] .sp-tick { display: grid; }
.sp-soon { display: grid; gap: 4px; }
.sp-today dt, .sp-today dd { font-weight: 700; color: var(--text); }
.sp-tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sp-tags li { padding: 6px 12px; border-radius: 999px; background: var(--primary-soft); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.sp-where { overflow-wrap: anywhere; }
.sp-map { justify-self: start; }
.sp-gone { margin-top: 24px; }
.sp-bar {
  position: sticky; bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 8px); z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 10px 10px 16px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--primary); box-shadow: var(--shadow-lift); font-weight: 700;
}
.sp-bar[hidden] { display: none; }
.sp-public .sp-bar { bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); }
@media (min-width: 768px) { .app-main .sp-bar { bottom: 12px; } }

/* ---------- Study Hub (study.php, study_campus.php, study_course.php; shares .dash-hero, .lf-head, .lf-filters, .chips, .empty) ---------- */
.st { display: grid; gap: 20px; align-content: start; }
.app-main.st { max-width: 880px; }
.st-public { width: 100%; max-width: 880px; margin: 0 auto; padding: 20px 16px 48px; }
.st-hero-sub { color: var(--on-panel-muted); max-width: 40ch; }
.st-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.st-card {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px;
  color: var(--text); transition: border-color .15s, box-shadow .15s, transform .12s;
}
a.st-card:hover { text-decoration: none; border-color: var(--primary); box-shadow: var(--shadow-lift); }
a.st-card:active { transform: scale(.985); }
/* The course code inside a hexagon: letters small, digits bold */
.st-hex {
  flex-shrink: 0; width: 56px; height: 64px;
  display: grid; place-content: center; text-align: center; line-height: 1.1;
  background: var(--primary-soft); color: var(--primary-text);
}
.st-hex span { font-size: 11px; font-weight: 700; letter-spacing: .05em; }
.st-hex b { font-size: 15px; font-weight: 800; }
.st-hex-lg { width: 68px; height: 78px; }
.st-hex-lg span { font-size: 12px; }
.st-hex-lg b { font-size: 18px; }
.st-card-body { flex: 1; min-width: 0; display: grid; gap: 3px; }
.st-card-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.st-code { font-size: var(--fs-sm); font-weight: 800; color: var(--primary-text); }
.st-card-title {
  font-weight: 700; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.st-card-meta { font-size: 12px; color: var(--muted); }
.st-chev { flex-shrink: 0; width: 18px; height: 18px; color: var(--muted); transform: rotate(-90deg); }
.st-tag {
  display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; color: var(--text); background: var(--primary-soft);
}
.st-tag .icon { width: 12px; height: 12px; }
.st-tag-soft { background: var(--border); color: var(--text); }
.st-tag-mine { background: var(--success-soft); }
/* Reading progress: indigo (amber is for rewards only) */
.st-bar { display: block; height: 6px; margin-top: 4px; border-radius: 6px; background: var(--primary-soft); overflow: hidden; }
.st-bar span { display: block; height: 100%; border-radius: inherit; background: var(--primary); transition: width .2s; }
.st-group { margin: 4px 0 8px; font-size: var(--fs-sm); font-weight: 700; color: var(--muted); }
.st-list + .st-group { margin-top: 18px; }
.st-group span { color: var(--primary-text); }
.st-soon-line { margin-top: 14px; }
.st-browse a { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 700; min-height: var(--tap); margin-block: -12px; }
.st-browse .icon { width: 16px; height: 16px; }

/* Picking courses */
.st-setup, .st-pick, .st-code-form, .st-find, .st-join { display: grid; gap: 12px; }
.st-setup { gap: 18px; }
.st-h3 { font-size: var(--fs-body); font-weight: 700; }
.st-checks { list-style: none; padding: 0; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.st-checks li + li { border-top: 1px solid var(--border); }
.st-check { padding: 12px 14px; min-height: var(--tap); }
.st-check small { display: block; font-size: 12px; color: var(--muted); }
.st-code-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.st-tip { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--primary-soft); color: var(--text); }
.st-tip .icon { flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px; color: var(--primary-text); }
.st-quick { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.st-picker { display: flex; gap: 8px; }
.st-picker .select { flex: 1; min-width: 0; }
.st-join-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Campus and course pages */
.st-crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: var(--fs-sm); color: var(--muted); }
.st-crumbs a { display: inline-flex; align-items: center; min-height: var(--tap); margin-block: -12px; }
.st-campus-head { align-items: flex-start; }
.st-campus-head h1 { font-size: var(--fs-xl); line-height: 1.2; letter-spacing: -.02em; }
.st-head { display: grid; gap: 14px; }
.st-head-top { display: flex; align-items: center; gap: 14px; }
.st-head h1 { font-size: var(--fs-2xl); line-height: 1.1; letter-spacing: -.03em; }
.st-head-title { font-size: var(--fs-md); font-weight: 700; line-height: 1.35; }
/* One code, a different course per department (EDU 302.2, migration 117): which version is shown, or the picker */
.st-version { display: flex; align-items: flex-start; gap: 8px; margin: 12px 4px 0; font-size: var(--fs-sm); line-height: 1.45; color: var(--muted); }
.st-version .icon { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--primary-text); }
.st-version strong { color: var(--text); }
.st-version a { font-weight: 600; }
.st-version-pick { margin-top: 14px; display: grid; gap: 6px; }
.st-version-pick h2 { font-size: var(--fs-md); }
.st-version-pick ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; }
.st-version-pick li + li { border-top: 1px solid var(--border); }
.st-version-pick a { display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 10px 0; color: var(--text); }
.st-version-pick a:hover { text-decoration: none; color: var(--primary-text); }
.st-version-pick a > span { flex: 1; display: grid; gap: 2px; }
.st-version-pick strong { font-size: var(--fs-sm); line-height: 1.35; }
.st-version-pick small { font-size: 12px; color: var(--muted); }
.st-version-pick a > .icon { width: 16px; height: 16px; color: var(--primary-text); flex: none; }
.st-facts { font-size: var(--fs-sm); color: var(--muted); }
.st-unchecked { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: var(--fs-sm); color: var(--muted); }
.st-link-btn { background: none; border: 0; padding: 6px 0; font: inherit; font-weight: 700; color: var(--primary-text); cursor: pointer; }
.st-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.st-in { pointer-events: none; }
.st-in .icon { color: var(--success); }
.st-carry { align-items: center; min-height: var(--tap); }
.st-armed { color: var(--danger) !important; }

/* Topic outline */
.st-progress-row { display: grid; gap: 6px; margin-bottom: 12px; font-size: var(--fs-sm); font-weight: 700; color: var(--muted); }
.st-outline { list-style: none; padding: 0; display: grid; gap: 8px; }
.st-topic { display: flex; align-items: flex-start; gap: 4px; padding: 0; }
.st-topic details { flex: 1; min-width: 0; }
.st-topic summary {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 4px 10px 14px;
  list-style: none; cursor: pointer;
}
.st-topic summary::-webkit-details-marker { display: none; }
.st-num {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 800;
  background: var(--primary-soft); color: var(--primary-text);
}
.st-topic-title { flex: 1; font-weight: 700; line-height: 1.35; }
.st-topic-chev { flex-shrink: 0; width: 16px; height: 16px; color: var(--muted); transition: transform .2s; }
.st-topic details[open] .st-topic-chev { transform: rotate(180deg); }
.st-topic-body { display: grid; gap: 10px; padding: 0 8px 14px 54px; font-size: var(--fs-sm); line-height: 1.6; }
.st-subs { list-style: none; padding: 0; display: grid; gap: 4px; }
.st-subs li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.st-subs small { display: block; color: var(--muted); }
/* "I've read this" tick: an empty ring, filled indigo when read */
.st-tick {
  flex-shrink: 0; width: var(--tap); height: var(--tap); margin: 6px 6px 0 0;
  display: grid; place-items: center; border: 0; border-radius: 50%; background: none; cursor: pointer;
}
.st-subs .st-tick { margin: 0; }
.st-tick .icon {
  width: 28px; height: 28px; padding: 5px; border-radius: 50%;
  border: 2px solid var(--border); color: transparent; transition: background .15s, border-color .15s;
}
.st-tick:hover .icon { border-color: var(--primary); }
.st-tick[aria-pressed="true"] .icon { background: var(--primary-deep); border-color: var(--primary-deep); color: var(--on-primary); }
.st-tick:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.st-signin-note { margin-top: 12px; }
.st-skel-panel { display: grid; gap: 8px; }
.st-skel-panel .st-topic { padding: 22px 14px; }
.st-topic:target { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Search (study_search.php) and the home search box */
.st-search-box { margin-top: -6px; }
.st-results { display: grid; gap: 22px; }
.st-topic-hit .st-hex .icon { width: 20px; height: 20px; }

/* Study Hub: topic pages and the Library (study_topic.php, session S3) */
.st-open-topic { display: inline-flex; align-items: center; gap: 6px; justify-self: start; font-weight: 700; min-height: var(--tap); }
.st-open-topic .icon { width: 16px; height: 16px; }
.st-sub-link { color: var(--text); font-weight: 600; }
.st-sub-link:hover { color: var(--primary-text); }
.st-topic-h1 { font-size: var(--fs-xl); line-height: 1.2; letter-spacing: -.02em; margin: 2px 0; }
.st-summary { font-size: var(--fs-body); line-height: 1.65; }
/* Our notes (049): our own study notes on a topic page, and their preview in admin. */
.st-notes { margin-top: 16px; }
.st-notes-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.st-notes-head h2 { margin: 0; }
.st-notes-body { font-size: var(--fs-body); line-height: 1.7; overflow-wrap: anywhere; }
.st-notes-body h3 { font-size: 1.02rem; margin: 1.1em 0 .35em; }
.st-notes-body p, .st-notes-body ul, .st-notes-body ol { margin: 0 0 .75em; }
.st-notes-body ul, .st-notes-body ol { padding-left: 1.3em; }
.st-notes-body li { margin: .2em 0; }
.st-notes-body strong { color: var(--text); }
.st-notes-table { overflow-x: auto; margin: 0 0 .9em; }
.st-notes-table table { border-collapse: collapse; min-width: 100%; font-size: .92em; }
.st-notes-table th, .st-notes-table td { border: 1px solid var(--border); padding: 6px 8px; text-align: left; vertical-align: top; }
.st-notes-table th { background: var(--primary-soft); }
.st-notes-foot { font-size: .85rem; margin: .5em 0 0; }
.sa-notes { font-family: inherit; line-height: 1.5; }
.sa-notes-preview { margin: 0 0 12px; }
.sa-notes-preview .st-notes-body { padding: 8px 0; }
.st-read[aria-pressed="true"] { background: var(--success-soft); border-color: transparent; }
.st-read[aria-pressed="true"] .icon { color: var(--success); }
.st-library { display: grid; gap: 22px; }
.st-saver { justify-self: start; font-size: var(--fs-sm); min-height: var(--tap); align-items: center; }
.st-res { display: grid; gap: 0; padding: 0; overflow: hidden; }
.st-res-link {
  display: flex; align-items: center; gap: 14px; padding: 12px; color: var(--text);
  transition: background .15s;
}
.st-res-link:hover { text-decoration: none; background: var(--primary-soft); }
.st-res-best { border-color: var(--primary); }
.st-res .st-card-title { -webkit-line-clamp: 3; }
.st-thumb {
  position: relative; flex-shrink: 0; width: 112px; aspect-ratio: 16 / 9; border-radius: var(--r-sm);
  display: grid; place-items: center; overflow: hidden; background: var(--primary-soft); color: var(--primary-text);
}
.st-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.st-thumb > .icon { width: 26px; height: 26px; position: relative; }
.st-thumb img[src] + .icon { color: var(--on-photo); filter: drop-shadow(0 1px 2px var(--photo-scrim)); }
[data-saver] .st-thumb img { display: none; }
[data-saver] .st-thumb img + .icon { color: var(--primary-text); filter: none; }
.st-dur {
  position: absolute; right: 4px; bottom: 4px; padding: 0 5px; border-radius: 4px;
  font-size: 11px; font-weight: 700; background: var(--photo-scrim); color: var(--on-photo);
}
.st-data { font-size: 12px; font-weight: 700; color: var(--primary-text); }
.st-res-note { font-size: var(--fs-sm); font-weight: 400; line-height: 1.45; }
.st-ext { transform: none; width: 16px; height: 16px; }
.st-tag-best { justify-self: start; }
.st-credit { padding: 8px 12px; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted); overflow-wrap: anywhere;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.st-res-report { margin-left: auto; padding: 0; font-size: 11px; font-weight: 600; color: var(--muted); }
.st-lib-note { margin-top: -6px; }
.st-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.st-pager a { display: grid; gap: 2px; padding: 12px 14px; color: var(--text); min-width: 0; }
.st-pager a:hover { text-decoration: none; border-color: var(--primary); }
.st-pager small { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.st-pager span { font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.st-pager-next { text-align: right; grid-column: 2; }
.st-back { justify-self: start; }
.st-back .icon { transform: rotate(180deg); }

/* Timetable (study_timetable.php, "Classes today" on study.php, the line on a course page) */
.tt-days { display: grid; gap: 18px; }
.tt-class { display: flex; align-items: center; gap: 14px; padding: 12px 14px; color: var(--text); }
a.tt-class:hover { text-decoration: none; }
.tt-time {
  flex-shrink: 0; display: grid; justify-items: center; min-width: 62px; padding: 6px 4px;
  border-radius: var(--r-sm); background: var(--primary-soft); color: var(--primary-text);
  font-size: var(--fs-sm); font-weight: 800; line-height: 1.25;
}
.tt-time small { font-size: 11px; font-weight: 600; color: var(--muted); }
.tt-class .icon-btn { flex-shrink: 0; }
.st-today-none { padding: 14px; font-size: var(--fs-sm); color: var(--muted); }
.st-classes { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: var(--fs-sm); color: var(--muted); }
.st-classes .icon { width: 16px; height: 16px; color: var(--primary-text); }
.st-classes a { font-weight: 700; }
.tt-dayset { border: 0; padding: 0; margin: 0; min-width: 0; }
.tt-dayset legend { padding: 0; margin-bottom: 6px; font-size: var(--fs-sm); font-weight: 600; }
.tt-daypick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.tt-daybox { position: relative; }
.tt-daybox input { position: absolute; opacity: 0; pointer-events: none; }
.tt-daybox span {
  display: grid; place-items: center; min-height: var(--tap); border-radius: var(--r-sm);
  border: 1.5px solid var(--border); background: var(--surface); font-size: var(--fs-sm); font-weight: 700; color: var(--muted); cursor: pointer;
}
.tt-daybox input:checked + span { background: var(--primary-deep); border-color: transparent; color: var(--on-primary); }
.tt-daybox input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.tt-clear { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }

/* GPA calculator (study_gpa.php, session S9; the card on study.php) */
.gp-stack:not([hidden]) { display: grid; gap: 20px; }
.gp-sum { gap: 12px; }
.gp-sum-label { font-size: var(--fs-sm); font-weight: 600; color: var(--on-panel-muted); }
.gp-sum-num { font-size: 44px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin: 2px 0 8px; font-variant-numeric: tabular-nums; }
.gp-skel { display: grid; gap: 12px; }
.gp-skel-sum { display: grid; gap: 10px; padding: 20px; }
.gp-skel-num { display: block; width: 120px; height: 44px; border-radius: var(--r-sm); }
.gp-line { background: var(--primary-soft); border-color: transparent; display: grid; gap: 8px; }
.gp-line .panel-h2 { margin: 0; }
.gp-line a { font-weight: 700; }
.gp-need { display: grid; gap: 12px; }
.gp-need .panel-h2 { margin: 0; }
.gp-need-out { display: grid; gap: 8px; font-size: var(--fs-sm); }
.gp-need-out:empty { display: none; }
.gp-need-out p { padding: 10px 12px; border-radius: var(--r-sm); background: var(--bg); }
.gp-need-out p.set-note { background: none; padding: 0; }

.gp-need-val { font-variant-numeric: tabular-nums; color: var(--primary-text); font-size: var(--fs-md); }
.gp-sem { display: grid; gap: 10px; padding: 14px; }
.gp-sem-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.gp-sem-head h3 { font-size: var(--fs-body); }
.gp-sem-gpa {
  flex-shrink: 0; display: grid; justify-items: center; min-width: 62px; padding: 6px 8px;
  border-radius: var(--r-sm); background: var(--primary-soft); color: var(--primary-text); line-height: 1.2;
}
.gp-sem-gpa b { font-size: var(--fs-md); font-variant-numeric: tabular-nums; }
.gp-sem-gpa small { font-size: 11px; font-weight: 600; color: var(--muted); }
.gp-rows { list-style: none; padding: 0; display: grid; gap: 2px; font-size: var(--fs-sm); }
.gp-rows li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--border); }
.gp-rows .gp-u { margin-left: auto; color: var(--muted); white-space: nowrap; }
.gp-g { min-width: 52px; text-align: right; font-weight: 800; white-space: nowrap; }
.gp-g small { font-weight: 600; color: var(--muted); }
.gp-g.is-wait { font-weight: 600; color: var(--muted); font-size: 12px; }
.gp-change { justify-self: start; }
.gp-claim { display: grid; gap: 8px; }
.gp-claim .panel-h2 { margin: 0; }
.gp-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.gp-fill { justify-self: start; }
.gp-grid-head, .gp-row { display: grid; grid-template-columns: minmax(0, 1fr) 50px 76px 44px 36px; gap: 6px; align-items: center; }
.gp-grid-head { font-size: 12px; font-weight: 600; color: var(--muted); }
.gp-rowlist { list-style: none; padding: 0; display: grid; gap: 8px; }
.gp-row .input { min-width: 0; padding-left: 10px; padding-right: 8px; }
.gp-row [name="units"], .gp-row [name="grade"] { text-align: center; }
.gp-row.is-bad [name="grade"] { border-color: var(--danger); }
.gp-row-hint { grid-column: 3 / span 3; font-size: 12px; color: var(--muted); line-height: 1; }
.gp-row-hint:empty { display: none; }
.gp-row.is-bad .gp-row-hint { color: var(--danger); }
.gp-co { position: relative; }
.gp-co input { position: absolute; opacity: 0; pointer-events: none; }
.gp-co span[aria-hidden] {
  display: grid; place-items: center; min-height: var(--tap); border-radius: var(--r-sm);
  border: 1.5px solid var(--border); background: var(--surface); font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); cursor: pointer;
}
.gp-co input:checked + span { background: var(--primary-deep); border-color: transparent; color: var(--on-primary); }
.gp-co input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
#gpForm .st-link-btn { display: inline-flex; align-items: center; gap: 4px; justify-self: start; }
#gpForm .st-link-btn .icon { width: 16px; height: 16px; }
.gp-explain { display: grid; gap: 10px; }
.gp-explain h2 { font-size: var(--fs-lg); }
.gp-explain h3 { font-size: var(--fs-body); margin-top: 6px; }
.gp-explain p { max-width: 65ch; }
.gp-table { width: 100%; max-width: 420px; border-collapse: collapse; font-size: var(--fs-sm); }
.gp-table th, .gp-table td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--border); }
.gp-table thead th { font-size: 12px; color: var(--muted); font-weight: 600; }
.gp-table tbody th { font-weight: 700; }
.gp-home { display: flex; align-items: center; gap: 14px; padding: 12px 14px; color: var(--text); }
a.gp-home:hover { text-decoration: none; }
.gp-home .st-card-body { flex: 1; }
.gp-home .hex-mark { flex-shrink: 0; width: 40px; height: 46px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); }
.gp-home .hex-mark .icon { width: 20px; height: 20px; }
.gp-home-num { font-size: var(--fs-lg); font-weight: 800; color: var(--primary-text); font-variant-numeric: tabular-nums; }

/* My school (course page tab=school, session S4): shared notes and past questions, the item and share sheets */
.st-panel { min-width: 0; }   /* the kind chips scroll inside it instead of widening the page */
.st-school-top:empty { display: none; }
.st-school-top { margin-bottom: 14px; }
.st-school-top .st-tip a { font-weight: 700; }
.st-kind-chips { margin-bottom: 12px; }
.st-item { width: 100%; font: inherit; text-align: left; cursor: pointer; color: var(--text); }
.st-item:hover { border-color: var(--primary); box-shadow: var(--shadow-lift); }
.st-item:active { transform: scale(.985); }
.st-item:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.st-helped {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary-text); font-size: 12px; font-weight: 800;
}
.st-helped .icon { width: 13px; height: 13px; }
.st-warn { color: var(--danger); }
.st-cross { margin-top: 24px; display: grid; gap: 8px; }
.st-school-rule { margin-top: 18px; }
.st-item-sheet { display: grid; gap: 10px; }
.st-item-sheet .sheet-head { margin-bottom: 0; }
.st-item-h { font-size: var(--fs-lg); line-height: 1.3; overflow-wrap: anywhere; }
.st-item-by { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.st-item-note { justify-self: start; }
.st-item-desc { font-size: var(--fs-sm); line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.st-item-topics .chip { cursor: default; }
.st-photos { display: grid; gap: 8px; }
.st-photos a { display: block; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--border); background: var(--primary-soft); }
.st-photos img { display: block; width: 100%; height: auto; }
.st-item-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.st-vote b { font-weight: 800; }
.st-report-btn { margin-left: auto; color: var(--muted); }
.st-report-what { font-weight: 700; color: var(--text); }
.st-reasons { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; }
.st-reasons legend { padding: 0; margin-bottom: 2px; }
.st-sheet-note { margin: 6px 0 14px; }
.st-report-owner { margin-top: 14px; }
.st-vote[aria-pressed="true"] { background: var(--success-soft); border-color: transparent; }
.st-vote[aria-pressed="true"] .icon { color: var(--success); }
.st-share { gap: 16px; }
.st-kind-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.st-kind-pick .tt-daybox span { padding: 0 12px; }
.st-share-topics summary { cursor: pointer; font-size: var(--fs-sm); font-weight: 700; min-height: var(--tap); display: flex; align-items: center; gap: 6px; }
.st-share-topics .opt { font-weight: 400; color: var(--muted); }
/* D3: how to share (photos, a file, a Drive link), the photo tray and the slides file */
.st-how label { font-size: var(--fs-sm); padding: 0 6px; text-align: center; }
.st-how label .icon { width: 16px; height: 16px; flex-shrink: 0; }
.st-tray { list-style: none; padding: 0; margin: 0 0 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.st-tray li { position: relative; aspect-ratio: 3 / 4; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--border); background: var(--primary-soft); }
.st-tray img { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-tray-n { position: absolute; left: 4px; bottom: 4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--scrim); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.st-tray-x { position: absolute; top: 2px; right: 2px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--scrim); color: #fff; display: grid; place-items: center; cursor: pointer; }
.st-tray-x .icon { width: 16px; height: 16px; }
.st-tray-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.st-tray-add { position: relative; cursor: pointer; }
.st-tray-add:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.st-tray-add[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.st-doc-pick { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px; border: 1.5px dashed var(--border); border-radius: var(--r-md); cursor: pointer; min-height: var(--tap); }
.st-doc-pick:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.st-doc-pick.has-file { border-style: solid; border-color: var(--primary); background: var(--primary-soft); }
.st-doc-pick.has-file .st-hex { background: var(--surface); }
.st-doc-text { display: grid; gap: 2px; min-width: 0; }
.st-doc-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-doc-text small { color: var(--muted); font-size: var(--fs-sm); }

/* D3: the bottom (+) on Study Hub pages (includes/layout/bn_study_sheet.php) */
.bs-kinds { list-style: none; padding: 0; margin: 4px 0 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bs-kind {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 96px; padding: 12px 8px; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; text-align: center;
}
.bs-kind:hover { text-decoration: none; background: var(--primary-soft); border-color: transparent; }
.bs-kind:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.bs-ask { display: flex; align-items: center; gap: 12px; margin: 0 0 8px; font-weight: 700; }
.bs-ask .st-link-btn { display: inline-flex; align-items: center; gap: 4px; min-height: var(--tap); }
.bs-back-ico { transform: rotate(90deg); width: 16px; height: 16px; }
.bs-courses { margin-bottom: 12px; max-height: 50dvh; overflow-y: auto; }
.bs-courses a { gap: 10px; }
.bs-courses .st-code { white-space: nowrap; flex-shrink: 0; }
.bs-course-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.bs-other {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: var(--tap); margin-top: 4px;
  border: 0; border-top: 1px solid var(--border); background: none; color: var(--primary-text); font: inherit; font-weight: 700; cursor: pointer;
}
.bs-other .icon { width: 18px; height: 18px; }

@media (min-width: 1000px) {
  .st-home .st-list, .st-campus .st-list { grid-template-columns: 1fr 1fr; }
  .st-photos { grid-template-columns: 1fr 1fr; }
  .st-photos a:only-child { grid-column: 1 / -1; }
}

/* ---------- Study Hub: past question bank (study_paper.php, the Past questions tab, study_contribute.php, study_entry.php; session S6) ---------- */
/* Maths from includes/mathtext.php */
.mt-frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; margin: 0 2px; line-height: 1.15; font-size: .92em; }
.mt-num { padding: 0 3px 1px; border-bottom: 1.5px solid currentColor; }
.mt-den { padding: 1px 3px 0; }
.mt-slash { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.mt-root { white-space: nowrap; }
.mt-rad { padding: 0 2px; border-top: 1.5px solid currentColor; }
.mt-idx { font-size: .65em; margin-right: -3px; }
.mt-bar { border-top: 1.5px solid currentColor; }
.mt-vec { position: relative; display: inline-block; padding-top: .3em; }
.mt-vec::before { content: "\2192"; position: absolute; top: -.35em; left: 0; right: 0; text-align: center; font-size: .75em; }
.pq-body sup, .pq-body sub, .pq-preview sup, .pq-preview sub, .pq-opts sup, .pq-opts sub, .pq-hit-body sup, .pq-hit-body sub,
.pq-tag-body sup, .pq-tag-body sub, .pq-answer sup, .pq-answer sub { font-size: .72em; line-height: 0; }

/* Buttons that act as chips (toggles) */
button.chip { font-family: inherit; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--primary-deep); border-color: transparent; color: var(--on-primary); }

/* Topic heat: indigo, like reading progress (amber stays for rewards) */
.st-heat { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.st-heat-bar { flex: 0 0 56px; height: 5px; border-radius: 5px; background: var(--primary-soft); overflow: hidden; }
.st-heat-bar span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.st-heat-lg { font-size: var(--fs-sm); margin-top: 8px; }
.st-heat-lg .st-heat-bar { flex-basis: 80px; height: 6px; }

/* A paper, question by question */
.pq-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.pq-q { display: grid; gap: 10px; padding: 14px; scroll-margin-top: calc(var(--header-h) + 12px); }
.pq-q:target { outline: 2px solid var(--primary); outline-offset: 2px; }
.pq-q-head { display: flex; align-items: center; gap: 8px; }
.pq-num {
  flex-shrink: 0; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 16px;
  display: inline-grid; place-items: center; font-size: var(--fs-sm); font-weight: 800;
  background: var(--primary-soft); color: var(--primary-text);
}
.pq-marks { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--muted); }
.pq-body { font-size: var(--fs-body); line-height: 1.7; overflow-wrap: anywhere; }
.pq-img { display: block; width: auto; max-width: 100%; height: auto; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--print-paper); }
.pq-opts { list-style: none; padding: 0; display: grid; gap: 6px; }
.pq-opts li { display: flex; align-items: baseline; gap: 10px; line-height: 1.55; overflow-wrap: anywhere; }
.pq-letter {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: 12px; font-weight: 800; background: var(--surface); border: 1.5px solid var(--border); color: var(--text);
}
.pq-foot { display: grid; gap: 8px; }
.pq-answer summary { cursor: pointer; font-size: var(--fs-sm); font-weight: 700; color: var(--primary-text); min-height: var(--tap); display: flex; align-items: center; }
.pq-answer p { padding: 10px 12px; border-radius: var(--r-sm); background: var(--success-soft); line-height: 1.6; }
.pq-answer small { display: block; font-size: 11px; color: var(--muted); }
.pq-report { justify-self: end; padding: 0; font-size: 11px; font-weight: 600; color: var(--muted); }
.pq-instr { padding: 10px 12px; border-radius: var(--r-sm); background: var(--primary-soft); font-size: var(--fs-sm); line-height: 1.6; }
.pq-hit-body { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: var(--fs-sm); line-height: 1.6; }
.pq-hot { margin-bottom: 18px; }
.pq-hot-row .st-heat { margin-top: 2px; }
.pq-totype { margin-top: 22px; }
.pq-totype-row { flex-wrap: wrap; }
.pq-totype-row .btn { flex-basis: 100%; }
.st-topic-title .st-heat { white-space: nowrap; }

/* Typing a paper in (study_entry.php) */
.st-entry { gap: 14px; }
.pq-entry-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pq-saved { font-size: 12px; font-weight: 700; color: var(--muted); }
.pq-viewer {
  position: sticky; top: var(--header-h); z-index: 6; margin: 0 -16px; padding: 6px 16px 0;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.pq-strip { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: var(--r-md); background: var(--surface); }
.pq-strip::-webkit-scrollbar { display: none; }
.pq-strip-locked { overflow-x: hidden; }
.pq-slide { flex: 0 0 100%; scroll-snap-align: center; }
.pq-stage { height: 36vh; min-height: 200px; overflow: hidden; touch-action: pan-x pan-y; position: relative; cursor: zoom-in; user-select: none; }
.pq-stage.pq-zoomed { touch-action: none; cursor: grab; }
.pq-stage img { display: block; width: 100%; height: 100%; object-fit: contain; transform-origin: 0 0; -webkit-user-drag: none; }
.pq-viewer-bar { display: flex; align-items: center; gap: 2px; padding: 2px 0; font-size: var(--fs-sm); font-weight: 700; color: var(--muted); }
.pq-viewer-bar [data-count] { min-width: 44px; text-align: center; }
.pq-viewer-bar [data-hide-photos] { margin-left: auto; }
.pq-viewer-bar .icon-btn { font-size: 20px; font-weight: 700; }
.pq-chev-l { transform: rotate(90deg); }
.pq-chev-r { transform: rotate(-90deg); }
.pq-viewer-min .pq-strip, .pq-viewer-min [data-zoom], .pq-viewer-min [data-prev], .pq-viewer-min [data-next], .pq-viewer-min [data-count] { display: none; }
.pq-meta { padding: 0 14px; }
.pq-meta summary { cursor: pointer; min-height: 52px; display: flex; align-items: center; gap: 6px; font-weight: 700; }
.pq-meta .opt { font-weight: 400; color: var(--muted); }
.pq-meta form { padding-bottom: 14px; }
.pq-help { margin-top: -4px; }
.pq-cards { list-style: none; padding: 0; display: grid; gap: 12px; }
.pq-card { display: grid; gap: 10px; padding: 12px; }
.pq-card-head { display: flex; align-items: center; gap: 8px; }
.pq-numfield { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: 700; }
.pq-number { width: 72px; min-height: 40px; padding: 6px 10px; text-align: center; font-weight: 800; }
.pq-state { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); text-align: right; }
.pq-del.st-armed { color: var(--danger); background: var(--danger-soft); }
.pq-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.pq-kinds .chip { min-height: 36px; padding: 0 12px; }
.pq-card textarea.pq-body { min-height: 88px; resize: vertical; font-size: 16px; line-height: 1.55; }
.pq-symbols { display: flex; gap: 4px; overflow-x: auto; padding: 6px 0 2px; scrollbar-width: none; }
.pq-symbols::-webkit-scrollbar { display: none; }
.pq-sym {
  flex-shrink: 0; min-width: 40px; height: 40px; padding: 0 8px; border-radius: var(--r-sm);
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text);
  font-family: inherit; font-size: var(--fs-body); cursor: pointer;
}
.pq-sym:active { background: var(--primary-soft); }
.pq-sym sup, .pq-sym sub { font-size: .7em; }
.pq-sym-frac .mt-frac { font-size: 11px; }
.pq-preview { padding: 8px 10px; border-radius: var(--r-sm); background: var(--primary-soft); font-size: var(--fs-sm); line-height: 1.7; overflow-wrap: anywhere; }
.pq-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pq-marks-field { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: 700; }
.pq-marks-field .input { width: 72px; min-height: 40px; padding: 6px 10px; text-align: center; }
.pq-diagram { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.pq-diagram img { max-width: min(100%, 280px); height: auto; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--print-paper); }
.pq-mcq, .pq-tf { display: grid; gap: 8px; }
.pq-hint { font-size: 12px; color: var(--muted); }
.pq-optlist { list-style: none; padding: 0; display: grid; gap: 6px; }
.pq-opt { display: flex; align-items: center; gap: 8px; }
.pq-opt .input { flex: 1; min-width: 0; min-height: 44px; }
button.pq-letter { width: var(--tap); height: var(--tap); font-family: inherit; font-size: var(--fs-sm); cursor: pointer; }
button.pq-letter[aria-pressed="true"] { background: var(--success); border-color: transparent; color: var(--on-primary); }
.pq-tf .chip, .pq-mcq .chip { min-height: 36px; }
.pq-source { display: grid; gap: 4px; font-size: var(--fs-sm); font-weight: 600; }
.pq-next { display: flex; flex-wrap: wrap; gap: 8px; }
.pq-dock {
  position: sticky; bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 8px); z-index: 7;
  display: flex; gap: 8px; padding: 10px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lift);
}
.pq-dock .btn { flex: 1 1 0; min-width: 0; padding-left: 10px; padding-right: 10px; white-space: normal; text-align: center; line-height: 1.25; }
.pq-crop-pick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.pq-crop-stage { position: relative; margin: 8px 0 12px; touch-action: none; user-select: none; cursor: crosshair; }
.pq-crop-stage img { display: block; width: 100%; height: auto; -webkit-user-drag: none; }
.pq-crop-box { position: absolute; border: 2px solid var(--primary); background: var(--primary-soft); opacity: .85; pointer-events: none; }
.pq-tagcard { display: grid; gap: 10px; padding: 12px; }
.pq-tag-q { display: flex; gap: 10px; align-items: flex-start; }
.pq-tag-body { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; font-size: var(--fs-sm); line-height: 1.6; overflow-wrap: anywhere; }
.pq-topic-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pq-topic-chips .chip, .pq-topics .chip { flex-shrink: 1; min-width: 0; min-height: 36px; padding: 6px 12px; font-size: 12px; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.pq-tagging, .pq-tagcard, .pq-q, .pq-card { min-width: 0; }
.st-entry, .pq-tagging, .pq-cards, .pq-tagcard, .pq-card, .pq-list, .pq-q { grid-template-columns: minmax(0, 1fr); }
.pq-suggested { border-color: var(--primary); color: var(--primary-text); }
.pq-more-topics summary { cursor: pointer; font-size: var(--fs-sm); font-weight: 700; color: var(--primary-text); min-height: 36px; display: flex; align-items: center; }
.pq-more-topics .pq-topic-chips { padding-top: 6px; }
.pq-tagging { display: grid; gap: 12px; }

@media (min-width: 768px) { .pq-dock { bottom: 8px; } }
@media (min-width: 1000px) {
  .pq-viewer { margin: 0; padding: 6px 0 0; }
  .pq-stage { height: 46vh; }
}

/* ---------- Study Hub: practice (study_practice.php, the Practice tab, Today's 5 on study.php; session S7) ---------- */
.seg-1 { grid-template-columns: 1fr; }
.seg-4 { grid-template-columns: repeat(4, 1fr); }
.pr-q { display: grid; gap: 12px; padding: 16px; scroll-margin-top: calc(var(--header-h) + 64px); }
.pr-q .pq-num { white-space: nowrap; padding: 0 12px; }
.pr-of { font-weight: 600; color: var(--muted); margin-left: 3px; }
.pr-from { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--muted); text-align: right; }
/* Answer options: big tap targets */
.pr-opts { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 8px; }
.pr-opt {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: var(--tap); padding: 10px 14px;
  border: 1.5px solid var(--border); border-radius: var(--r-md); background: var(--surface);
  line-height: 1.5; overflow-wrap: anywhere; cursor: pointer; transition: border-color .15s, background-color .15s;
}
.pr-opt input { position: absolute; opacity: 0; pointer-events: none; }
.pr-opt:hover { border-color: var(--primary); }
.pr-opt:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.pr-opt:has(input:checked) .pq-letter { background: var(--primary-deep); border-color: transparent; color: var(--on-primary); }
.pr-opt:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.pr-opt-text { flex: 1; min-width: 0; }
.pr-opts[disabled] .pr-opt { cursor: default; }
.pr-opts[disabled] .pr-opt:hover { border-color: var(--border); }
.pr-opt.pr-opt-right, .pr-opt.pr-opt-right:has(input:checked), .pr-opts[disabled] .pr-opt.pr-opt-right:hover { border-color: var(--success); background: var(--success-soft); }
.pr-opt.pr-opt-wrong, .pr-opt.pr-opt-wrong:has(input:checked), .pr-opts[disabled] .pr-opt.pr-opt-wrong:hover { border-color: var(--danger); background: var(--danger-soft); }
.pr-opt.pr-opt-right .pq-letter, .pr-opt.pr-opt-right:has(input:checked) .pq-letter { background: var(--success); border-color: transparent; color: var(--on-primary); }
.pr-opt.pr-opt-wrong .pq-letter, .pr-opt.pr-opt-wrong:has(input:checked) .pq-letter { background: var(--danger); border-color: transparent; color: var(--on-primary); }
.pr-mark { flex-shrink: 0; display: inline-flex; }
.pr-mark .icon { width: 20px; height: 20px; }
.pr-opt-right .pr-mark { color: var(--success); }
.pr-opt-wrong .pr-mark { color: var(--danger); }
.pr-verdict, .pr-feedback { padding: 10px 12px; border-radius: var(--r-sm); background: var(--primary-soft); font-size: var(--fs-sm); line-height: 1.6; overflow-wrap: anywhere; }
.pr-right .pr-verdict, .pr-right .pr-feedback { background: var(--success-soft); }
.pr-wrong .pr-verdict, .pr-wrong .pr-feedback { background: var(--danger-soft); }
.pr-verdict small, .pr-feedback small { display: block; font-size: 11px; color: var(--muted); }
.pr-verdict sup, .pr-verdict sub, .pr-feedback sup, .pr-feedback sub, .pr-opt sup, .pr-opt sub { font-size: .72em; line-height: 0; }
.pr-reveal { display: grid; gap: 10px; }
.pr-noanswer { font-size: var(--fs-sm); color: var(--muted); }
.pr-self-q { font-weight: 700; }
.pr-self { display: flex; gap: 8px; }
.pr-self .btn { flex: 1; }
.pr-write textarea { resize: vertical; }
/* Back · Next under the question */
.pr-play, .pr-run, .pr-cbt { display: grid; gap: 12px; }
.pr-steps { display: grid; gap: 12px; }
.pr-nav { display: flex; gap: 8px; }
.pr-nav .btn { flex: 1; }
.pr-nav .btn[hidden] { display: none; }
.pr-finish-now { justify-self: center; font-size: var(--fs-sm); }
.pr-dots { list-style: none; padding: 0; margin: 0; display: flex; justify-content: center; gap: 8px; }
.pr-dots li { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--border); transition: background-color .15s, border-color .15s; }
.pr-dots li.is-done { background: var(--primary); border-color: var(--primary); }
.pr-dots li.is-now { border-color: var(--primary-deep); transform: scale(1.25); }
.pr-shared { display: flex; gap: 10px; align-items: center; padding: 12px 14px; font-size: var(--fs-sm); }
.pr-shared .icon { flex-shrink: 0; color: var(--accent); }
/* The CBT screen: a bar with the timer that stays in view */
.pr-cbt-bar {
  position: sticky; top: calc(var(--header-h) + 6px); z-index: 5; display: flex; align-items: center; gap: 8px;
  padding: 8px 8px 8px 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-lift);
}
.st-public .pr-cbt-bar { top: 6px; }
.pr-timer { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-variant-numeric: tabular-nums; font-size: var(--fs-md); }
.pr-timer .icon { width: 18px; height: 18px; color: var(--primary-text); }
.pr-cbt.is-low .pr-timer, .pr-cbt.is-low .pr-timer .icon { color: var(--danger); }
.pr-count { margin-right: auto; font-size: 12px; font-weight: 700; color: var(--muted); }
.pr-flag .icon { width: 16px; height: 16px; }
.pr-flag[aria-pressed="true"] { background: var(--primary-deep); border-color: transparent; color: var(--on-primary); }
.pr-cbt .pr-nav { position: sticky; bottom: calc(var(--bottom-nav-h) + 8px); z-index: 4; padding: 8px; border-radius: var(--r-md); background: var(--bg); }
.st-public .pr-cbt .pr-nav, .pr-cbt .pr-nav { box-shadow: 0 -1px 0 var(--border); }
.st-public .pr-cbt .pr-nav { bottom: 8px; }
.pr-saved { min-height: 1.2em; font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; }
.pr-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 8px; }
.pr-cell {
  position: relative; display: inline-grid; place-items: center; width: 100%; aspect-ratio: 1; min-height: 40px;
  border: 1.5px solid var(--border); border-radius: var(--r-sm); background: var(--surface);
  font: inherit; font-weight: 700; color: var(--text); cursor: pointer;
}
.pr-cell.is-answered { background: var(--primary-deep); border-color: transparent; color: var(--on-primary); }
.pr-cell.is-flagged { border: 2px dashed var(--primary); }
.pr-cell.is-flagged::after { content: ''; position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); }
.pr-cell.is-now { outline: 2px solid var(--text); outline-offset: 2px; }
.pr-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 14px; font-size: 12px; color: var(--muted); }
.pr-legend .pr-cell { width: 16px; min-height: 16px; height: 16px; border-radius: 4px; cursor: default; }
.pr-legend .pr-cell.is-flagged::after { display: none; }
/* Score card */
.pr-score { display: grid; gap: 10px; justify-items: center; text-align: center; }
.pr-score-kicker { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.pr-score-num { font-size: 64px; line-height: 1; font-weight: 800; letter-spacing: -.04em; color: var(--muted); }
.pr-score-num b { color: var(--primary-text); }
.pr-score-line { font-weight: 700; max-width: 36ch; text-wrap: balance; }
.pr-share { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pr-save { display: grid; gap: 10px; justify-items: center; padding: 12px; border-radius: var(--r-md); background: var(--primary-soft); font-size: var(--fs-sm); }
/* Streak: amber, like other rewards */
.pr-streak { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); }
.pr-streak .icon { flex-shrink: 0; width: 20px; height: 20px; color: var(--accent); }
.pr-streak-card { display: flex; width: 100%; padding: 12px 14px; }
.pr-card ~ section:not(.pr-card) { margin-top: 20px; }
.pr-streak-sm { font-size: 12px; font-weight: 700; color: var(--muted); }
.pr-streak-sm .icon { width: 16px; height: 16px; }
/* The Practice tab */
.pr-card { display: grid; gap: 12px; }
.pr-card + .pr-card, .pr-streak-card + .pr-card { margin-top: 12px; }
.pr-card-head { display: flex; align-items: flex-start; gap: 12px; }
.pr-card-head .st-hex { width: 40px; height: 46px; }
.pr-card-head .st-hex .icon { width: 18px; height: 18px; }
.pr-card-head h2 { font-size: var(--fs-md); margin-bottom: 2px; }
.pr-rows { list-style: none; padding: 0; margin: 0; display: grid; }
.pr-rows li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.pr-row-name { min-width: 0; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.pr-row-name small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.pr-rows .btn { flex-shrink: 0; }
.pr-topics ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.pr-topics li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: var(--fs-sm); }
.pr-topics .st-bar { grid-column: 1 / -1; margin: 0; }
.pr-topic-name { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.pr-topic-n { font-weight: 800; color: var(--primary-text); }
.pr-review { display: grid; gap: 12px; }
/* Today's 5 on the Study home */
.pr-home .section-head { flex-wrap: wrap; gap: 6px 12px; }
.pr-home-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.pr-home-card { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; color: var(--text); }
.pr-home-card:hover { text-decoration: none; border-color: var(--primary); }
.pr-home-state { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--primary-deep); color: var(--on-primary); }
.pr-home-card.is-done .pr-home-state { background: var(--success-soft); color: var(--text); }
.pr-home-state .icon { width: 14px; height: 14px; }
.set-board { margin-top: 14px; }

@media (min-width: 768px) {
  .pr-cbt .pr-nav { bottom: 12px; }
  .pr-score-num { font-size: 76px; }
}

/* ---------- Class spaces (class.php, the Class tab, the Study home; session S8) ---------- */
.cl-kicker { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--primary-text); }
.cl-kicker .icon { width: 14px; height: 14px; }
.cl-group { font-size: var(--fs-md); font-weight: 700; letter-spacing: 0; color: var(--muted); white-space: nowrap; }
.cl-rep { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); }
.cl-rep-mark { flex-shrink: 0; width: 24px; height: 27px; display: grid; place-items: center; background: var(--success-soft); color: var(--success); }
.cl-rep-mark .icon { width: 14px; height: 14px; }
.cl-settings { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; font-size: var(--fs-sm); }
.cl-settings .check { min-height: var(--tap); align-items: center; }
.cl-leave { color: var(--muted); }
.cl-join { display: grid; gap: 10px; }
.cl-dates { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.cl-date { display: flex; align-items: center; gap: 12px; padding: 12px; color: var(--text); }
.cl-date:hover { text-decoration: none; border-color: var(--primary); }
.cl-date .st-hex, .cl-compose .st-hex, .cl-mine .st-hex { width: 40px; height: 46px; }
.cl-date .st-hex .icon, .cl-compose .st-hex .icon, .cl-mine .st-hex .icon, .st-list .st-hex .icon { width: 18px; height: 18px; }
.cl-repbox { display: grid; gap: 10px; }
.cl-repbox .panel-h2 { margin-bottom: 0; font-size: var(--fs-md); }
.cl-claims { list-style: none; padding: 0; display: grid; gap: 8px; }
.cl-claim { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 12px; border-radius: var(--r-md); background: var(--primary-soft); }
.cl-claim-who { display: grid; gap: 4px; min-width: 0; flex: 1 1 160px; }
.cl-votes { display: grid; gap: 2px; font-size: 12px; color: var(--muted); }
.cl-votes .st-bar { margin-top: 0; max-width: 160px; background: var(--surface); }
.cl-claim-btn { justify-self: start; }
.cl-compose {
  display: flex; align-items: center; gap: 12px; width: 100%; margin-bottom: 10px; padding: 12px;
  font: inherit; text-align: left; color: var(--text); cursor: pointer;
}
.cl-compose:hover { border-color: var(--primary); box-shadow: var(--shadow-lift); }
.cl-compose > span:last-child { display: grid; gap: 2px; font-weight: 700; }
.cl-compose small { font-size: 12px; font-weight: 400; color: var(--muted); }
.cl-posts { list-style: none; padding: 0; display: grid; gap: 10px; }
.cl-post { display: grid; gap: 8px; scroll-margin-top: 80px; }
.cl-post.is-new { border-color: var(--primary); }
.cl-post-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cl-post-top time { font-size: 12px; color: var(--muted); }
.cl-tag-date { background: var(--primary-deep); color: var(--on-primary); }
.cl-when { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--fs-sm); }
.cl-when .icon { width: 16px; height: 16px; color: var(--primary-text); }
.cl-body { line-height: 1.6; overflow-wrap: anywhere; }
.cl-material { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-md); background: var(--primary-soft); color: var(--text); font-weight: 700; overflow-wrap: anywhere; }
.cl-material:hover { text-decoration: none; color: var(--primary-text); }
.cl-material .icon { flex-shrink: 0; width: 18px; height: 18px; color: var(--primary-text); }
.cl-material small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.cl-post-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; font-size: 12px; color: var(--muted); }
.cl-by { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 700; color: var(--text); }
.cl-seen { display: inline-flex; align-items: center; gap: 4px; }
.cl-seen .icon { width: 14px; height: 14px; }
.cl-preview { display: grid; gap: 12px; }
.cl-inside { list-style: none; padding: 0; display: grid; gap: 10px; }
.cl-inside li { display: flex; align-items: flex-start; gap: 10px; }
.cl-inside .icon { flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px; color: var(--primary-text); }
.cl-kinds { flex-wrap: wrap; }
.cl-kind { position: relative; cursor: pointer; }
.cl-kind input { position: absolute; opacity: 0; pointer-events: none; }
.cl-kind:has(input:checked) { background: var(--primary-deep); border-color: transparent; color: var(--on-primary); }
.cl-kind:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.cl-members { list-style: none; padding: 0; display: grid; }
.cl-members li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; border-top: 1px solid var(--border); }
.cl-members li > span { min-width: 0; overflow-wrap: anywhere; }
.cl-mine { margin-bottom: 14px; border-color: var(--primary); }
.cl-date-row { display: flex; align-items: flex-start; gap: 10px; padding: 12px; }
.cl-date-row .icon { flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px; color: var(--primary-text); }
.cl-date-row small { display: block; font-size: 12px; color: var(--muted); }
.cl-open { display: grid; gap: 10px; justify-items: start; margin-top: 14px; }
.cl-open .panel-h2 { margin-bottom: 0; font-size: var(--fs-md); }
.st-panel section + section { margin-top: 14px; }
.cl-new { background: var(--primary-deep); color: var(--on-primary); }
.cl-join-card .btn { flex-shrink: 0; pointer-events: none; }

/* ---------- QR poster (business/poster.php) ---------- */
.poster-tools { display: grid; gap: 14px; justify-items: start; }
.poster-tools .btn { min-width: 200px; }
.poster-wrap { display: grid; justify-items: center; }
.poster {
  container-type: inline-size; width: 100%; max-width: 360px; aspect-ratio: 210 / 297;
  display: grid; grid-template-rows: auto auto auto 1fr auto auto; justify-items: center; align-items: center; text-align: center;
  padding: 7cqw 8cqw; gap: 3cqw;
  background: var(--print-paper); color: var(--print-ink);
  border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-lift);
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.poster-brand { display: flex; align-items: center; gap: 2cqw; font-weight: 800; font-size: 5.5cqw; letter-spacing: .02em; }
.poster-brand img { width: 8cqw; height: 8cqw; }
.poster-brand .wm-uni { color: var(--print-ink); }
.poster-brand .wm-hive { color: var(--primary-deep); }
.poster-name { font-size: 9.5cqw; line-height: 1.12; font-weight: 800; overflow-wrap: anywhere; }
.poster-lead { font-size: 6cqw; font-weight: 700; color: var(--primary-deep); }
.poster .qr { width: 66cqw; height: 66cqw; color: var(--print-ink); display: block; }
.poster .qr-bg { fill: var(--print-paper); }
.poster-url { font-size: 4.2cqw; font-weight: 700; overflow-wrap: anywhere; }
.poster-trust { font-size: 3.6cqw; color: var(--primary-deep); font-weight: 700; }
.poster-note { font-size: var(--fs-sm); color: var(--muted); }

@page { margin: 0; }
@page poster-a4 { size: A4; margin: 0; }
@page poster-card { size: 105mm 148mm; margin: 0; }
.poster-a4 { page: poster-a4; }
.poster-card { page: poster-card; }

@media print {
  html, body { background: var(--print-paper) !important; }
  .app-header, .sidebar, .bottom-nav, .poster-tools, .site-top, .site-footer { display: none !important; }
  .app-layout { display: block; }
  .app-main { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .poster { max-width: none; border: 0; border-radius: 0; box-shadow: none; break-inside: avoid; }
  .poster-a4 { width: 210mm; height: 297mm; }
  .poster-card { width: 105mm; height: 148mm; }
}

/* ---------- Campus Guide (guide.php, guide_campus.php, guide_place.php, guide_safety.php; G2).
   Shares .st-list, .st-card, .st-crumbs, .lf-head, .lf-filters, .chips, .gp-home and .empty with the Study Hub. ---------- */
.gd { display: grid; gap: 16px; align-content: start; }
.app-main.gd { max-width: 880px; }
.gd-public { width: 100%; max-width: 880px; margin: 0 auto; padding: 20px 16px 48px; }
.gd-hero h1 { font-size: var(--fs-2xl); line-height: 1.1; letter-spacing: -.03em; }
.gd-preview { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--r-md); background: var(--primary-soft); color: var(--text); font-size: var(--fs-sm); font-weight: 700; }
.gd-preview .icon { width: 16px; height: 16px; color: var(--primary-text); }
.gd-hex { flex-shrink: 0; width: 44px; height: 50px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); }
.gd-hex .icon { width: 20px; height: 20px; }
.gd-hex-lg { width: 60px; height: 69px; }
.gd-hex-lg .icon { width: 28px; height: 28px; }
.gd-parts { margin-top: -6px; }
.gd-parts .chip { min-height: 34px; padding: 0 12px; font-size: 12px; }
.gd-results { display: grid; gap: 18px; }
.gd-group { display: grid; gap: 0; }
.gd-soon { margin: 0; }

/* Place page */
.gd-head { display: flex; align-items: flex-start; gap: 14px; }
.gd-head > div { min-width: 0; }
.gd-head h1 { font-size: var(--fs-xl); line-height: 1.2; letter-spacing: -.02em; overflow-wrap: anywhere; }
.gd-also { margin-top: 4px; font-size: var(--fs-sm); color: var(--muted); }
.gd-closed { margin: 0; }
.gd-how { display: grid; gap: 14px; min-width: 0; }
.gd-how .btn { white-space: normal; text-align: left; max-width: 100%; }
.gd-how .panel-h2 { margin-bottom: 0; }
.gd-directions { line-height: 1.6; max-width: 65ch; }
.gd-facts { display: grid; gap: 10px; margin: 0; }
.gd-facts div { display: grid; grid-template-columns: 110px 1fr; gap: 8px; align-items: baseline; }
.gd-facts dt { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 700; color: var(--muted); }
.gd-facts dt .icon { width: 16px; height: 16px; }
.gd-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.gd-facts a { font-weight: 700; }
.gd-tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.gd-far { display: grid; gap: 8px; justify-items: start; padding-top: 14px; border-top: 1px solid var(--border); }
.gd-far-out { font-weight: 700; }
.gd-far-out.is-error { font-weight: 400; color: var(--danger); }
.gd-far-note { font-size: 12px; }
.gd-maps { justify-self: start; }
.gd-go { display: flex; flex-wrap: wrap; gap: 8px; }

/* D8: Point me there. A dial with N on the ring (turned to real north when the phone has a compass) and an arrow
   to the place. Modes: wait (finding you), live (compass), flat (no compass: north-up), here, error. */
.gd-cp-wrap { justify-items: stretch; }
.gd-cp-wrap [data-cp-start] { justify-self: start; }
.gd-cp-wrap { scroll-margin-top: 80px; }
.gd-cp-ready { box-shadow: 0 0 0 4px var(--primary-soft, rgba(108,99,255,.25)); animation: gdCpGlow 1.6s ease-in-out 3; }
@keyframes gdCpGlow { 50% { box-shadow: 0 0 0 8px var(--primary-soft, rgba(108,99,255,.25)); } }
@media (prefers-reduced-motion: reduce) { .gd-cp-ready { animation: none; } }
.gd-cp {
  display: grid; justify-items: center; gap: 8px; padding: 18px 16px 12px; border-radius: var(--r-lg);
  background: var(--primary-soft); text-align: center;
}
.gd-cp[hidden] { display: none; }
.gd-cp-dial { position: relative; width: 176px; height: 176px; }
.gd-cp-ring {
  position: absolute; inset: 0; border-radius: 50%; background: var(--surface); border: 2px solid var(--border);
  box-shadow: inset 0 0 0 10px color-mix(in srgb, var(--primary-soft) 70%, var(--surface));
}
.gd-cp-ring::before, .gd-cp-ring::after {   /* east-west and north-south tick marks */
  content: ""; position: absolute; left: 50%; top: 6px; bottom: 6px; width: 2px; margin-left: -1px;
  background: linear-gradient(var(--border) 0 12px, transparent 12px calc(100% - 12px), var(--border) calc(100% - 12px));
}
.gd-cp-ring::after { transform: rotate(90deg); }
.gd-cp-n {
  position: absolute; z-index: 1; top: 10px; left: 50%; transform: translateX(-50%); padding: 0 4px; background: var(--surface);
  font-size: 13px; font-weight: 800; color: var(--primary-text); line-height: 1.2;
}
.gd-cp-arrow { position: absolute; inset: 34px; width: calc(100% - 68px); height: calc(100% - 68px); fill: var(--primary-deep); transform-origin: 50% 50%; }
[data-theme="dark"] .gd-cp-arrow { fill: var(--primary); }
.gd-cp-here {
  position: absolute; inset: 44px; display: none; place-items: center; border-radius: 50%; background: var(--success-soft); color: var(--success);
}
.gd-cp-here .icon { width: 44px; height: 44px; }
.gd-cp-dist { margin: 0; font-size: var(--fs-xl); font-weight: 800; letter-spacing: -.02em; }
.gd-cp-say { margin: 0; max-width: 36ch; font-size: var(--fs-sm); line-height: 1.5; }
.gd-cp-say.is-error { color: var(--danger); }
.gd-cp[data-mode="wait"] .gd-cp-arrow { opacity: .3; }
.gd-cp[data-mode="wait"] .gd-cp-ring { animation: gdCpPulse 1.4s ease-in-out infinite; }
.gd-cp[data-mode="here"] .gd-cp-arrow { display: none; }
.gd-cp[data-mode="here"] .gd-cp-here { display: grid; }
.gd-cp[data-mode="error"] .gd-cp-dial, .gd-cp[data-mode="error"] .gd-cp-dist, .gd-cp[data-mode="error"] [data-cp-stop] { display: none; }
@keyframes gdCpPulse { 50% { border-color: var(--primary); } }
@media (prefers-reduced-motion: reduce) { .gd-cp[data-mode="wait"] .gd-cp-ring { animation: none; } }
.gd-checked a { margin-left: 6px; font-weight: 700; }

/* Safety page */
.gd-contacts { list-style: none; padding: 0; display: grid; gap: 10px; }
.gd-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px; }
.gd-contact-body { flex: 1 1 180px; min-width: 0; display: grid; gap: 3px; }
.gd-contact-kind { font-size: 12px; font-weight: 700; color: var(--primary-text); text-transform: uppercase; letter-spacing: .04em; }
.gd-contact-where { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); font-weight: 700; }
.gd-contact-where .icon { width: 14px; height: 14px; }
.gd-call { flex-shrink: 0; font-variant-numeric: tabular-nums; }
@media (max-width: 400px) { .gd-call { width: 100%; } }

/* Campus cards on the campus page: freshers checklist and safety numbers (G4). */
.gd-cards { display: grid; gap: 10px; }
@media (min-width: 640px) { .gd-cards:has(> :nth-child(2)) { grid-template-columns: 1fr 1fr; } }

/* Freshers checklist (guide_freshers.php, assets/js/guide_check.js; G4) */
.gd-check { display: grid; gap: 16px; }
.gd-prog { display: grid; gap: 10px; padding: 14px 16px; }
.gd-prog-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0; }
.gd-prog-line strong { font-size: var(--fs-md); font-variant-numeric: tabular-nums; }
.gd-prog-all { color: var(--primary-text); font-weight: 700; font-size: var(--fs-sm); }
.gd-prog-note { margin: 0; }
.gd-prog-note a { font-weight: 700; }
.gd-stage { display: grid; gap: 0; }
.gd-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.gd-step { display: flex; align-items: flex-start; gap: 12px; padding: 14px; }
.gd-step.is-done .gd-step-title { color: var(--muted); }
.gd-step.is-done .gd-step-text { color: var(--muted); }
.gd-tick { position: relative; flex-shrink: 0; display: grid; place-items: center; width: var(--tap); height: var(--tap); margin: -6px 0 0 -6px; cursor: pointer; }
.gd-tick input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.gd-tick input:disabled { cursor: progress; }
.gd-tick-box { display: grid; place-items: center; width: 28px; height: 28px; border: 2px solid var(--border); border-radius: 8px; background: var(--field); color: transparent; transition: background .12s, border-color .12s; }
.gd-tick-box .icon { width: 18px; height: 18px; }
.gd-tick input:checked + .gd-tick-box { background: var(--primary-deep); border-color: var(--primary-deep); color: var(--on-primary); }
.gd-tick input:focus-visible + .gd-tick-box { outline: 3px solid var(--primary); outline-offset: 2px; }
.gd-step-body { flex: 1; min-width: 0; display: grid; gap: 8px; }
.gd-step-title { margin: 0; font-size: var(--fs-md); line-height: 1.3; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; overflow-wrap: anywhere; }
.gd-step-text { margin: 0; line-height: 1.55; max-width: 65ch; overflow-wrap: anywhere; }
.gd-watch { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 10px 12px; border-radius: var(--r-sm); background: var(--danger-soft); font-size: var(--fs-sm); line-height: 1.5; }
.gd-watch .icon { flex-shrink: 0; width: 16px; height: 16px; margin-top: 2px; color: var(--danger); }
.gd-where { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: var(--fs-sm); line-height: 1.5; font-weight: 600; }
.gd-where .icon { flex-shrink: 0; width: 16px; height: 16px; margin-top: 2px; color: var(--primary); }
.gd-step-links { display: flex; flex-wrap: wrap; gap: 8px; }
.gd-step-links .btn { white-space: normal; text-align: left; max-width: 100%; }
.gd-foot { margin: 0; }
.gd-prog .progress, .gd-fresh-card .progress { background: var(--primary-soft); }
.gd-prog .progress span, .gd-fresh-card .progress span { background: var(--primary); }
.dash-fresh-bar { display: block; height: 6px; margin-top: 8px; }

/* Campus Guide map (guide_campus.php ?view=map, assets/js/guide_map.js; G3). Leaflet's own CSS loads only
   with the map and after this file, so overrides here start with .gd-map. */
.gd-views { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; scroll-margin-top: calc(var(--header-h) + 8px); }
.gd-seg { display: inline-grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: var(--r-sm); background: var(--primary-soft); }
.gd-seg a {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 16px;
  border-radius: 8px; font-size: var(--fs-sm); font-weight: 700; color: var(--primary-text);
}
.gd-seg a:hover { text-decoration: none; color: var(--text); }
.gd-seg a .icon { width: 16px; height: 16px; }
.gd-seg a[aria-current="page"] { background: var(--primary); color: #fff; box-shadow: 0 1px 4px rgba(26, 26, 46, .12); }
.gd-seg a[aria-current="page"]:hover { color: #fff; }
.gd-map-size { font-size: 12px; color: var(--muted); }
.gd-fallback { margin: 0; }
.gd-map { display: grid; gap: 10px; }
.gd-map[hidden], .gd-map [hidden] { display: none; }
.gd-map-saver { display: grid; gap: 12px; justify-items: start; padding: 18px; }
.gd-map-frame {
  position: relative; height: min(62vh, 560px); min-height: 320px; overflow: hidden;
  border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--skeleton);
}
.gd-map-canvas { position: absolute; inset: 0; z-index: 0; background: var(--skeleton); font: inherit; }
.gd-map-skel { position: absolute; inset: 0; z-index: 1; border-radius: 0; pointer-events: none; }
.gd-map-empty {
  position: absolute; z-index: 2; top: 12px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 24px);
  margin: 0; padding: 8px 14px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-lift);
  font-size: var(--fs-sm); font-weight: 700; text-align: center;
}
/* The tapped place or shop: over the map, clear of the OpenStreetMap credit at the bottom. */
.gd-map-card {
  position: absolute; z-index: 3; left: 10px; right: 10px; bottom: 30px; max-width: 360px;
  display: grid; gap: 6px; justify-items: start; padding: 14px 44px 14px 14px; box-shadow: var(--shadow-lift);
}
.gd-map-card p { margin: 0; }
.gd-map-card-kind { font-size: 12px; font-weight: 700; color: var(--primary-text); text-transform: uppercase; letter-spacing: .04em; }
.gd-map-card-name { font-weight: 800; line-height: 1.3; overflow-wrap: anywhere; }
.gd-map-card-go { display: flex; flex-wrap: wrap; gap: 8px; }
.gd-map-card-meta { font-size: var(--fs-sm); color: var(--muted); }
.gd-map-card-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.gd-map-card .btn { margin-top: 4px; }
.gd-map-card-x {
  position: absolute; top: 4px; right: 4px; width: var(--tap); height: var(--tap); display: grid; place-items: center;
  border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer;
}
.gd-map-card-x .icon { width: 18px; height: 18px; }
.gd-map-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.gd-shops-toggle { align-items: center; font-weight: 700; }
.gd-map-msg { margin: 0; font-weight: 700; }
.gd-map-msg:empty { display: none; }
.gd-map-msg.is-error { font-weight: 400; color: var(--danger); }
.gd-map-note { margin: 0; font-size: 12px; }

/* Markers: small hexagons with the category icon, coloured by campus part (D8, guidePartColours(): indigo, green,
   navy, then teal, violet, slate; off campus and no part grey; never amber or red, which mean rewards and danger).
   Lighter in dark mode, with dark icons. Founding shops amber-ringed and labelled. */
:root {
  --gd-part-1: #4F46E5; --gd-part-2: #15803D; --gd-part-3: #1E2A5E; --gd-part-4: #0F766E; --gd-part-5: #7C3AED;
  --gd-part-6: #475569; --gd-part-off: #6B7280; --gd-pin-ink: #FFFFFF;
}
[data-theme="dark"] {
  --gd-part-1: #8F89FF; --gd-part-2: #4ADE80; --gd-part-3: #60A5FA; --gd-part-4: #2DD4BF; --gd-part-5: #C4B5FD;
  --gd-part-6: #94A3B8; --gd-part-off: #A1A1AA; --gd-pin-ink: #0F0F1E;
}
.gd-part-1 { --gd-pin: var(--gd-part-1); } .gd-part-2 { --gd-pin: var(--gd-part-2); } .gd-part-3 { --gd-pin: var(--gd-part-3); }
.gd-part-4 { --gd-pin: var(--gd-part-4); } .gd-part-5 { --gd-pin: var(--gd-part-5); } .gd-part-6 { --gd-pin: var(--gd-part-6); }
.gd-part-off { --gd-pin: var(--gd-part-off); }
.gd-map .gd-pin { background: none; border: 0; }
.gd-pin-hex {
  display: grid; place-items: center; width: 30px; height: 34px; color: var(--gd-pin-ink); background: var(--gd-pin, var(--primary-deep));
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.gd-pin-hex .icon { width: 15px; height: 15px; }
.gd-pin:focus-visible { outline: none; }
.gd-pin:focus-visible .gd-pin-hex, .gd-pin:hover .gd-pin-hex { filter: brightness(1.15); }
/* Key places: a bigger hexagon inside a white (dark mode: navy) rim, so they read from far out. */
.gd-pin-keyring {
  display: grid; place-items: center; width: 44px; height: 50px; background: var(--surface);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.gd-pin-key { filter: drop-shadow(0 2px 3px rgba(15, 15, 30, .35)); }
.gd-pin-keyring .gd-pin-hex { width: 38px; height: 44px; }
.gd-pin-keyring .gd-pin-hex .icon { width: 19px; height: 19px; }
.gd-pin-shop { display: grid; justify-items: center; gap: 2px; }
.gd-pin-ring {
  display: grid; place-items: center; width: 34px; height: 38px; background: var(--accent);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.gd-pin-ring .gd-pin-hex { width: 27px; height: 31px; }
.gd-pin-shop .gd-pin-hex { color: var(--on-primary); }
.gd-pin-label, .gd-tag-featured {
  display: inline-block; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: var(--on-accent);
  font-size: 10px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; line-height: 1.5;
}
.gd-map .gd-bubble { background: none; border: 0; display: grid; justify-items: center; align-content: center; gap: 2px; }
.gd-bubble-n {
  display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 8px; border-radius: 999px;
  background: var(--gd-pin, var(--primary-deep)); color: var(--gd-pin-ink); font-weight: 800; font-size: var(--fs-sm);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--gd-pin, var(--primary)) 22%, transparent);
}
.gd-bubble-l {
  max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 6px; border-radius: 6px;
  background: var(--surface); color: var(--text); font-size: 11px; font-weight: 700;
}
.gd-map .gd-me { fill: var(--primary); fill-opacity: 1; stroke: var(--on-primary); stroke-width: 3; }
.gd-map .gd-me-ring { fill: var(--primary); fill-opacity: .12; stroke: var(--primary); stroke-opacity: .4; stroke-width: 1; }

/* Leaflet controls in our tokens (both themes). The OpenStreetMap credit always stays visible. */
.gd-map .leaflet-container { font: inherit; background: var(--skeleton); }
.gd-map .leaflet-bar { border: 1px solid var(--border); box-shadow: var(--shadow-lift); }
.gd-map .leaflet-bar a { background: var(--surface); color: var(--text); border-bottom-color: var(--border); width: 36px; height: 36px; line-height: 36px; }
.gd-map .leaflet-bar a:hover { background: var(--primary-soft); }
.gd-map .leaflet-bar a.leaflet-disabled { color: var(--muted); background: var(--surface); }
.gd-map .leaflet-control-attribution { display: block !important; background: var(--surface); color: var(--muted); font-size: 11px; opacity: .92; }
.gd-map .leaflet-control-attribution a { color: var(--primary-text); }

/* D8: the colour key (top right) and the north arrow (under the zoom buttons). */
.gd-map-key {
  margin: 10px 10px 0 0; padding: 7px 10px; border-radius: var(--r-sm); background: var(--surface); color: var(--text);
  border: 1px solid var(--border); box-shadow: var(--shadow-lift); font-size: 11px; font-weight: 700; line-height: 1.2;
}
.gd-map-key ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.gd-map-key li { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.gd-key-dot {
  flex-shrink: 0; width: 11px; height: 12.5px; background: var(--gd-pin, var(--primary-deep));
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.gd-key-big .gd-key-dot { width: 15px; height: 17px; background: var(--muted); outline: 0; }
/* Key places on top of the Guide list: one sideways row of name chips (wrapping on a wide screen), in their part's colour. */
.gd-keys {
  list-style: none; margin: 0 -16px; padding: 2px 16px 6px; display: flex; gap: 8px; overflow-x: auto;
  scrollbar-width: none; scroll-snap-type: x proximity; overscroll-behavior-x: contain;
}
.gd-keys::-webkit-scrollbar { display: none; }
.gd-keys li { flex-shrink: 0; scroll-snap-align: start; }
@media (min-width: 900px) { .gd-keys { flex-wrap: wrap; margin: 0; padding: 0; overflow: visible; } }
.gd-key {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 6px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: var(--fs-sm); font-weight: 700; white-space: nowrap;
}
.gd-key:hover { text-decoration: none; border-color: var(--gd-pin, var(--primary)); }
.gd-north {
  display: grid; place-items: center; width: 38px; height: 38px; margin-top: 8px; border-radius: 50%;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-lift);
  font-size: 10px; font-weight: 800; line-height: 1;
}
.gd-north svg { width: 16px; height: 16px; margin-bottom: -2px; fill: var(--primary-deep); }
[data-theme="dark"] .gd-north svg { fill: var(--primary-text); }

/* Featured shops strip under Food and Printing in the list */
.gd-featured { display: grid; gap: 8px; margin-top: 10px; padding: 12px; border-radius: var(--r-md); background: var(--accent-soft); }
.gd-featured-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: var(--fs-sm); font-weight: 700; }
.gd-featured-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.gd-shop { display: flex; align-items: center; gap: 12px; padding: 10px 12px; color: var(--text); height: 100%; }
.gd-shop:hover { text-decoration: none; border-color: var(--accent); }
.gd-shop .st-card-body { justify-items: start; }
.gd-featured-all { justify-self: start; padding-block: 8px; font-size: var(--fs-sm); font-weight: 700; }
.gd-shop-hex { flex-shrink: 0; display: grid; place-items: center; width: 40px; height: 46px; background: var(--accent); }
.gd-shop-hex .hex { display: grid; place-items: center; width: 33px; height: 38px; background: var(--primary-deep); color: var(--on-primary); }
.gd-shop-hex .icon { width: 17px; height: 17px; }
.shop-pill-sm { padding: 2px 10px; gap: 6px; font-size: 12px; }
.shop-pill-sm::before { width: 8px; height: 8px; }

/* ---------- Campus shops (shops.php, session B3). Shares .lf-head, .lf-filters, .chips, .st-card-*, .shop-pill and .empty ---------- */
.shops { display: grid; gap: 16px; align-content: start; }
.app-main.shops { max-width: 880px; }
.shops-public { width: 100%; max-width: 880px; margin: 0 auto; padding: 20px 16px 48px; }
.shops-hall { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.shops-hall label { font-size: var(--fs-sm); font-weight: 700; }
.shops-hall .select { flex: 1; min-width: 0; max-width: 280px; padding-left: 12px; padding-right: 32px; }
.shops-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); margin-right: 6px; }
.chip.shops-open { display: inline-flex; align-items: center; }
.shops-results { display: grid; gap: 12px; }
.shops-list { list-style: none; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.shops-card { display: flex; align-items: flex-start; gap: 12px; padding: 12px; height: 100%; color: var(--text); transition: border-color .15s, box-shadow .15s, transform .12s; }
a.shops-card:hover { text-decoration: none; border-color: var(--primary); box-shadow: var(--shadow-lift); }
a.shops-card:active { transform: scale(.985); }
.shops-thumb { flex-shrink: 0; width: 72px; height: 72px; border-radius: var(--r-md); object-fit: cover; background: var(--primary-soft); }
.shops-thumb-empty { display: grid; place-items: center; }
.shops-thumb-empty .hex { width: 40px; height: 46px; display: grid; place-items: center; background: var(--surface); color: var(--primary-text); }
.shops-thumb-empty .icon, .shops-hex .icon { width: 20px; height: 20px; }
.shops-hex { flex-shrink: 0; width: 44px; height: 50px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); }
.shops-card .st-card-body { gap: 5px; }
.shops-badges, .shops-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.shops-badges .badge { padding: 1px 8px 1px 5px; font-size: 11px; gap: 4px; }
.shops-badges .badge .hex { width: 9px; height: 10px; }
.shops-deliv { overflow-wrap: anywhere; }
.shops-sponsored { display: grid; gap: 8px; padding: 12px; border-radius: var(--r-md); background: var(--accent-soft); }
.shops-sponsored-h { margin: 0; }
.st-skel .shops-card { pointer-events: none; }

/* ---------- Campus Guide suggestions, photos and reports (G5) ---------- */
.gd-photo { max-width: 560px; margin: 0; border-radius: var(--r-md); overflow: hidden; background: var(--primary-soft); }
.gd-photo img { display: block; width: 100%; max-height: 240px; object-fit: cover; aspect-ratio: 16 / 9; }
.gd-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.gd-pin { display: grid; gap: 8px; }
.gd-pin-status { margin: 0; }
.gd-pin-map .ga-map { height: 260px; }
.gd-dups { display: grid; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--primary-soft); }
.gd-dups p { margin: 0; }
.gd-dup-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; overflow-wrap: anywhere; }
.gd-dup-list a { font-weight: 700; }
/* admin_guide.php: Suggestions and Reports */
.ga-cmp { display: grid; gap: 6px; margin: 8px 0; }
.ga-cmp-row { display: grid; grid-template-columns: 84px 1fr 1fr; gap: 8px; align-items: start; font-size: var(--fs-sm); }
.ga-cmp-row > div { min-width: 0; overflow-wrap: anywhere; }
.ga-cmp-h { font-weight: 700; color: var(--muted); }
.ga-cmp-new { border-radius: var(--r-sm); padding: 2px 6px; margin: -2px -6px; background: var(--success-soft); }
.ga-cmp-img { display: block; max-width: 100%; max-height: 180px; border-radius: var(--r-sm); }
.ga-decide { display: grid; gap: 8px; margin-top: 8px; }
.ga-warn-list { margin: 4px 0 0; padding-left: 18px; }
@media (max-width: 420px) {
  .ga-cmp-row { grid-template-columns: 1fr 1fr; }
  .ga-cmp-row > :first-child { grid-column: 1 / -1; }
}

/* ============================================
   INSTALL BANNER (assets/js/install.js)
   ============================================ */
.install-bar {
  position: fixed; z-index: 60; left: 12px; right: 12px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  max-width: 480px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 8px 10px 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-lift);
}
.install-bar.with-nav { bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 12px); }
.install-bar img { flex: none; width: 40px; height: 40px; border-radius: 10px; }
.install-text { flex: 1; min-width: 0; display: grid; font-size: var(--fs-sm); line-height: 1.35; color: var(--muted); }
.install-text strong { color: var(--text); font-size: 14px; line-height: 1.3; }
.install-actions { flex: none; display: flex; align-items: center; gap: 2px; }
@media print { .install-bar { display: none !important; } }

/* ---------- Events (shares the .lf-* card, chips, sheet and form styles) ---------- */
.ev-date { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.ev-date b { font-size: var(--fs-lg); font-weight: 800; }
.ev-date span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Moderation, Report and Block (ADM2) ---------- */
.badge-danger { background: var(--danger-soft); color: var(--text); }
.mod-note { margin: 0 0 4px; padding: 10px 12px; font-size: var(--fs-sm); color: var(--text); background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: var(--r-sm, 8px); text-align: left; }
.pf > .mod-note { margin: 0 0 12px; }
.rp-link { justify-self: center; align-self: center; color: var(--muted); }
.rp-what { margin: 0 0 4px; overflow-wrap: anywhere; }
.rp-block { margin-top: 2px; }
.ms-removed { font-style: italic; color: var(--muted); }
.ms-held { display: block; font-size: 11px; color: var(--muted); }
.ms-more { display: grid; gap: 10px; }
.ms-closed .btn { margin-top: 8px; }
.ms-closed p { margin: 0; }
.mod-item { overflow-wrap: anywhere; }
.mod-state { margin: 0; font-size: var(--fs-sm); font-weight: 700; color: var(--primary-text); }
.mod-text { margin: 0; padding: 10px 12px; font-size: var(--fs-sm); white-space: pre-wrap; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-sm, 8px); }
.mod-chat { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.mod-chat li { display: grid; gap: 2px; padding: 8px 10px; font-size: var(--fs-sm); background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-sm, 8px); }
.mod-chat li.is-reported { border-color: var(--danger); background: var(--danger-soft); }
.mod-chat-who { font-size: 12px; color: var(--muted); }
.mod-chat-text { white-space: pre-wrap; }
.mod-held { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: var(--fs-sm); }
.mod-held li { display: grid; gap: 6px; padding: 8px 10px; border: 1px dashed var(--border); border-radius: var(--r-sm, 8px); }
.mod-details summary { cursor: pointer; font-size: var(--fs-sm); color: var(--primary-text); font-weight: 600; }
.mod-details p, .mod-details form { margin-top: 8px; font-size: var(--fs-sm); }
.mod-decide { display: grid; gap: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.mod-warn dd, .mod-warn-line { color: var(--danger); font-weight: 600; }
.mod-warn-line { margin: 0; font-size: var(--fs-sm); }
.mod-off { opacity: .6; }
.mod-sub { font-size: var(--fs-md, 1rem); margin: 0; }
.mod-kinds { margin-top: -4px; }
.set-blocks { display: grid; gap: 8px; list-style: none; padding: 0; margin: 0; }
.set-blocks li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.set-blocks .set-who { min-width: 0; overflow-wrap: anywhere; }
/* Cards never grow past a phone screen: grid children may shrink below their content (long selects, names). */
.adm > *, .adm-list > li, .mod-item > *, .mod-decide > *, .mod-decide .field, .mod-decide .select, .mod-decide .input { min-width: 0; max-width: 100%; }
.mod-decide .select { width: 100%; text-overflow: ellipsis; }

/* Shop reviews (R1): the block on the shop page, Customers on the business side, rating chips on shop cards */
.sp-rev-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.sp-rev-score { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sp-rev-score strong { font-size: var(--fs-lg, 1.125rem); }
.sp-rev-do { display: grid; }
.sp-rev-do .btn { justify-self: start; }
.sp-rating { display: inline-flex; align-items: center; gap: 4px; }
.sp-rating .pf-stars .icon { width: 13px; height: 13px; }
.sp-revs { display: grid; gap: 8px; list-style: none; padding: 0; margin: 0; }
.cu-list { display: grid; gap: 8px; list-style: none; padding: 0; margin: 0; }
.cu-item { display: grid; gap: 8px; }
.cu-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cu-actions .btn { min-height: 44px; }
.cu-note { font-size: var(--fs-sm); color: var(--muted); }
.cu-off { opacity: .65; }
.cu-invite { display: grid; gap: 8px; }
.cu-link { display: flex; gap: 8px; align-items: center; }
.cu-link .input { min-width: 0; flex: 1; }
.shops-rate { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); color: var(--muted); }
.shops-rate .pf-stars .icon { width: 13px; height: 13px; }
.shops-rate strong { color: var(--text); }
.shops-top { color: var(--primary-text); font-weight: 700; }

/* ---------- Skills on profiles (R2): includes/layout/pf_skills*.php, assets/js/skills.js ---------- */
.sk-banner, .sk-waiting { display: flex; align-items: flex-start; gap: 12px; color: inherit; border-color: var(--primary); }
a.sk-banner:hover, .sk-waiting:hover { text-decoration: none; background: var(--primary-soft); }
.sk-banner-ico { flex-shrink: 0; width: 40px; height: 46px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); }
.sk-banner-ico .icon { width: 20px; height: 20px; }
.sk-banner-body { display: grid; gap: 4px; min-width: 0; flex: 1; }
.sk-banner-body strong { font-size: var(--fs-body); }
.sk-banner-body .muted { font-size: var(--fs-sm); }
.sk-banner-quote { font-size: var(--fs-sm); overflow-wrap: anywhere; }
.sk-banner-quote small { color: var(--muted); font-size: 12px; }
.sk-waiting { align-items: center; font-size: var(--fs-sm); }

.sk-list { min-width: 0; }
.sk-card { padding: 0; min-width: 0; }
.sk-off { opacity: .75; }
.sk-sum { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; min-height: var(--tap); cursor: pointer; list-style: none; }
.sk-sum::-webkit-details-marker { display: none; }
.sk-sum:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; border-radius: var(--r-md); }
.sk-sum-main { display: grid; gap: 2px; min-width: 0; }
.sk-title { font-weight: 700; overflow-wrap: anywhere; }
.sk-line { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); color: var(--muted); }
.sk-line .icon { width: 14px; height: 14px; }
.sk-line .on { color: var(--accent); fill: var(--accent); }
.sk-chev { flex-shrink: 0; width: 20px; height: 20px; color: var(--muted); transition: transform .15s; }
details[open] > .sk-sum .sk-chev { transform: rotate(180deg); }
.sk-body { display: grid; gap: 12px; padding: 0 16px 16px; min-width: 0; }
.sk-desc { white-space: pre-line; overflow-wrap: anywhere; }
.sk-photos { list-style: none; padding: 0; margin: 0; display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 4px; }
.sk-photos li { flex: 0 0 auto; scroll-snap-align: start; }
.sk-ph { display: block; padding: 0; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--skeleton); overflow: hidden; cursor: zoom-in; }
.sk-ph img { display: block; width: 104px; height: 104px; object-fit: cover; }
.sk-links { margin-top: 0; }
.sk-reviews { display: grid; gap: 8px; min-width: 0; }
.sk-skel { display: grid; gap: 8px; }
.sk-empty { display: grid; gap: 4px; justify-items: start; font-size: var(--fs-sm); }
.sk-count { font-size: var(--fs-sm); }
.sk-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sk-why { display: grid; gap: 6px; justify-items: start; }
.sk-reviews .pf-review { padding: 12px; }

.sk-edit-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.sk-edit-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sk-edit-main { display: grid; min-width: 0; flex: 1; }
.sk-edit-main strong { overflow-wrap: anywhere; }
.sk-edit-photos { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.sk-edit-photo { display: grid; gap: 4px; justify-items: center; font-size: 12px; }
.sk-edit-photo img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--border); }

.sk-photo-dlg { max-width: min(96vw, 720px); width: 100%; padding: 12px; border: 0; border-radius: var(--r-lg); background: var(--surface); color: var(--text); }
.sk-photo-dlg::backdrop { background: var(--photo-scrim); }
.sk-photo-dlg img { display: block; width: 100%; max-height: 70vh; object-fit: contain; border-radius: var(--r-sm); background: var(--skeleton); }
.sk-photo-x { position: absolute; top: 8px; right: 8px; background: var(--surface); }
.sk-photo-nav { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 10px; }
.sk-flip { transform: scaleX(-1); }

/* ============================================================
   Home: "The Hive is alive" (dashboard.php, docs/HOME_REDESIGN_PLAN.md v1)
   Indigo leads; amber only for the streak and confetti. Motion is off with reduced motion.
   ============================================================ */
.hv { gap: 28px; }
/* Home polish (UI/UX review, 2026-11-03): the honeycomb is a quiet texture in every mood, not a pattern you read. */
.hv-hello .hex-pattern { color: var(--hero-line-quiet); }
.hv-hello h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: var(--fs-xl); line-height: 1.2; margin-bottom: 10px; }
.hv-wave { display: inline-block; transform-origin: 70% 70%; animation: hv-wave 1.6s ease-in-out .3s 2; }
@keyframes hv-wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20%, 40% { transform: rotate(-8deg); } }
.hv-line {
  position: relative; max-width: 46ch; margin-bottom: 14px; padding: 10px 12px 10px 14px;
  border-radius: var(--r-md); background: var(--hero-glass); border-left: 3px solid var(--on-primary);
  font-size: var(--fs-sm); line-height: 1.5; color: var(--on-primary);
  animation: hv-rise .5s ease-out both .15s;
}
.hv-line-tag { display: block; margin-bottom: 2px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--on-panel-muted); }
.hv-streak { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 700; }
.hv-streak .icon { width: 14px; height: 14px; }
.hv-reward { padding: 12px; }
@keyframes hv-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Launch week card */
.hv-launch {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px; text-align: left;
  border: 1.5px solid var(--primary); background: var(--brand-gradient); color: var(--on-primary); cursor: pointer;
}
.hv-launch-text { display: grid; gap: 2px; }
.hv-launch-text strong { font-size: var(--fs-md); }
.hv-launch-text small { color: var(--on-panel-muted); }
.hv-launch-hexes { position: relative; flex-shrink: 0; width: 44px; height: 44px; }
.hv-launch-hexes span { position: absolute; width: 22px; height: 25px; background: var(--hero-glass); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.hv-launch-hexes span:nth-child(1) { left: 0; top: 0; }
.hv-launch-hexes span:nth-child(2) { left: 22px; top: 0; background: var(--on-primary); }
.hv-launch-hexes span:nth-child(3) { left: 11px; top: 19px; }
.hv-launch.is-party .hv-launch-hexes span { animation: hv-pop .5s ease-out both; }
.hv-launch.is-party .hv-launch-hexes span:nth-child(2) { animation-delay: .08s; }
.hv-launch.is-party .hv-launch-hexes span:nth-child(3) { animation-delay: .16s; }
@keyframes hv-pop { 0% { transform: scale(1); } 50% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* Today on campus */
.hv-kicker { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: var(--fs-sm); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.hv-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--success); animation: hv-pulse 1.8s ease-out infinite; }
@keyframes hv-pulse { 0% { box-shadow: 0 0 0 0 var(--success); } 100% { box-shadow: 0 0 0 10px transparent; } }
.hv-chips { display: flex; gap: 8px; margin: 0 -16px; padding: 2px 16px 6px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; list-style: none; }
.hv-chips::-webkit-scrollbar { display: none; }
.hv-chips li { scroll-snap-align: start; animation: hv-rise .45s ease-out both; }
.hv-chips li:nth-child(2) { animation-delay: .06s; }
.hv-chips li:nth-child(3) { animation-delay: .12s; }
.hv-chips li:nth-child(n+4) { animation-delay: .18s; }
.hv-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 14px; white-space: nowrap;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: var(--fs-sm); font-weight: 600;
}
.hv-chip:hover { text-decoration: none; border-color: var(--primary); }
.hv-chip .icon { width: 16px; height: 16px; color: var(--primary-text); }

/* Lost & Found first */
.hv-lf { display: grid; gap: 14px; padding: 18px; border: 1.5px solid var(--primary); box-shadow: var(--shadow-soft); }
.hv-lf-head { display: flex; align-items: center; gap: 12px; }
.hv-lf-head h2 { font-size: var(--fs-lg); line-height: 1.2; }
.hv-lf-head p { font-size: var(--fs-sm); color: var(--muted); }
.hv-lf-mark { flex-shrink: 0; display: grid; place-items: center; width: 44px; height: 50px; background: var(--primary-deep); color: var(--on-primary); }
.hv-lf-search { display: flex; gap: 8px; }
.hv-lf-search .input { flex: 1; min-width: 0; }
.hv-lf-search .btn { flex-shrink: 0; width: 48px; padding: 0; }
.hv-lf-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hv-more { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); font-weight: 700; }
.hv-more .icon { width: 14px; height: 14px; }
.hv-lf-note { font-size: var(--fs-sm); color: var(--muted); }
.hv-lf-row { display: flex; gap: 10px; margin: 0 -18px; padding: 2px 18px 4px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory; list-style: none; }
.hv-lf-row::-webkit-scrollbar { display: none; }
.hv-lf-row li { flex: 0 0 148px; scroll-snap-align: start; }
.hv-lf-card { display: grid; gap: 4px; color: var(--text); }
.hv-lf-card:hover { text-decoration: none; }
.hv-lf-pic { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--r-md); background: var(--primary-soft); color: var(--primary-text); }
.hv-lf-pic img { width: 100%; height: 100%; object-fit: cover; }
.hv-lf-pic .icon { width: 28px; height: 28px; }
.hv-lf-pic .lf-type { position: absolute; left: 6px; top: 6px; }
.hv-lf-title { font-size: var(--fs-sm); font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hv-lf-meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Explore shortcuts */
.hv-explore { min-width: 0; }   /* without it the tile row widens the whole Home column past a 360px screen (desk 2026-11-03) */
.hv-explore ul { display: flex; gap: 6px; margin: 0 -16px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; list-style: none; }
.hv-explore ul::-webkit-scrollbar { display: none; }
.hv-explore-link { display: grid; justify-items: center; gap: 6px; width: 72px; font-size: 12px; font-weight: 600; color: var(--text); text-align: center; }
.hv-explore-link:hover { text-decoration: none; color: var(--primary-text); }
.hv-explore-link .hex { display: grid; place-items: center; width: 48px; height: 54px; background: var(--surface); color: var(--primary-text); }

/* For You */
.hv-foryou { display: grid; gap: 12px; }
.hv-foryou-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.hv-foryou-head h2 { font-size: var(--fs-xl); letter-spacing: -0.02em; }
.hv-foryou-head .muted { font-size: var(--fs-sm); }
.hv-filters { display: flex; gap: 8px; margin: 0 -16px; padding: 0 16px 2px; overflow-x: auto; scrollbar-width: none; }
.hv-filters::-webkit-scrollbar { display: none; }
.hv-filter {
  flex-shrink: 0; min-height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: var(--fs-sm); font-weight: 600; transition: background-color .15s, color .15s;
}
.hv-filter[aria-pressed="true"] { background: var(--primary-deep); border-color: var(--primary-deep); color: var(--on-primary); }
.hv-feed { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.hv-feed > li { display: grid; animation: hv-rise .35s ease-out both; }
.hv-card { display: flex; gap: 12px; padding: 12px; color: var(--text); align-items: flex-start; }
.hv-card:hover { text-decoration: none; border-color: var(--primary); box-shadow: var(--shadow-soft); }
.hv-card-body { display: grid; gap: 4px; flex: 1; min-width: 0; }
.hv-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hv-card-title { font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hv-card-line { font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hv-card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px; color: var(--muted); }
.hv-place { display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; }
.hv-place span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hv-place .icon { width: 13px; height: 13px; flex-shrink: 0; }
.hv-card-ico { flex-shrink: 0; display: grid; place-items: center; width: 46px; height: 52px; background: var(--primary-soft); color: var(--primary-text); }
.hv-card-ico .icon { width: 22px; height: 22px; }
.hv-tag { display: inline-flex; align-items: center; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--primary-soft); color: var(--primary-text); white-space: nowrap; }
.hv-tag-errand { background: var(--success-soft); color: var(--text); }
.hv-tag-swap { background: var(--seg-bg); color: var(--text); }
.hv-price { font-size: var(--fs-md); font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; }
.hv-card-errand { border-left: 4px solid var(--success); }
.hv-card-errand .hv-card-ico { background: var(--success-soft); color: var(--text); }
.hv-card-errand .hv-price { font-size: var(--fs-lg); }
/* A market item leads with its photo */
.hv-card-item, .hv-card-pic { display: grid; grid-template-columns: 112px 1fr; padding: 0; overflow: hidden; }
.hv-card-item .hv-card-body, .hv-card-pic .hv-card-body { padding: 12px 12px 12px 0; }
.hv-card-photo { position: relative; display: grid; place-items: center; min-height: 112px; height: 100%; background: var(--primary-soft); color: var(--primary-text); }
.hv-card-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hv-card-noimg .icon { width: 28px; height: 28px; }
.hv-price-chip { position: absolute; left: 6px; bottom: 6px; padding: 2px 8px; border-radius: 999px; background: var(--photo-scrim); color: var(--on-photo); font-size: 13px; font-weight: 800; }
/* An event leads with its date */
.hv-date { flex-shrink: 0; display: grid; place-items: center; width: 52px; padding: 6px 0; border-radius: var(--r-md); background: var(--primary-deep); color: var(--on-primary); line-height: 1; }
.hv-date strong { font-size: 22px; font-weight: 800; }
.hv-date small { margin-top: 3px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.hv-skel .hv-card { pointer-events: none; }
.hv-skel-ico { width: 46px; height: 52px; border-radius: 0; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); flex-shrink: 0; }
/* The study nudge woven into the feed */
.hv-nudge { display: flex; align-items: center; gap: 12px; padding: 14px; color: var(--text); background: var(--primary-soft); border: 1px solid var(--primary); }
.hv-nudge:hover { text-decoration: none; }
.hv-nudge .hv-card-body strong { font-size: var(--fs-body); }
.hv-nudge .hv-card-body .muted { font-size: var(--fs-sm); }
.hv-nudge-ico { flex-shrink: 0; display: grid; place-items: center; width: 44px; height: 50px; background: var(--primary-deep); color: var(--on-primary); }
.hv-nudge .btn { flex-shrink: 0; }
.hv-nudge-wrap { position: relative; }
.hv-nudge-wrap .hv-nudge { padding-right: 40px; }
.hv-nudge-wrap .hv-tip-x { top: 2px; right: 2px; }
.hv-feed-error { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--danger-soft); font-size: var(--fs-sm); }
.hv-end { text-align: center; font-size: var(--fs-sm); padding: 8px 0; }

/* The moments: welcome and "You're Trusted!" */
.hv-moment {
  width: min(420px, calc(100vw - 32px)); max-height: calc(100vh - 32px); margin: auto; padding: 0; border: 0;
  border-radius: var(--r-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lift);
}
.hv-moment::backdrop { background: var(--scrim); backdrop-filter: blur(3px); }
.hv-moment-in { display: grid; justify-items: center; gap: 14px; padding: 28px 22px 20px; text-align: center; }
.hv-moment h2 { font-size: var(--fs-lg); line-height: 1.3; }
.hv-moment p { color: var(--muted); font-size: var(--fs-body); }
.hv-moment-actions { display: flex; justify-content: center; gap: 10px; width: 100%; margin-top: 6px; }
.hv-moment-actions .btn { flex: 1; }
.hv-moment.is-in .hv-moment-in > * { animation: hv-rise .45s ease-out both; }
.hv-moment.is-in .hv-moment-in > :first-child { animation: none; }
.hv-moment.is-in .hv-moment-in > :nth-child(2) { animation-delay: .9s; }
.hv-moment.is-in .hv-moment-in > :nth-child(n+3) { animation-delay: 1.05s; }
/* Seven cells fly in and lock into a hive around the logo */
.hv-hive { position: relative; width: 132px; height: 132px; }
.hv-cell { position: absolute; left: 50%; top: 50%; width: 40px; height: 46px; margin: -23px 0 0 -20px; background: var(--primary); opacity: .9;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.hv-cell-0 { background: var(--primary-deep); transform: translate(0, 0); }
.hv-cell-1 { transform: translate(42px, 0); }
.hv-cell-2 { transform: translate(-42px, 0); }
.hv-cell-3 { transform: translate(21px, -36px); background: var(--primary-soft); }
.hv-cell-4 { transform: translate(-21px, -36px); }
.hv-cell-5 { transform: translate(21px, 36px); }
.hv-cell-6 { transform: translate(-21px, 36px); background: var(--accent); }
.hv-moment.is-in .hv-cell { animation: hv-fly .7s cubic-bezier(.2, .8, .2, 1.1) both; }
.hv-moment.is-in .hv-cell-1 { animation-delay: .05s; }
.hv-moment.is-in .hv-cell-2 { animation-delay: .1s; }
.hv-moment.is-in .hv-cell-3 { animation-delay: .15s; }
.hv-moment.is-in .hv-cell-4 { animation-delay: .2s; }
.hv-moment.is-in .hv-cell-5 { animation-delay: .25s; }
.hv-moment.is-in .hv-cell-6 { animation-delay: .3s; }
@keyframes hv-fly { from { opacity: 0; translate: 0 -120px; scale: .3; rotate: -120deg; } to { opacity: .9; translate: 0 0; scale: 1; rotate: 0deg; } }
.hv-hive-logo { position: absolute; left: 50%; top: 50%; width: 30px; height: auto; transform: translate(-50%, -50%); }
.hv-moment.is-in .hv-hive-logo { animation: hv-logo .5s ease-out .75s both; }
@keyframes hv-logo { from { opacity: 0; scale: .4; } to { opacity: 1; scale: 1; } }
.hv-slides { position: relative; display: grid; width: 100%; min-height: 128px; }
.hv-slide { grid-area: 1 / 1; display: grid; justify-items: center; align-content: start; gap: 6px; opacity: 0; transform: translateX(16px); transition: opacity .3s, transform .3s; pointer-events: none; }
.hv-slide.is-on { opacity: 1; transform: none; pointer-events: auto; }
.hv-slide .hex { display: grid; place-items: center; width: 44px; height: 50px; background: var(--primary-soft); color: var(--primary-text); }
.hv-slide strong { font-size: var(--fs-md); }
.hv-slide p { font-size: var(--fs-sm); max-width: 30ch; }
.hv-dots { display: flex; gap: 6px; }
.hv-dots span { width: 7px; height: 7px; border-radius: 999px; background: var(--border); transition: width .25s, background-color .25s; }
.hv-dots span.is-on { width: 20px; background: var(--primary); }
.hv-badge-drop .hex { display: grid; place-items: center; width: 84px; height: 96px; background: var(--success); color: var(--on-primary); }
.hv-badge-drop .icon { width: 40px; height: 40px; }
.hv-trusted.is-in .hv-badge-drop { animation: hv-drop .8s cubic-bezier(.2, .9, .3, 1.3) both; }
@keyframes hv-drop { from { opacity: 0; transform: translateY(-60px) scale(.6) rotate(-20deg); } to { opacity: 1; transform: none; } }
/* Get Trusted and first weeks (desk fixes 2): an indigo badge that pops, quicker than the welcome */
.hv-ask .hv-badge-drop .hex { width: 64px; height: 74px; background: var(--primary); }
.hv-ask .hv-badge-drop .icon { width: 30px; height: 30px; }
.hv-ask.is-in .hv-badge-drop { animation: hv-logo .4s ease-out both; }
.hv-moment.hv-ask.is-in .hv-moment-in > :nth-child(2) { animation-delay: .15s; }
.hv-moment.hv-ask.is-in .hv-moment-in > :nth-child(n+3) { animation-delay: .25s; }
.hv-perks { display: grid; gap: 8px; width: 100%; padding: 12px 14px; border-radius: var(--r-md); background: var(--bg); text-align: left; font-size: var(--fs-sm); }
.hv-perks li { display: flex; align-items: center; gap: 10px; }
.hv-perks .icon { width: 18px; height: 18px; flex: none; color: var(--primary-text); }

/* Confetti: brand hexagons falling */
.hv-confetti { position: fixed; inset: 0; z-index: 1000; pointer-events: none; overflow: hidden; }
.hv-bit { position: absolute; top: -20px; width: 12px; height: 14px; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); animation: hv-fall 1.8s ease-in both; }
.hv-bit-0 { background: var(--primary); }
.hv-bit-1 { background: var(--primary-deep); }
.hv-bit-2 { background: var(--accent); }
.hv-bit-3 { background: var(--primary-soft); }
@keyframes hv-fall { to { transform: translate(var(--dx, 0), 105vh) rotate(var(--rot, 360deg)); } }

/* A flyer from admin (migration 109): the picture on top (skeleton until it loads), title, line, one button, x */
.hv-flyer { position: fixed; overflow-y: auto; }
.hv-flyer-x { position: absolute; top: 8px; right: 8px; z-index: 2; border-radius: 999px; background: color-mix(in srgb, var(--surface) 88%, transparent); }
.hv-flyer-pic { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1; max-height: 55vh; overflow: hidden; background: var(--primary-soft); }
.hv-flyer-pic.is-loaded { aspect-ratio: auto; max-height: none; }
.hv-flyer-pic img { display: block; width: 100%; height: auto; max-height: 55vh; object-fit: contain; }
.hv-flyer-pic:not(.is-loaded) img { position: absolute; inset: 0; opacity: 0; }
.hv-flyer-pic.is-loaded .hv-flyer-skel { display: none; }
.hv-flyer-skel { position: absolute; inset: 0; border-radius: 0; }
.hv-flyer-pic.is-saver .hv-flyer-skel { animation: none; }
.hv-flyer-load { position: relative; z-index: 1; }
.hv-flyer > .hv-badge-drop { display: grid; justify-items: center; padding-top: 28px; }
.hv-flyer .hv-badge-drop .hex { width: 64px; height: 74px; background: var(--primary); }
.hv-flyer .hv-badge-drop .icon { width: 30px; height: 30px; }
.hv-flyer-in { padding-top: 18px; }
.hv-flyer.is-in .hv-moment-in > * { animation-delay: .1s; }
.hv-flyer.is-in .hv-moment-in > :first-child { animation: hv-rise .45s ease-out both; }
.hv-flyer.is-in .hv-moment-in > :nth-child(n+2) { animation-delay: .2s; }
.hv-flyer.is-in > .hv-badge-drop { animation: hv-logo .4s ease-out both; }

/* v1.5: the hero's mood by the hour (not over your own cover photo). Brand tokens only. */
.hv-hello.hv-tod-morning:not(.dash-hero-photo) {
  background: radial-gradient(90% 80% at 0% 0%, var(--hero-ghost), transparent 60%), linear-gradient(150deg, var(--primary), var(--primary-deep));
  background: radial-gradient(80% 90% at 0% 0%, var(--hero-ghost), transparent 65%),
    linear-gradient(150deg, color-mix(in srgb, var(--primary) 72%, var(--on-primary)), var(--primary) 75%);
}
.hv-hello.hv-tod-evening:not(.dash-hero-photo) {
  background: radial-gradient(70% 90% at 100% 0%, var(--primary), transparent 70%), linear-gradient(170deg, var(--primary-deep), var(--night));
}
.hv-hello.hv-tod-night:not(.dash-hero-photo) {
  background: radial-gradient(60% 70% at 85% 10%, var(--primary-deep), transparent 70%), var(--night);
}
.hv-stars {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    radial-gradient(3px 3px at 12% 18%, var(--on-primary) 50%, transparent 51%),
    radial-gradient(2px 2px at 24% 62%, var(--on-primary) 50%, transparent 51%),
    radial-gradient(3px 3px at 41% 10%, var(--on-primary) 50%, transparent 51%),
    radial-gradient(2px 2px at 55% 46%, var(--on-primary) 50%, transparent 51%),
    radial-gradient(4px 4px at 70% 16%, var(--on-primary) 50%, transparent 51%),
    radial-gradient(2px 2px at 84% 38%, var(--on-primary) 50%, transparent 51%),
    radial-gradient(3px 3px at 93% 8%, var(--on-primary) 50%, transparent 51%),
    radial-gradient(2px 2px at 63% 78%, var(--on-primary) 50%, transparent 51%),
    radial-gradient(3px 3px at 90% 86%, var(--on-primary) 50%, transparent 51%),
    radial-gradient(2px 2px at 33% 34%, var(--on-primary) 50%, transparent 51%),
    radial-gradient(2px 2px at 6% 88%, var(--on-primary) 50%, transparent 51%),
    radial-gradient(14px 14px at 86% 22%, var(--hero-ghost) 40%, transparent 70%);
  animation: hv-twinkle 2.6s ease-in-out infinite alternate;
}
.hv-hello.hv-tod-night .hv-hello-in, .hv-hello.hv-tod-night .hv-reward { position: relative; z-index: 1; }
/* Over the student's own cover photo: the photo stays, only its shade follows the hour (stars at night too). */
.hv-hello.dash-hero-photo.hv-tod-morning::before { background: var(--photo-shade-morning); }
.hv-hello.dash-hero-photo.hv-tod-evening::before { background: var(--photo-shade-evening); }
.hv-hello.dash-hero-photo.hv-tod-night::before { background: var(--photo-shade-night); }
.hv-hello.dash-hero-photo::before { transition: background .6s ease; }

/* The campus calendar: welcome to a new semester, holiday countdown, exams */
.hv-sem-welcome { background: var(--brand-gradient); }
.hv-sem-cta { display: inline-flex; align-items: center; gap: 4px; margin-top: -16px; justify-self: start; font-size: var(--fs-sm); font-weight: 700; }
.hv-sem-cta .icon { width: 14px; height: 14px; }
.hv-sem-holiday { position: relative; overflow: hidden; }
/* The holiday palm: brand tokens only, so it follows light and dark; only the fronds sway (off with reduced motion). */
.hv-palm { position: absolute; right: 10px; top: 8px; width: 44px; height: 44px; }
.hv-palm-sun { fill: var(--primary-soft); }
.hv-palm-ground { fill: var(--seg-bg); }
.hv-palm-trunk { fill: none; stroke: var(--primary-deep); stroke-width: 3; stroke-linecap: round; }
.hv-palm-leaves { fill: var(--primary); transform-box: view-box; transform-origin: 25px 17px; animation: hv-sway 3s ease-in-out infinite alternate; }
[data-theme="dark"] .hv-palm-trunk { stroke: var(--primary-text); }
@keyframes hv-sway { from { transform: rotate(-6deg); } to { transform: rotate(6deg); } }
.hv-sem-holiday .hv-sem-top { padding-right: 44px; }
.hv-countdown { display: flex; align-items: baseline; gap: 8px; }
.hv-countdown strong { font-size: 40px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; color: var(--primary-text); }
.hv-countdown span { font-size: var(--fs-sm); color: var(--muted); }
.hv-sem-exams { border: 1.5px solid var(--primary); }
.hv-sem-sub { font-size: var(--fs-sm); }
@keyframes hv-twinkle { from { opacity: .45; } to { opacity: 1; } }
.hv-line p { margin: 0; }
.hv-line-share {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; min-height: 32px; padding: 0 12px;
  border: 0; border-radius: 999px; background: var(--on-primary); color: var(--primary-deep); font-size: 12px; font-weight: 700; cursor: pointer;
}
.hv-line-share .icon { width: 14px; height: 14px; }
.hv-line-share:active { transform: scale(.96); }

/* v1.5: semester progress, a honeycomb that fills week by week */
.hv-sem { display: grid; gap: 10px; padding: 14px 16px; color: var(--text); }
.hv-sem:hover { text-decoration: none; border-color: var(--primary); }
.hv-sem-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; font-size: var(--fs-sm); }
.hv-sem-top span { color: var(--muted); }
.hv-comb { display: flex; gap: 3px; }
.hv-comb span { flex: 1; max-width: 22px; aspect-ratio: .87; background: var(--seg-bg); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.hv-comb span:nth-child(even) { transform: translateY(5px); }
.hv-comb .is-done { background: var(--primary); }
.hv-comb .is-now { background: var(--primary-deep); animation: hv-now 1.6s ease-in-out infinite alternate; }
@keyframes hv-now { from { opacity: .55; } to { opacity: 1; } }
.hv-sem .hv-comb { padding-bottom: 5px; }

/* v1.5: "3 new posts · Tap to see", the toast, and the pulse on + for a first post */
.hv-new-pill {
  position: fixed; z-index: 60; left: 50%; top: calc(var(--header-h) + 10px); transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px;
  background: var(--primary-deep); color: var(--on-primary); font-size: var(--fs-sm); font-weight: 700; box-shadow: var(--shadow-lift);
  animation: hv-drop-in .4s cubic-bezier(.2, .9, .3, 1.2) both;
}
.hv-new-pill .icon { width: 14px; height: 14px; transform: rotate(-90deg); }
@keyframes hv-drop-in { from { opacity: 0; transform: translate(-50%, -16px); } to { opacity: 1; transform: translate(-50%, 0); } }
.hv-toast {
  position: fixed; z-index: 1001; left: 50%; bottom: calc(var(--bottom-nav-h) + 20px); max-width: calc(100vw - 32px);
  padding: 12px 18px; border-radius: 999px; background: var(--night); color: var(--on-primary); font-size: var(--fs-sm); font-weight: 700;
  box-shadow: var(--shadow-lift); transform: translateX(-50%);
}
.hv-toast.is-in { animation: hv-toast 3.6s ease both; }
@keyframes hv-toast { 0% { opacity: 0; transform: translate(-50%, 12px); } 10%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, 8px); } }
.bn-pulse .hex { animation: bn-pulse 2.4s ease-in-out infinite; }
@keyframes bn-pulse { 0%, 70%, 100% { transform: scale(1); } 80% { transform: scale(1.12); } 90% { transform: scale(.97); } }

/* v2a: a trending line's tag, the "Did you know?" tip, and the guided tour (a spotlight on the real button) */
.hv-line-hot { display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: 999px; background: var(--on-primary); color: var(--primary-deep); letter-spacing: .02em; text-transform: none; }
.hv-tip { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 14px 44px 14px 14px; color: var(--text); }
.hv-tip .hv-card-body { font-size: var(--fs-sm); line-height: 1.5; }
.hv-tip .hv-card-body strong { color: var(--primary-text); }
.hv-tip-ico { flex-shrink: 0; display: grid; place-items: center; width: 36px; height: 40px; background: var(--primary-soft); color: var(--primary-text); }
.hv-tip-ico .icon { width: 18px; height: 18px; }
.hv-tip-x { position: absolute; top: 6px; right: 6px; }
/* Page tours (D5, assets/js/tour.js): one shared bubble on every busy page. */
.tour { position: fixed; inset: 0; z-index: 1000; }
.tour-on, .tour-on body { overscroll-behavior: none; }
.tour-spot {
  position: fixed; border-radius: var(--r-md); box-shadow: 0 0 0 9999px var(--scrim), 0 0 0 3px var(--primary);
  transition: left .3s ease, top .3s ease, width .3s ease, height .3s ease; pointer-events: none;
}
.tour-spot.is-none { left: 50% !important; top: 50% !important; width: 0 !important; height: 0 !important; box-shadow: 0 0 0 9999px var(--scrim); }
.tour-tip {
  position: fixed; display: grid; gap: 6px; padding: 14px 16px 14px; border-radius: var(--r-lg); background: var(--surface); color: var(--text);
  border: 1px solid var(--border); box-shadow: var(--shadow-lift); max-height: calc(100vh - 32px); overflow-y: auto;
}
.tour-tip.is-in { animation: hv-rise .28s ease-out both; }
.tour-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tour-n { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--primary-text); }
.tour-skip { border: 0; background: none; padding: 6px 2px; font: inherit; font-size: var(--fs-sm); color: var(--muted); cursor: pointer; }
.tour-skip:hover { color: var(--text); }
.tour-bar { height: 3px; border-radius: 3px; background: var(--primary-soft); overflow: hidden; }
.tour-bar span { display: block; height: 100%; background: var(--primary); transition: width .3s ease; }
.tour-tip strong { display: block; margin-top: 4px; font-size: var(--fs-md); }
.tour-tip p { margin: 4px 0 0; font-size: var(--fs-sm); color: var(--muted); line-height: 1.5; }
.tour-link a { font-weight: 600; color: var(--primary-text); }
.tour-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.tour-actions [hidden] { display: none; }
@media (prefers-reduced-motion: reduce) {
  .tour-spot, .tour-bar span { transition: none; }
  .tour-tip.is-in { animation: none; }
}

/* Home on a phone (Josh, 2026-11-03: "that first page is just big"): a calmer hero that leaves room for Lost &
   Found on the first screen. Greeting on one line, today's line and the invite strip compact, tighter gaps. */
@media (max-width: 767px) {
  .app-main.hv { padding-top: 14px; gap: 24px; }
  .hv .hv-hello { gap: 12px; padding: 16px; }
  .hv-hello h1 { display: block; font-size: 20px; line-height: 1.25; margin-bottom: 8px; }
  .hv-hello h1 .hv-wave { margin-left: 2px; }
  .hv .hv-reward { gap: 8px; padding: 10px 12px; }
  .hv .dash-reward-count { font-size: var(--fs-md); }
  .hv .dash-reward .btn-sm { min-height: 32px; padding: 0 12px; }
  .hv .dash-reward p { font-size: 12px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .hv-lf { gap: 12px; padding: 14px; }
  .hv-lf-head h2 { font-size: var(--fs-md); }
  .hv-lf-mark { width: 38px; height: 44px; }
  .hv .verify-card { gap: 10px; padding: 14px; }
  .hv .verify-card h2 { font-size: var(--fs-md); }
  .hv-nudge { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 6px 12px; }
  .hv-nudge .btn { grid-column: 2; justify-self: start; }
}

@media (min-width: 768px) {
  .hv-feed { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hv-feed > .hv-nudge-li { grid-column: 1 / -1; }
  .hv-chips, .hv-filters, .hv-explore ul { margin: 0; padding-left: 0; padding-right: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hv *, .hv-moment *, .hv-moment, .hv-new-pill, .hv-toast, .bn-pulse .hex { animation: none !important; transition: none !important; }
  .hv-slide { transform: none; }
}

/* Help (D5, help.php): search, topic chips, tap-to-open answers, contact. */
.hlp { display: grid; gap: 16px; align-content: start; max-width: 760px; width: 100%; }
.hlp-public { margin: 0 auto; padding: 20px 16px 48px; }
.hlp-search { position: relative; }
.hlp-search .input { padding-left: 42px; }
.hlp-search-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; pointer-events: none; }
.hlp-search-ico .icon { width: 18px; height: 18px; }
.hlp-jump[hidden], .hlp-sec[hidden], .hlp-q[hidden] { display: none; }
.hlp-count { margin: -8px 0 0; font-size: var(--fs-sm); }
.hlp-count:empty { display: none; }
.hlp-sections { display: grid; gap: 24px; }
.hlp-sec { scroll-margin-top: 80px; }
.hlp-sec-head { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.hlp-sec-head h2 { flex: 1; margin: 0; font-size: var(--fs-md); }
.hlp-ico { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 36px; background: var(--primary-soft); color: var(--primary-text); }
.hlp-ico .icon { width: 16px; height: 16px; }
.hlp-tour { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--primary-text); text-decoration: none; padding: 6px 0; }
.hlp-tour .icon { width: 16px; height: 16px; }
.hlp-q { border-bottom: 1px solid var(--border); }
.hlp-q summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 2px; min-height: 48px;
  font-weight: 600; cursor: pointer; list-style: none;
}
.hlp-q summary::-webkit-details-marker { display: none; }
.hlp-chev { width: 16px; height: 16px; flex-shrink: 0; color: var(--muted); transform: rotate(90deg); transition: transform .2s ease; }
.hlp-q[open] .hlp-chev { transform: rotate(-90deg); }
.hlp-q p { margin: 0 0 14px; color: var(--muted); line-height: 1.6; font-size: var(--fs-sm); }
.hlp-q p strong { color: var(--text); }
.hlp-contact { display: grid; gap: 8px; padding: 20px; }
.hlp-follow { display: grid; gap: 8px; padding: 20px; margin-bottom: 16px; }
.hlp-follow h2 { margin: 0; font-size: var(--fs-md); }
.hlp-follow p { margin: 0; }
.hlp-follow .social-row { margin-left: -10px; }
.hlp-contact h2 { margin: 0; font-size: var(--fs-md); }
.hlp-contact p { margin: 0; }
.hlp-contact-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.hlp-legal { font-size: var(--fs-sm); color: var(--muted); margin-top: 6px !important; }
.hlp-legal a { color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .hlp-chev { transition: none; } }

/* ---------- Phone alerts box (D6, includes/layout/push_box.php) ---------- */
.push-box { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; margin-bottom: 14px; }
.push-box[hidden] { display: none; }
.push-mark { width: 36px; height: 41px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); }
.push-mark .icon { width: 18px; height: 18px; }
.push-body { display: grid; gap: 6px; min-width: 0; }
.push-title { font-size: var(--fs-sm); }
.push-text { font-size: var(--fs-sm); color: var(--muted); }
.push-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.push-btns .btn[hidden] { display: none; }
.push-body .alert { margin: 0; }
.push-prompt { margin: 0 0 16px; }
.push-box[data-push-state="on"] .push-mark { background: var(--success-soft); color: var(--success); }

/* Timetable reminder choice (D6): the same chips as the day picker */
.tt-remindpick { display: flex; flex-wrap: wrap; gap: 6px; }
.tt-remindpick .tt-daybox span { padding: 0 12px; }
.tt-remind { display: inline-flex; align-items: center; gap: 4px; }
.tt-remind .icon { width: 14px; height: 14px; }
.tt-remind-bar { display: grid; gap: 10px; margin: 0 0 16px; }
.tt-remind-bar .btn { justify-self: start; }
.tt-remind-bar p { font-size: var(--fs-sm); color: var(--muted); }

/* ============================================================
   D9 Home layout pass (UI/UX review, Josh 2026-11-04/05): fewer boxes. Only the hero, Lost & Found, the invite card
   and the For You posts are cards; the to-dos, the semester, the tip, the courses nudge and the empty feed sit on the
   page between thin dividers. Cards lose their outline (soft shadow instead) so they compete less; dark mode keeps a
   faint edge because a shadow barely shows there. Scoped to .hv.
   ============================================================ */
.hv .hv-lf, .hv .hv-invite, .hv .hv-feed .hv-card { border-color: transparent; box-shadow: var(--shadow-soft); }
[data-theme="dark"] .hv .hv-lf, [data-theme="dark"] .hv .hv-invite, [data-theme="dark"] .hv .hv-feed .hv-card { border-color: var(--border); }
.hv .hv-feed .hv-card:hover { border-color: var(--primary); }
.hv .hv-feed .hv-card-errand { border-left-color: var(--success); }

/* The invite card: a honeycomb that fills friend by friend and ends in the amber reward cell */
.hv-invite { display: grid; gap: 10px; padding: 16px; }
.hv-invite-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hv-invite-text { display: grid; gap: 2px; min-width: 0; }
.hv-invite-kicker { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--primary-text); }
.hv-invite h2 { font-size: var(--fs-xl); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.hv-invite h2 small { font-size: var(--fs-sm); font-weight: 500; letter-spacing: 0; color: var(--muted); }
.hv-invite-art { flex-shrink: 0; display: block; line-height: 0; }
.hv-invite-comb { display: block; max-width: 150px; height: auto; overflow: visible; }
.hv-invite-comb path { fill: var(--primary-soft); transform-box: fill-box; transform-origin: center; animation: hv-cell-in .4s ease-out both; animation-delay: calc(var(--i, 0) * 45ms); }
.hv-invite-comb path.is-on { fill: var(--primary); }
.hv-invite-comb path.is-next { fill: var(--surface); stroke: var(--primary); stroke-width: 1.4; stroke-dasharray: 3 2.5; animation: hv-cell-in .4s ease-out both, hv-now 1.6s ease-in-out .6s infinite alternate; }
.hv-invite-comb path.hv-comb-gift { fill: var(--accent); animation-delay: .5s; }
.hv-invite-comb path.hv-comb-gift.is-won { animation: hv-cell-in .4s ease-out .5s both, hv-pop 2.4s ease-in-out 1.2s infinite; }
.hv-comb-gift-ico { color: var(--on-accent); }
@keyframes hv-cell-in { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
.hv-invite-line { font-size: var(--fs-sm); color: var(--muted); }
.hv-prize {
  display: flex; align-items: flex-start; gap: 8px; justify-self: start; max-width: 100%; padding: 9px 12px; border-radius: var(--r-md);
  background: var(--accent-soft); color: var(--text); font-size: var(--fs-sm); font-weight: 700; line-height: 1.4;
}
.hv-prize .icon { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; color: var(--accent-text); }
.hv-invite-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 2px; }
.hv-invite-note { font-size: 12px; color: var(--muted); }

/* To-dos (Get Trusted, first weeks): rows on the page between dividers, not cards */
.hv-todo { display: grid; border-top: 1px solid var(--border); }
.hv-todo > .hv-row { padding: 14px 2px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: none; box-shadow: none; }
.hv-todo .verify-card h2 { font-size: var(--fs-md); }
.hv-todo .gp-home { padding: 14px 2px; }
a.hv-row:hover .st-card-title { color: var(--primary-text); }

/* The semester line sits on the page under the hero */
.hv .hv-sem { padding: 0 2px; background: none; border: 0; }
.hv .hv-sem-exams { gap: 4px; }
.hv .hv-palm { top: -4px; right: 0; }

/* For You: a divider and a heading instead of more boxes; the tip and the courses nudge are lines in the feed */
.hv-foryou-head { padding-top: 22px; border-top: 1px solid var(--border); }
.hv .hv-tip { padding: 6px 40px 6px 2px; background: none; border: 0; }
.hv .hv-tip-x { top: 0; right: 0; }
.hv .hv-nudge { padding: 14px 2px; background: none; border: 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); border-radius: 0; }
.hv .hv-nudge-wrap .hv-nudge { padding-right: 40px; }
.hv .hv-nudge-wrap .hv-tip-x { top: 8px; right: 0; }
.hv .hv-empty { border: 0; padding: 24px 12px 8px; }

@media (max-width: 767px) {
  .hv-invite { padding: 14px; }
  .hv-lf-row { margin: 0 -14px; padding: 2px 14px 4px; scroll-padding: 0 14px; }   /* match the card's phone padding (was -18px: the row poked out on the left) */
  .hv-invite h2 { font-size: var(--fs-lg); }
}
@media (prefers-reduced-motion: reduce) {
  .hv-invite-comb path { animation: none !important; }
}

/* The hero, smaller (Josh, 2026-11-05): the day and a round Share on top, the greeting, then today's line as a quote
   with no box and no label, "— name" under it when admin gave one, and the badge row. The opening quote mark wears
   a light indigo to amber gradient (--hero-quote; the brand gradient is allowed in the hero). */
.hv .hv-hello { gap: 0; padding: 16px 18px 18px; }
.hv-hello-in { display: grid; gap: 4px; }
.hv-hello-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; }
.hv-day { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--on-panel-muted); }
.hv .hv-hello h1 { margin: 0; font-size: var(--fs-xl); line-height: 1.2; }
.hv-quote { position: relative; max-width: 44ch; margin: 10px 0 8px; padding-left: 30px; animation: hv-rise .5s ease-out both .15s; }
.hv-quote::before {
  content: "\201C"; position: absolute; left: -3px; top: -8px; font-family: Georgia, "Times New Roman", serif; font-size: 64px; font-weight: 700; line-height: 1;
  background: var(--hero-quote); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hv-quote blockquote { margin: 0; }
.hv-quote p { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.5; color: var(--on-primary); text-wrap: pretty; }
.hv-quote figcaption { margin-top: 4px; font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--on-panel-muted); }
.hv-hello .hv-line-share {
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px; margin: 0; padding: 0 12px;
  border: 1px solid var(--hero-glass); border-radius: 999px; background: var(--hero-glass); color: var(--on-primary);
  font-size: 12px; font-weight: 700; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.hv-hello .hv-line-share:hover { background: var(--on-primary); color: var(--primary-deep); }
.hv-hello .hv-line-share .icon { width: 14px; height: 14px; }
.hv-hello .hv-line-hot { margin: 0; padding: 2px 10px; font-size: 12px; font-weight: 700; }
@media (max-width: 767px) {
  .hv .hv-hello { padding: 14px 16px 16px; }
  .hv .hv-hello h1 { font-size: 20px; }
  .hv-quote { margin: 8px 0 6px; padding-left: 30px; }
  .hv-quote::before { font-size: 56px; top: -6px; }
  .hv-quote p { font-size: 14px; }
}

/* Any photo, any colour (Josh, 2026-11-05: "anybody can put any color of photo"): on the Home hero the mood tint sits
   over a dark floor that is strongest on the left where the words are, the words get a soft shadow, and Share turns
   into dark glass so it never sits white on a white photo. */
.hv-hello.dash-hero-photo::before { background: var(--photo-shade), var(--photo-floor); }
.hv-hello.dash-hero-photo.hv-tod-morning::before { background: var(--photo-shade-morning), var(--photo-floor); }
.hv-hello.dash-hero-photo.hv-tod-evening::before { background: var(--photo-shade-evening), var(--photo-floor); }
.hv-hello.dash-hero-photo.hv-tod-night::before { background: var(--photo-shade-night), var(--photo-floor); }
.hv-hello.dash-hero-photo h1, .hv-hello.dash-hero-photo .hv-day, .hv-hello.dash-hero-photo .hv-quote p,
.hv-hello.dash-hero-photo .hv-quote figcaption, .hv-hello.dash-hero-photo .dash-meta > span:not(.hv-streak):not(.hv-line-hot) {
  text-shadow: 0 1px 2px rgba(15, 15, 30, .55), 0 0 12px rgba(15, 15, 30, .35);
}
.hv-hello.dash-hero-photo .hv-day { color: var(--on-primary); opacity: .85; }
.hv-hello.dash-hero-photo .hv-line-share { background: rgba(15, 15, 30, .45); border-color: rgba(255, 255, 255, .28); }
.hv-hello.dash-hero-photo .hv-line-share:hover { background: var(--on-primary); color: var(--primary-deep); }
.hv-hello.dash-hero-photo .badge { background: rgba(15, 15, 30, .45); }

/* Home research pass (2026-11-05): "Up next" in the hero, the next class from the timetable, like the schedule
   that campus apps (Stanford, ETH, UPH) put on Home; and the shortcuts right under the hero as one even row, like
   the service grids of OPay, Gojek and Grab, with no tile cut off at the edge. */
.hv-next {
  display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 2px 0 10px; padding: 8px 10px 8px 12px;
  border-radius: var(--r-md); background: var(--hero-glass); color: var(--on-primary); font-size: var(--fs-sm);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.hv-next:hover { text-decoration: none; background: rgba(255, 255, 255, .2); }
.hv-next-when { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px;
  background: var(--on-primary); color: var(--primary-deep); font-size: 12px; font-weight: 700; white-space: nowrap; }
.hv-next-when .icon { width: 13px; height: 13px; }
.hv-next-when .hv-pulse { width: 7px; height: 7px; }
.hv-next-what { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hv-next-what strong { font-weight: 800; letter-spacing: .01em; }
.hv-next-what span { color: var(--on-panel-muted); }
.hv-next-chev { flex-shrink: 0; width: 16px; height: 16px; transform: rotate(-90deg); opacity: .7; }
.hv-next.is-soon .hv-next-when { box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); }
.hv-hello.dash-hero-photo .hv-next { background: rgba(15, 15, 30, .45); }

.hv .hv-explore ul { display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: 4px; margin: -8px 0 0; padding: 0; overflow: visible; }
.hv .hv-explore-link { width: auto; font-size: 11.5px; line-height: 1.25; }
.hv .hv-explore-link .hex { width: 46px; height: 52px; box-shadow: var(--shadow-soft); transition: transform .12s, background-color .15s, color .15s; }
.hv .hv-explore-link:hover .hex, .hv .hv-explore-link:focus-visible .hex { background: var(--primary-deep); color: var(--on-primary); }
.hv .hv-explore-link:active .hex { transform: scale(.92); }
@media (min-width: 768px) { .hv .hv-explore ul { max-width: 520px; } }
.hv-hello-in { min-width: 0; grid-template-columns: minmax(0, 1fr); }   /* a long venue in Up next shortens with "…" instead of widening the hero */

/* Hero option B "Glance" (Josh, 2026-11-05): you (photo hex), the day and greeting, a round Share; the line small;
   then up to 3 live tiles in glass, like phone widgets (homeGlanceTiles()). */
.hv-me { display: flex; align-items: center; gap: 12px; }
.hv-av { position: relative; flex-shrink: 0; display: block; color: var(--primary-deep); }
.hv-av:hover { text-decoration: none; }
.hv-av .hex { display: grid; place-items: center; width: 46px; height: 52px; overflow: hidden; background: var(--on-primary); font-size: 18px; font-weight: 800; }
.hv-av .hex img { width: 100%; height: 100%; object-fit: cover; }
.hv-av-mark { position: absolute; right: -3px; bottom: 2px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--success); color: #fff; box-shadow: 0 0 0 2px rgba(15, 15, 30, .55); }
.hv-av-mark .icon { width: 11px; height: 11px; stroke-width: 3; }
.hv-me-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.hv-me-text .hv-day { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hv .hv-me h1 { display: block; margin: 0; font-size: 19px; line-height: 1.2; }
.hv-me .hv-line-share { flex-shrink: 0; align-self: flex-start; justify-content: center; width: 36px; min-height: 36px; padding: 0; border-radius: 50%; }
.hv-me .hv-line-share .icon { width: 16px; height: 16px; }
.hv-glance-line { margin: 12px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--on-primary); opacity: .94; text-wrap: pretty; animation: hv-rise .5s ease-out both .15s; }
.hv-glance-line .hv-by { color: var(--on-panel-muted); font-weight: 600; white-space: nowrap; }
.hv-glance-line .hv-line-hot { margin: 0 4px 0 0; padding: 1px 8px; font-size: 11px; font-weight: 700; vertical-align: 1px; }
.hv-tiles { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.hv-tiles li { display: grid; min-width: 0; animation: hv-rise .45s ease-out both; }
.hv-tiles li:nth-child(2) { animation-delay: .06s; }
.hv-tiles li:nth-child(3) { animation-delay: .12s; }
.hv-tile {
  display: grid; gap: 1px; min-width: 0; padding: 9px 10px; border-radius: 14px; background: var(--hero-glass); color: var(--on-primary);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: background-color .15s, transform .12s;
}
.hv-tile:hover { text-decoration: none; background: rgba(255, 255, 255, .2); }
.hv-tile:active { transform: scale(.97); }
.hv-tile-k, .hv-tile strong, .hv-tile small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hv-tile-k { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--on-panel-muted); }
.hv-tile strong { font-size: 15px; font-weight: 800; line-height: 1.3; letter-spacing: -0.01em; }
.hv-tile small { font-size: 11px; color: var(--on-panel-muted); }
.hv-tile.is-now .hv-tile-k::before { content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 5px 1px 0; border-radius: 50%; background: var(--success); vertical-align: middle; animation: hv-now 1s ease-in-out infinite alternate; }
.hv-tile.is-soon { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .45); }
.hv-hello.dash-hero-photo .hv-tile { background: rgba(15, 15, 30, .45); }
.hv-hello.dash-hero-photo .hv-glance-line, .hv-hello.dash-hero-photo .hv-me h1 { text-shadow: 0 1px 2px rgba(15, 15, 30, .55), 0 0 12px rgba(15, 15, 30, .35); }
@media (min-width: 768px) { .hv-tiles { max-width: 520px; } .hv .hv-me h1 { font-size: var(--fs-xl); } }

/* Invite friends hero (D9): the same honeycomb as Home's invite card, drawn for the indigo panel. */
.rf-hero .hv-invite-comb path { fill: var(--hero-glass); }
.rf-hero .hv-invite-comb path.is-on { fill: var(--on-primary); }
.rf-hero .hv-invite-comb path.is-next { fill: transparent; stroke: var(--on-primary); }
.rf-hero .hv-invite-comb path.hv-comb-gift { fill: var(--accent); }
.hd-switch { display: contents; }
/* Admin → Messages: emails by kind (2026-11-06) */
.adm-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: var(--fs-sm); }
.adm-table caption { text-align: left; padding-bottom: 6px; }
.adm-table th, .adm-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: right; }
.adm-table th:first-child, .adm-table td:first-child { text-align: left; }
.adm-table th { font-weight: 600; color: var(--muted); }

/* Ask twice (data-twice, app.js): the armed button and its question */
.btn.is-armed { background: var(--primary-deep); color: #fff; box-shadow: 0 0 0 3px var(--primary-soft); }
.twice-note { flex-basis: 100%; font-size: .85rem; color: var(--muted); }

/* Admin → Trust: counts and the History filter */
.adm-trust-counts { margin-bottom: 12px; }
.adm-th-search { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.adm-th-search .input { flex: 1 1 180px; min-width: 0; }
.adm-th-search .select { flex: 0 1 160px; }

/* UniHive spotlight (spotlight.php): one business, sized for a phone screenshot */
.spl { max-width: 460px; margin: 0 auto; padding: 16px 16px 32px; }
.spl-card { padding: 0; overflow: hidden; }
.spl-kicker { display: flex; align-items: center; gap: 8px; margin: 0; padding: 12px 16px; font-size: var(--fs-sm); font-weight: 700; color: #fff;
  background: linear-gradient(90deg, var(--primary-deep), var(--primary)); }
.spl-kicker img { border-radius: 4px; background: #fff; }
.spl-photo { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--primary-soft); }
.spl-photo-empty { display: grid; place-items: center; }
.spl-photo-empty .hex { width: 64px; height: 64px; display: grid; place-items: center; background: var(--primary); color: #fff; }
.spl-body { display: grid; gap: 12px; padding: 16px; }
.spl-body h1 { margin: 0; font-size: 1.5rem; line-height: 1.2; overflow-wrap: anywhere; }
.spl-meta { margin: 0; color: var(--muted); font-size: var(--fs-sm); }
.spl-about { margin: 0; overflow-wrap: anywhere; }
.spl-facts { display: grid; gap: 8px; margin: 0; }
.spl-facts > div { display: flex; align-items: flex-start; gap: 10px; }
.spl-facts dt { color: var(--primary-text); flex: 0 0 auto; }
.spl-facts dt .icon { width: 18px; height: 18px; }
.spl-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.spl-items { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.spl-items li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.spl-items li span { min-width: 0; overflow-wrap: anywhere; }
.spl-qr { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: var(--r-sm); background: var(--primary-soft); }
.spl-qr svg { flex: 0 0 96px; width: 96px; height: 96px; background: #fff; color: #000; padding: 6px; border-radius: 8px; }
.spl-qr .qr-bg { fill: #fff; }
.spl-qr div { display: grid; gap: 2px; min-width: 0; }
.spl-qr span { font-size: var(--fs-sm); color: var(--primary-text); overflow-wrap: anywhere; }
.spl-actions { display: grid; gap: 8px; }

/* Sign-up: month and year of birth for under-18s (migration 137) */
.reg-birth { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Bookings (business/bookings.php, bookings.php, the shop page sheet; migration 138) */
.bk section { margin-top: 20px; }
.bk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.bk-item { display: grid; gap: 6px; }
.bk-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.bk-when { font-size: 1.05rem; }
.bk-who, .bk-line { margin: 0; overflow-wrap: anywhere; }
.bk-line { display: flex; align-items: flex-start; gap: 6px; color: var(--muted); font-size: var(--fs-sm); }
.bk-line .icon { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 2px; }
.bk-note { font-style: italic; }
.bk-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.bk-item .disclose .form { display: grid; gap: 8px; margin-top: 8px; }
.bk-slots { display: flex; flex-wrap: wrap; gap: 8px; min-height: 40px; }
.bk-slot[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.bk-slot-skel { display: inline-block; width: 76px; height: 36px; border-radius: 999px; }
.empty-sm { padding: 20px 16px; }

/* Why an early school has few notes yet (includes/layout/st_early_school.php) */
.st-early { display: grid; gap: 12px; }
.st-early p { font-size: var(--fs-sm); line-height: 1.55; }
.st-early-h { font-size: var(--fs-sm); font-weight: 700; margin-top: 4px; }
.st-early-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.st-early-stats div { padding: 10px; border-radius: 12px; background: var(--primary-soft); }
.st-early-stats dt { font-size: 12px; color: var(--muted); line-height: 1.3; }
.st-early-stats dd { margin: 2px 0 0; font-size: 20px; font-weight: 800; color: var(--primary-text); }
.st-early-steps { display: grid; gap: 8px; padding-left: 20px; font-size: var(--fs-sm); line-height: 1.5; }
.st-early-today { list-style: disc; }
details.st-early > summary { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; }
details.st-early > summary::-webkit-details-marker { display: none; }
details.st-early > summary > span:nth-child(2) { display: grid; flex: 1; min-width: 0; }
details.st-early > summary small { font-size: 13px; color: var(--muted); }
details.st-early > summary .st-chev { transition: transform .15s; }
details.st-early[open] > summary .st-chev { transform: rotate(90deg); }
details.st-early:not([open]) { gap: 0; }
.st-early-course { justify-items: start; padding: 20px; }
.st-early-course h3 { font-size: var(--fs-md, 17px); }
.st-early-course p { color: var(--muted); }
.st-early-sub { font-weight: 700; color: var(--text) !important; }
.st-early-links { display: grid; gap: 8px; width: 100%; list-style: none; padding: 0; }
.st-early-links a { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--primary-soft); color: var(--text); }
.st-early-links a:hover { text-decoration: none; outline: 2px solid var(--primary); }
.st-early-links a > span:last-child { display: grid; min-width: 0; }
.st-early-links small { font-size: 12px; color: var(--muted); }
.st-early-foot { font-size: 13px !important; }

/* ---------- Outbox note (assets/js/outbox.js, weak campus network W2): the Home toast's look (.hv-toast), shown on demand ---------- */
.uh-toast { opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; transform: translate(-50%, 12px); border-radius: 16px; text-align: center; }
.uh-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .uh-toast { transition: none; } }
.ms-waiting { opacity: .8; }
/* Saved copy of a list page (app.js, weak campus network W4): a bar across the top. */
.saved-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 12px; padding: 8px 16px;
  font-size: var(--fs-sm); font-weight: 700; color: var(--text); background: var(--primary-soft); border-bottom: 3px solid var(--primary); text-align: center; }
.saved-bar.is-back { background: var(--success-soft); border-bottom-color: var(--success); }
