/* QAU Kalam — design system
   Institutional, calm, legible. QAU green as the brand colour, a restrained
   gold accent, neutral surfaces. Light theme by default, dark theme follows
   the OS. Shared by the People app (/) and the Admin Console (/admin/). */

:root {
  --brand-900: #082f24;
  --brand-800: #0b3d2f;
  --brand-700: #0f4c3a;
  --brand-600: #13624a;
  --brand-500: #17795b;
  --brand-100: #e3f1eb;
  --brand-50: #f1f8f5;
  --gold: #c59a3d;
  --gold-soft: #f6ecd6;

  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-2: #f3f6f5;
  --surface-3: #eaf0ed;
  --border: #dde4e1;
  --border-strong: #c7d2cd;
  --text: #16211d;
  --text-2: #3d4b45;
  --text-dim: #66756e;

  --primary: var(--brand-700);
  --primary-hover: var(--brand-600);
  --primary-ink: #ffffff;
  --accent-strong: var(--brand-600);
  --focus: 0 0 0 3px rgba(23, 121, 91, 0.28);

  --success: #1f8a5b;
  --success-bg: #e5f5ed;
  --danger: #c0392b;
  --danger-bg: #fbeceb;
  --warning: #a36b00;
  --warning-bg: #fdf4e2;
  --info-bg: #eaf2fb;

  --cat-academic: #13624a;
  --cat-campus: #5f8f3a;
  --cat-engagement: #8a4f8a;
  --cat-support: #2f6f9f;

  --radius-sm: 9px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(16, 33, 27, 0.04), 0 1px 2px rgba(16, 33, 27, 0.02);
  --shadow: 0 4px 16px -2px rgba(16, 33, 27, 0.06), 0 2px 5px -1px rgba(16, 33, 27, 0.03);
  --shadow-lg: 0 20px 48px -8px rgba(16, 33, 27, 0.12), 0 8px 20px -4px rgba(16, 33, 27, 0.05);

  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --sidebar-w: 248px;
  color-scheme: light;
}

/* Dark: "Emerald Slate", a soft velvety green-black instead of harsh black,
   for late-night hostel study without eye strain. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b120f;
    --surface: #13201b;
    --surface-2: #172620;
    --surface-3: #1d2f28;
    --border: #22362e;
    --border-strong: #2f463c;
    --text: #e2ece7;
    --text-2: #bccbc4;
    --text-dim: #8a9d95;
    --primary: #2a8f6c;
    --primary-hover: #33a07a;
    --accent-strong: #6cc4a1;
    --brand-50: #10201a;
    --brand-100: #173027;
    --gold-soft: #2a2416;
    --success-bg: #11281e;
    --danger-bg: #2c1715;
    --warning-bg: #29210f;
    --info-bg: #122029;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow: 0 6px 20px -3px rgba(0, 0, 0, 0.45), 0 2px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 24px 56px -8px rgba(0, 0, 0, 0.65), 0 8px 20px -4px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}


* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
/* A picture or clip can never be wider than the phone it is shown on. */
img, video { max-width: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.015em; color: var(--text); }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 650; }
h3 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0; }
a { color: var(--accent-strong); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
.muted { color: var(--text-dim); font-size: 0.875rem; }
.small { font-size: 0.8rem; }
.icon {
  display: inline-flex;
  vertical-align: -0.15em;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon svg {
  width: 1.15em;
  height: 1.15em;
  shape-rendering: geometricPrecision;
  text-rendering: geometricPrecision;
  transform: translateZ(0);
}
[lang="ur"] { font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Urdu Typesetting", serif; }

/* ---------- Form controls ---------- */
button, input, textarea, select { font: inherit; color: inherit; }
button {
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  min-height: 40px;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 600; font-size: 0.9rem;
  transition: background 0.18s cubic-bezier(0.2, 0.8, 0.2, 1),
              border-color 0.18s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.18s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}
button:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
button:active { transform: scale(0.965); box-shadow: none; }
button:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
button.secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
button.secondary:hover { background: var(--surface-2); border-color: var(--text-dim); }
button.ghost { background: transparent; color: var(--text-2); border-color: transparent; }
button.ghost:hover { background: var(--surface-2); }
button.danger { background: var(--danger); color: #fff; }
button.danger:hover { background: #a93226; }
button.sm { min-height: 32px; padding: 0.3rem 0.7rem; font-size: 0.8rem; }
button.lg { min-height: 48px; padding: 0.7rem 1.4rem; font-size: 1rem; }
button.block { width: 100%; }
button .spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible {
  outline: none; box-shadow: var(--focus);
}

input, textarea, select {
  width: 100%;
  min-height: 42px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.8rem;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea { resize: vertical; min-height: 80px; }
input::placeholder, textarea::placeholder { color: var(--text-dim); opacity: 0.8; }
input:focus, textarea:focus, select:focus { border-color: var(--brand-500); }
input[readonly] { background: var(--surface-2); }
input[type="checkbox"], input[type="radio"] { width: 18px; min-height: 18px; height: 18px; padding: 0; flex-shrink: 0; accent-color: var(--primary); }
input[type="file"] { padding: 0.45rem; }
label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-2); margin-bottom: 0.35rem; }
.field { margin-bottom: 1rem; }
.hint { display: block; font-size: 0.78rem; color: var(--text-dim); margin-top: 0.3rem; font-weight: 400; }
.row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1; min-width: 170px; }
.row > .shrink { flex: 0 0 auto; min-width: 0; }

.password-wrapper { position: relative; }
.password-wrapper input { padding-right: 2.8rem; }
.pwd-toggle-btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  min-height: 34px; width: 36px; padding: 0;
  background: transparent; color: var(--text-dim); border: none;
}
.pwd-toggle-btn:hover { background: var(--surface-2); color: var(--text); }
.pwd-toggle-btn:active { transform: translateY(-50%); }
.pwd-toggle-btn svg { width: 18px; height: 18px; }

.pwd-strength { display: flex; gap: 4px; margin-top: 0.45rem; }
.pwd-strength span { flex: 1; height: 4px; border-radius: 4px; background: var(--border); transition: background 0.2s; }
.pwd-strength[data-level="1"] span:nth-child(-n+1) { background: var(--danger); }
.pwd-strength[data-level="2"] span:nth-child(-n+2) { background: var(--warning); }
.pwd-strength[data-level="3"] span:nth-child(-n+3) { background: var(--brand-500); }
.pwd-strength[data-level="4"] span { background: var(--success); }
.pwd-match-ok { color: var(--success); font-weight: 500; }
.pwd-match-bad { color: var(--danger); font-weight: 500; }

/* ---------- Alerts, badges, tags ---------- */
.alert {
  display: flex; gap: 0.6rem; align-items: flex-start;
  border-radius: var(--radius-sm); padding: 0.7rem 0.9rem; margin-bottom: 1rem;
  font-size: 0.875rem; border: 1px solid transparent; animation: reveal 0.18s var(--ease);
}
.alert.error { background: var(--danger-bg); border-color: rgba(192, 57, 43, 0.3); color: var(--danger); }
.alert.success { background: var(--success-bg); border-color: rgba(31, 138, 91, 0.3); color: var(--success); }
.alert.warning { background: var(--warning-bg); border-color: rgba(163, 107, 0, 0.3); color: var(--warning); }
.alert.info { background: var(--info-bg); border-color: rgba(47, 111, 159, 0.3); color: var(--cat-support); }

.badge {
  display: inline-flex; align-items: center; gap: 0.3rem; white-space: nowrap; flex-shrink: 0;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 0.18rem 0.55rem; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
}
.badge-success { background: var(--success-bg); color: var(--success); border-color: transparent; }
.badge-active { background: var(--brand-100); color: var(--brand-600); border-color: transparent; }
.badge-withdrawn, .badge-danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.badge-warning { background: var(--warning-bg); color: var(--warning); border-color: transparent; }
.tag {
  display: inline-block; font-size: 0.75rem; padding: 0.15rem 0.55rem; margin: 0.15rem 0.25rem 0 0;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); border-radius: 999px;
}

/* ---------- Cards & grids ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; margin-bottom: 1rem; box-shadow: var(--shadow-sm);
}
.card-title { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; margin-bottom: 0.9rem; flex-wrap: wrap; }
.card-title p { margin-top: 0.2rem; }
.card.entity { position: relative; display: flex; flex-direction: column; margin: 0; transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s; animation: reveal 0.22s var(--ease); }
.card.entity:hover { box-shadow: var(--shadow); border-color: var(--border-strong); }
.card.entity::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: transparent; }
.card.entity.cat-academic::before { background: var(--cat-academic); }
.card.entity.cat-campus::before { background: var(--cat-campus); }
.card.entity.cat-engagement::before { background: var(--cat-engagement); }
.card.entity.cat-support::before { background: var(--cat-support); }
.card-actions { margin-top: auto; padding-top: 0.9rem; display: flex; gap: 0.5rem; }
.card-actions button { flex: 1; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.score-row { display: flex; gap: 0.5rem 0.9rem; flex-wrap: wrap; margin-top: 0.6rem; font-size: 0.78rem; color: var(--text-dim); }
.meter { height: 6px; background: var(--surface-3); border-radius: 6px; overflow: hidden; margin-top: 0.5rem; }
.meter > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-500), var(--gold)); border-radius: 6px; }
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--text-dim); grid-column: 1 / -1; }
.empty-state .icon svg { width: 36px; height: 36px; opacity: 0.5; }
.empty-state strong { display: block; color: var(--text-2); margin: 0.5rem 0 0.2rem; }

.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1px solid var(--border); }
.avatar-placeholder { display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 0.95rem; }
.card-header-row { display: flex; gap: 0.75rem; align-items: center; }

@keyframes reveal { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Auth (split screen) ---------- */
.auth-shell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(360px, 44%) 1fr; }
.auth-brand {
  position: relative; overflow: hidden; color: #fff;
  background: radial-gradient(900px 500px at 0% 0%, rgba(197, 154, 61, 0.22), transparent 60%),
              linear-gradient(160deg, var(--brand-700), var(--brand-900));
  padding: 3rem clamp(1.5rem, 4vw, 3.5rem); display: flex; flex-direction: column;
}
.auth-brand::after {
  content: "کلام"; position: absolute; right: -2rem; bottom: -3.5rem; font-size: 16rem; line-height: 1;
  font-family: "Noto Nastaliq Urdu", serif; color: rgba(255, 255, 255, 0.05); pointer-events: none;
}
.brand-lockup { display: flex; align-items: center; gap: 0.75rem; }
.brand-seal {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 1.15rem; color: var(--gold); font-weight: 700;
}
.brand-lockup strong { display: block; font-size: 1.1rem; }
.brand-lockup span { font-size: 0.8rem; opacity: 0.75; }
.auth-brand h1 { color: #fff; font-size: clamp(1.8rem, 3vw, 2.5rem); margin: auto 0 0.8rem; max-width: 18ch; }
.auth-brand .lead { color: rgba(255, 255, 255, 0.8); max-width: 42ch; font-size: 1rem; }
.feature-list { list-style: none; padding: 0; margin: 2rem 0 auto; display: grid; gap: 0.9rem; }
.feature-list li { display: flex; gap: 0.8rem; align-items: flex-start; color: rgba(255, 255, 255, 0.88); font-size: 0.92rem; }
.feature-list .icon { flex-shrink: 0; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.1); color: var(--gold); }
.feature-list strong { display: block; color: #fff; }
.auth-brand .foot-note { font-size: 0.78rem; opacity: 0.6; margin-top: 2rem; }

.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.auth-card { width: 100%; max-width: 460px; }
.auth-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; gap: 1rem; }
.auth-top h2 { font-size: 1.45rem; }
.segmented { display: grid; grid-auto-flow: column; background: var(--surface-3); padding: 4px; border-radius: 10px; margin-bottom: 1.5rem; }
.segmented button { background: transparent; color: var(--text-dim); border: none; min-height: 38px; font-weight: 600; }
.segmented button:hover { background: transparent; color: var(--text); }
.segmented button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* Stepper */
.stepper { display: flex; align-items: center; gap: 0; margin-bottom: 1.4rem; counter-reset: step; }
.stepper .step { display: flex; align-items: center; flex: 1; font-size: 0.72rem; color: var(--text-dim); font-weight: 600; }
.stepper .step:last-child { flex: 0; }
.stepper .dot {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  border: 2px solid var(--border-strong); background: var(--surface); font-size: 0.75rem; color: var(--text-dim);
}
.stepper .dot svg { width: 14px; height: 14px; }
.stepper .bar { flex: 1; height: 2px; background: var(--border); margin: 0 6px; }
.stepper .step.active .dot { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 4px var(--brand-100); }
.stepper .step.done .dot { border-color: var(--primary); background: var(--primary); color: #fff; }
.stepper .step.done .bar { background: var(--primary); }
.step-head { margin-bottom: 1.1rem; }
.step-head .eyebrow { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-strong); }
.step-head h3 { font-size: 1.2rem; margin-top: 0.2rem; }
.step-head p { margin-top: 0.3rem; color: var(--text-dim); font-size: 0.88rem; }
.step-nav { display: flex; gap: 0.6rem; margin-top: 1.2rem; }
.step-nav .grow { flex: 1; }
.step-panel { animation: reveal 0.22s var(--ease); }

/* OTP boxes */
.otp-inputs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.5rem; margin: 0.3rem 0 0.6rem; }
.otp-inputs input {
  text-align: center; font-size: 1.45rem; font-weight: 700; min-height: 56px; padding: 0;
  font-variant-numeric: tabular-nums; border-width: 1.5px;
}
.otp-inputs input.filled { border-color: var(--brand-500); background: var(--brand-50); }
.otp-inputs.error input { border-color: var(--danger); animation: shake 0.3s; }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.dev-code { background: var(--gold-soft); border: 1px dashed var(--gold); border-radius: var(--radius-sm); padding: 0.6rem 0.8rem; font-size: 0.85rem; margin-bottom: 0.6rem; }
.dev-code strong { font-size: 1.15rem; letter-spacing: 0.2em; }
.linklike { background: none; border: none; color: var(--accent-strong); padding: 0; min-height: 0; font-weight: 600; font-size: 0.85rem; }
.linklike.nudge { background: var(--warning-bg); color: var(--warning); padding: 0.15rem 0.5rem; border-radius: 999px; animation: shake 0.3s; }
.linklike:hover { background: none; text-decoration: underline; }
.linklike:disabled { color: var(--text-dim); text-decoration: none; }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.4rem; }
.chip { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); border-radius: 999px; min-height: 30px; padding: 0.2rem 0.7rem; font-size: 0.8rem; font-weight: 500; }
.chip:hover { background: var(--brand-50); border-color: var(--brand-500); color: var(--text); }
.chip.on { background: var(--brand-100); border-color: var(--brand-500); color: var(--brand-600); }

/* ---------- Live selfie ---------- */
.selfie-shell { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 1.5rem 1rem; }
.selfie-card { width: 100%; max-width: 560px; }
.live-stage {
  position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: var(--radius);
  background: #0b1210; overflow: hidden; margin: 0.4rem 0 1rem;
}
.live-stage video, .live-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.live-stage img.final { transform: none; }
.live-oval {
  position: absolute; left: 50%; top: 47%; width: 46%; aspect-ratio: 3 / 4; transform: translate(-50%, -50%);
  border-radius: 50%; border: 3px dashed rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 0 9999px rgba(8, 18, 14, 0.45); transition: border-color 0.2s;
}
.live-oval.ok { border-style: solid; border-color: #3ddc97; }
.live-oval.warn { border-color: #f5b041; }
.live-badge {
  position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 0.4rem;
  background: rgba(0, 0, 0, 0.55); color: #fff; font-weight: 800; font-size: 0.72rem; letter-spacing: 0.12em;
  padding: 0.3rem 0.6rem; border-radius: 6px; backdrop-filter: blur(4px);
}
.live-badge i { width: 8px; height: 8px; border-radius: 50%; background: #ff3b30; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.live-timer { position: absolute; top: 12px; right: 12px; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 0.75rem; padding: 0.3rem 0.55rem; border-radius: 6px; font-variant-numeric: tabular-nums; }
.live-prompt {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); width: calc(100% - 28px);
  text-align: center; color: #fff; font-weight: 700; font-size: 1.05rem;
  background: rgba(0, 0, 0, 0.55); padding: 0.55rem 0.8rem; border-radius: 10px; backdrop-filter: blur(4px);
}
.live-idle { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #cfe3da; padding: 1rem; }
.live-idle .icon svg { width: 56px; height: 56px; opacity: 0.7; }
.live-steps { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.live-steps li {
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem; text-align: center;
  padding: 0.6rem 0.4rem; border-radius: var(--radius-sm); border: 1px solid var(--border);
  font-size: 0.78rem; font-weight: 600; color: var(--text-dim); background: var(--surface-2);
}
.live-steps li .icon svg { width: 22px; height: 22px; }
.live-steps li.current { border-color: var(--primary); color: var(--primary); background: var(--brand-50); }
.live-steps li.done { border-color: var(--success); color: var(--success); background: var(--success-bg); }
.consent { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.88rem; font-weight: 500; color: var(--text); cursor: pointer; margin: 0; }
.consent input { margin-top: 2px; flex-shrink: 0; }
.fine-print { font-size: 0.75rem; color: var(--text-dim); margin-top: 1rem; line-height: 1.55; }

/* ---------- App shell (sidebar) ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--brand-800); color: #dbe9e3; padding: 1.1rem 0.8rem;
}
.sidebar .brand-lockup { padding: 0.3rem 0.5rem 1.3rem; }
.sidebar .brand-lockup strong { color: #fff; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255, 255, 255, 0.45); padding: 0.9rem 0.7rem 0.35rem; }
.nav button, .nav a {
  justify-content: flex-start; gap: 0.7rem; width: 100%; min-height: 40px;
  background: transparent; color: #cfe0d8; border: none; font-weight: 500; font-size: 0.9rem;
  padding: 0.5rem 0.7rem; border-radius: 8px; text-decoration: none;
}
.nav button:hover, .nav a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; text-decoration: none; }
.nav button[aria-selected="true"] { background: rgba(255, 255, 255, 0.12); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--gold); }
.tab-icon { display: inline-flex; width: 18px; height: 18px; flex-shrink: 0; }
.tab-icon svg { width: 100%; height: 100%; }
.nav .badge-count { margin-left: auto; background: var(--gold); color: #1c1606; font-size: 0.7rem; font-weight: 800; border-radius: 999px; padding: 0 0.45rem; }
.sidebar-foot { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, 0.1); padding-top: 0.9rem; }
.me-card { display: flex; gap: 0.65rem; align-items: center; padding: 0.4rem 0.5rem; }
.me-card .avatar { width: 38px; height: 38px; border-color: rgba(255, 255, 255, 0.2); }
.me-card strong { display: block; color: #fff; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-card span { font-size: 0.74rem; color: rgba(255, 255, 255, 0.6); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-card > div { min-width: 0; }
.sidebar-foot .nav { margin-top: 0.4rem; }

.main { min-width: 0; display: flex; flex-direction: column; }
.page-header {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem clamp(1rem, 3vw, 2rem); background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.page-header h1 { font-size: 1.3rem; }
.page-header p { font-size: 0.85rem; color: var(--text-dim); margin-top: 0.1rem; }
.header-actions { display: flex; gap: 0.5rem; align-items: center; }
.content { padding: 1.5rem clamp(1rem, 3vw, 2rem) 3rem; max-width: 1200px; width: 100%; }
.tab-panel { animation: reveal 0.2s var(--ease); }
.mobile-brand { display: none; }

/* Messages */
.chat-layout { display: grid; grid-template-columns: 300px 1fr; gap: 1rem; align-items: stretch; }
.chat-list { padding: 0.5rem; max-height: 560px; overflow-y: auto; }
.chat-list .chat-item {
  width: 100%; justify-content: flex-start; gap: 0.7rem; background: transparent; color: var(--text); border: none;
  padding: 0.55rem; border-radius: var(--radius-sm); text-align: left; min-height: 56px; white-space: normal; font-weight: 500;
}
.chat-list .chat-item:hover { background: var(--surface-2); }
.chat-list .chat-item.active { background: var(--brand-50); box-shadow: inset 3px 0 0 var(--primary); }
.chat-list .chat-item small { display: block; color: var(--text-dim); font-weight: 400; font-size: 0.75rem; }
.chat-pane { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.chat-head select { width: auto; min-width: 200px; min-height: 36px; font-size: 0.85rem; }
.msg-thread { flex: 1; display: flex; flex-direction: column; gap: 0.55rem; min-height: 340px; max-height: 480px; overflow-y: auto; padding: 1rem 1.1rem; background: var(--surface-2); }
.msg-bubble { max-width: 76%; padding: 0.55rem 0.85rem; border-radius: 14px 14px 14px 4px; background: var(--surface); border: 1px solid var(--border); font-size: 0.92rem; animation: reveal 0.15s var(--ease); }
.msg-bubble.mine { align-self: flex-end; background: var(--primary); color: #fff; border-color: transparent; border-radius: 14px 14px 4px 14px; }
.msg-meta { font-size: 0.68rem; opacity: 0.7; margin-top: 0.2rem; }
.chat-compose { display: flex; gap: 0.5rem; padding: 0.8rem 1.1rem; border-top: 1px solid var(--border); background: var(--surface); }
.chat-compose input { flex: 1; }

/* Profile */
.profile-hero { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
.pf-avatar, .pf-avatar-placeholder { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border); font-size: 1.8rem; }
.pf-avatar-placeholder { background: var(--surface-3); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }

/* Support tickets */
.ticket-attachments { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.5rem 0; }
.ticket-thumb { width: 96px; height: 96px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); display: block; }
.ticket-admin-controls { display: flex; flex-direction: column; gap: 0.45rem; margin-top: 0.8rem; padding-top: 0.8rem; border-top: 1px solid var(--border); }
.ticket-admin-controls select { max-width: 220px; }
.ticket-admin-notes { margin-top: 0.6rem; padding: 0.55rem 0.75rem; background: var(--surface-2); border-radius: var(--radius-sm); font-size: 0.85rem; }

/* Tables (admin) */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
table.data th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); font-weight: 700; background: var(--surface-2); padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data td { padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data td.muted { white-space: nowrap; }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: var(--surface-2); }
.cell-user { display: flex; gap: 0.6rem; align-items: center; }
.cell-user .avatar { width: 34px; height: 34px; font-size: 0.8rem; }
.cell-user small { display: block; color: var(--text-dim); font-size: 0.76rem; }
.cell-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow-sm); }
.stat .label { font-size: 0.78rem; color: var(--text-dim); font-weight: 600; display: flex; align-items: center; gap: 0.4rem; }
.stat .label svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--accent-strong); }
.stat .value { font-size: 1.8rem; font-weight: 750; margin-top: 0.25rem; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 0.76rem; color: var(--text-dim); }
.steps-list { counter-reset: s; list-style: none; padding: 0; margin: 0.5rem 0 0; display: grid; gap: 0.6rem; }
.steps-list li { counter-increment: s; position: relative; padding-left: 2.1rem; font-size: 0.88rem; color: var(--text-2); }
.steps-list li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--brand-100); color: var(--brand-600); font-weight: 700; font-size: 0.78rem; display: grid; place-items: center; }
code, .mono { font-family: "Cascadia Code", Consolas, "SFMono-Regular", monospace; font-size: 0.85em; background: var(--surface-2); padding: 0.1rem 0.35rem; border-radius: 5px; border: 1px solid var(--border); }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(8, 20, 16, 0.55); backdrop-filter: blur(4px); }
.modal-card { background: var(--surface); border-radius: var(--radius-lg); padding: 1.4rem; width: 100%; max-width: 460px; max-height: 92vh; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; box-shadow: var(--shadow-lg); animation: reveal 0.18s var(--ease); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.close-btn { min-height: 34px; width: 34px; padding: 0; background: transparent; color: var(--text-dim); border: none; }
.close-btn:hover { background: var(--surface-2); color: var(--text); }
.qr-box { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; text-align: center; margin: 0.8rem 0; }
.qr-box img { width: 190px; height: 190px; display: block; margin: 0 auto; }
.qr-box small { color: #3d4b45; font-weight: 600; }
.mode-tab-btn { flex: 1; }
.install-instructions { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.85rem; margin-top: 1rem; font-size: 0.83rem; color: var(--text-2); }
.install-instructions p { margin: 0.25rem 0; }

/* "A new version is ready" bar (app updates) */
.update-bar {
  position: fixed; left: 0; right: 0; margin-inline: auto; top: calc(0.75rem + env(safe-area-inset-top)); z-index: 2100;
  width: max-content; max-width: calc(100vw - 2rem); display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.5rem 0.45rem 0.9rem;
  background: var(--brand-700); color: #fff; border-radius: 999px; box-shadow: var(--shadow-lg); font-size: 0.88rem; animation: reveal 0.2s var(--ease);
}
.update-bar .icon svg { width: 18px; height: 18px; }
.update-bar > span:not(.icon) { flex: 1; min-width: 0; }
.update-bar button { flex-shrink: 0; }
.update-bar button { min-height: 32px; padding: 0.25rem 0.9rem; border-radius: 999px; background: #fff; color: var(--brand-700); border: none; font-weight: 700; }
.toast-host { position: fixed; right: 1rem; bottom: 1rem; z-index: 2000; display: grid; gap: 0.5rem; }
.toast { background: var(--text); color: var(--surface); padding: 0.7rem 1rem; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-size: 0.875rem; animation: reveal 0.2s var(--ease); max-width: 360px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { padding: 1.4rem 1.25rem; }
  .auth-brand h1, .auth-brand .lead, .feature-list, .auth-brand .foot-note, .auth-brand::after { display: none; }
  .auth-main { justify-content: flex-start; padding-top: 1.5rem; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-list { max-height: 220px; }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 50;
    flex-direction: row; padding: 0.3rem 0.3rem calc(0.3rem + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
  .sidebar .brand-lockup, .sidebar .nav-label, .sidebar-foot { display: none; }
  .sidebar > .nav { flex-direction: row; width: 100%; overflow-x: auto; gap: 0; scrollbar-width: none; }
  .sidebar > .nav::-webkit-scrollbar { display: none; }
  .sidebar > .nav button, .sidebar > .nav a {
    flex: 1 1 0; min-width: 0; flex-direction: column; gap: 0.2rem; font-size: 0.6rem; min-height: 52px; padding: 0.35rem 0.1rem; justify-content: center;
    overflow: hidden; text-overflow: ellipsis;
  }
  .nav button[aria-selected="true"] { box-shadow: inset 0 2px 0 var(--gold); }
  .tab-icon { width: 20px; height: 20px; }
  .main { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .page-header { padding: 0.8rem 1rem; }
  .page-header h1 { font-size: 1.1rem; }
  .page-header p { display: none; }
  .mobile-brand { display: inline-flex; }
  .content { padding: 1rem 1rem 2rem; }
  .row > * { min-width: 100%; }
  .grid { grid-template-columns: 1fr; }
  .msg-bubble { max-width: 88%; }
  button, input, select, textarea { min-height: 44px; }
  .otp-inputs input { min-height: 52px; font-size: 1.3rem; }
  .live-steps li { font-size: 0.72rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ---------- Community feed ---------- */
.feed-wrap { max-width: 680px; margin: 0 auto; }
.start-guide { background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--brand-500); padding: 0; } /* summary and body pad themselves */
.start-guide summary { cursor: pointer; padding: 1rem; min-height: 44px; }
.start-guide summary strong, .start-guide summary .muted { display: block; margin-top: 0.35rem; }
.start-guide summary:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; border-radius: var(--radius); }
.start-guide-body { padding: 0 1rem 1rem; }
.signup-preview { padding: 0.85rem 1rem; margin-bottom: 1.25rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); color: var(--text-2); font-size: 0.875rem; line-height: 1.6; }
.signup-preview p { margin: 0.35rem 0 0; }
.start-guide-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; margin: 1rem 0; }
.start-guide-actions button { display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; text-align: left; white-space: normal; padding: 0.85rem; }
.start-guide-actions button span { font-weight: 400; color: var(--text-2); line-height: 1.5; }
@media (max-width: 420px) { .start-guide-actions { grid-template-columns: 1fr; } }
.composer { padding: 1rem 1.1rem; }
.composer-top { display: flex; gap: 0.75rem; align-items: flex-start; }
.composer-top textarea { border: none; background: transparent; resize: none; min-height: 0; padding: 0.5rem 0.2rem; font-size: 1rem; box-shadow: none; }
.composer-top textarea:focus { box-shadow: none; }
.composer-top textarea.verse-input { font-family: Georgia, "Noto Nastaliq Urdu", serif; font-style: italic; font-size: 1.05rem; line-height: 1.7; }
#composer-photo-row, #composer-media-row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin: 0.4rem 0 0.2rem 3.4rem; }
.preview-wrap { position: relative; display: inline-block; }
.preview-wrap img { max-height: 180px; max-width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border); display: block; }
.preview-wrap .close-btn { position: absolute; top: 6px; right: 6px; background: rgba(0, 0, 0, 0.6); color: #fff; border-radius: 50%; width: 28px; min-height: 28px; }
.composer-bar { display: flex; align-items: center; gap: 0.6rem; border-top: 1px solid var(--border); margin-top: 0.7rem; padding-top: 0.7rem; flex-wrap: wrap; }
.kind-chips { display: flex; gap: 0.3rem; flex-wrap: wrap; flex: 1; }
.kind-chips button, .filter-row button { min-height: 32px; padding: 0.25rem 0.7rem; font-size: 0.8rem; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); border-radius: 999px; font-weight: 600; }
.kind-chips button:hover, .filter-row button:hover { background: var(--surface-3); }
.kind-chips button[aria-pressed="true"], .filter-row button[aria-pressed="true"] { background: var(--brand-100); color: var(--brand-600); border-color: var(--brand-500); }
.filter-row { display: flex; gap: 0.35rem; overflow-x: auto; margin: 0.2rem 0 1rem; padding-bottom: 2px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-row button { flex-shrink: 0; background: var(--surface); }

.post { padding: 1rem 1.1rem 0.6rem; }
.post-head { display: flex; gap: 0.7rem; align-items: center; margin-bottom: 0.7rem; }
.post-who { flex: 1; min-width: 0; }
.post-who strong { display: block; font-size: 0.93rem; }
.post-who span { display: block; font-size: 0.76rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-kind { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.2rem 0.55rem; border-radius: 999px; background: var(--surface-2); color: var(--text-2); flex-shrink: 0; }
.post-kind .icon svg { width: 13px; height: 13px; }
.post-kind.k-verse { background: var(--gold-soft); color: var(--warning); }
.post-kind.k-question { background: var(--info-bg); color: var(--cat-support); }
.post-kind.k-line { background: var(--brand-100); color: var(--brand-600); }
.post-kind.k-photo { background: var(--surface-3); }
.post-text { white-space: pre-wrap; word-break: break-word; font-size: 0.95rem; line-height: 1.6; margin-bottom: 0.4rem; }
.post-line { font-size: 1.3rem; font-weight: 700; line-height: 1.4; letter-spacing: -0.01em; padding: 0.3rem 0 0.5rem; word-break: break-word; }
.post-verse {
  margin: 0.2rem 0 0.6rem; padding: 1.1rem 1.2rem; white-space: pre-wrap; text-align: center; word-break: break-word;
  font-family: Georgia, "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", serif; font-style: italic; font-size: 1.12rem; line-height: 1.9;
  background: linear-gradient(135deg, var(--gold-soft), var(--surface-2)); border-radius: var(--radius); border-left: 3px solid var(--gold);
}
.post-verse:lang(ur), .post-verse[dir="rtl"] { font-style: normal; }
.post-question { font-size: 1.05rem; font-weight: 650; line-height: 1.5; white-space: pre-wrap; word-break: break-word; margin-bottom: 0.4rem; padding-left: 0.8rem; border-left: 3px solid var(--cat-support); }
.post-image { width: 100%; max-height: 520px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); margin: 0.2rem 0 0.4rem; cursor: zoom-in; display: block; }
.post-actions { display: flex; gap: 0.2rem; align-items: center; border-top: 1px solid var(--border); margin-top: 0.4rem; padding-top: 0.35rem; }
.post-actions .grow { flex: 1; }
.post-actions button { color: var(--text-dim); font-weight: 600; }
.post-actions button:hover { color: var(--text); }
.like-btn.liked { color: #d63d5c; }
.like-btn.liked svg { fill: currentColor; }
.like-btn.pop svg { animation: heart-pop 0.45s var(--ease); }
@keyframes heart-pop { 0% { transform: scale(1); } 35% { transform: scale(1.35); } 60% { transform: scale(0.9); } 100% { transform: scale(1); } }
.post-comments { border-top: 1px solid var(--border); margin-top: 0.35rem; padding: 0.7rem 0 0.4rem; }
.comment { display: flex; gap: 0.55rem; margin-bottom: 0.55rem; }
.comment.fresh { animation: reveal 0.3s var(--ease); }
.comment .avatar { width: 32px; height: 32px; font-size: 0.75rem; }
.comment > .avatar-btn, .comment > .avatar { align-self: flex-start; margin-top: 2px; }
.comment-body { min-width: 0; flex: 1; }
.comment .bubble { display: inline-block; max-width: 100%; background: var(--surface-2); border-radius: 4px 14px 14px 14px; padding: 0.45rem 0.8rem; font-size: 0.88rem; min-width: 0; }
.comment .bubble strong { font-size: 0.84rem; }
.comment .bubble p { white-space: pre-wrap; word-break: break-word; margin-top: 0.1rem; }
.comment-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 0.85rem; margin: 0.2rem 0 0 0.6rem; font-size: 0.74rem; color: var(--text-dim); }
.comment-meta .linklike { font-size: 0.76rem; color: var(--text-dim); }
.comment-meta .linklike:hover { color: var(--accent-strong); }
.comment-original { margin-top: 0.3rem !important; padding-top: 0.3rem; border-top: 1px dashed var(--border-strong); font-size: 0.78rem; color: var(--warning); }
.comment-replies { margin-left: 2.6rem; }
.comment-replies:not(:empty) { padding-left: 0.7rem; border-left: 2px solid var(--brand-100); margin-bottom: 0.4rem; }
.comment.is-reply .avatar { width: 26px; height: 26px; font-size: 0.65rem; }
.comment-edit-form { display: grid; gap: 0.35rem; margin-top: 0.3rem; min-width: min(60vw, 320px); }
.comment-edit-form input { min-height: 36px; border-radius: 10px; }
.comment-edit-actions { display: flex; justify-content: flex-end; gap: 0.3rem; }
.comment-form { display: grid; gap: 0.35rem; margin-top: 0.3rem; }
.comment-form-row { display: flex; gap: 0.4rem; }
.comment-form input { min-height: 40px; border-radius: 999px; padding-left: 1rem; transition: box-shadow 0.2s, border-color 0.2s; }
.comment-replying { display: flex; align-items: center; gap: 0.6rem; font-size: 0.78rem; color: var(--accent-strong); font-weight: 600; padding-left: 0.9rem; }
.comment-replying .linklike { font-size: 0.78rem; color: var(--text-dim); }
.skeleton-line { height: 14px; border-radius: 6px; margin: 0.4rem 0; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.skeleton-line.short { width: 55%; }
@keyframes shimmer { to { background-position: -200% 0; } }
#feed-more { margin-bottom: 1rem; }
@media (max-width: 760px) {
  .composer-bar #composer-submit { flex: 1; }
  /* Post types in one swipeable row, the Post button full width under them. */
  .kind-chips { flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -1.1rem; padding-right: 1.1rem; }
  .kind-chips::-webkit-scrollbar { display: none; }
  .kind-chips button { flex-shrink: 0; }
  #composer-photo-row, #composer-media-row { margin-left: 0; }
  .post-line { font-size: 1.15rem; }
}

/* ---------- Beta testing ---------- */
.beta-ribbon { position: fixed; top: 14px; right: -34px; z-index: 3000; transform: rotate(45deg); background: var(--gold); color: #1c1606; font-weight: 800; font-size: 0.7rem; letter-spacing: 0.15em; padding: 0.2rem 2.4rem; box-shadow: var(--shadow); pointer-events: none; }
.feedback-fab { position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 800; border-radius: 999px; box-shadow: var(--shadow-lg); background: var(--gold); color: #1c1606; min-height: 44px; padding: 0.5rem 1.1rem; }
.feedback-fab:hover { background: #d8ab4c; }
.stars { display: flex; gap: 0.3rem; }
.stars button { background: transparent; border: none; color: var(--border-strong); font-size: 2rem; min-height: 0; padding: 0 0.15rem; line-height: 1; }
.stars button:hover, .stars button.on { background: transparent; color: var(--gold); }
@media (max-width: 760px) {
  .feedback-fab { bottom: calc(76px + env(safe-area-inset-bottom)); right: 0.8rem; padding: 0.45rem 0.8rem; }
  .feedback-fab span:last-child { display: none; }
}

/* ---------- Chats (WhatsApp-style) ---------- */
:root { --tick-grey: #8a969c; --tick-blue: #34b7f1; --bubble-mine: #dff4e9; --bubble-theirs: #ffffff; --chat-bg: #eef3f0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bubble-mine: #134536; --bubble-theirs: #1c2723; --chat-bg: #0f1714; --tick-grey: #93a39c; --tick-blue: #53bdeb; } }
.chat-app {
  display: grid; grid-template-columns: 340px 1fr; min-height: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm);
}
.chat-side { position: relative; display: flex; flex-direction: column; border-right: 1px solid var(--border); min-height: 0; min-width: 0; }
.chat-side-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.9rem 1rem 0.6rem; }
.chat-side-head h2 { font-size: 1.2rem; }
.chat-search { position: relative; padding: 0 0.8rem 0.6rem; }
.chat-search .icon { position: absolute; left: 1.55rem; top: 50%; transform: translateY(-65%); color: var(--text-dim); }
.chat-search input { padding-left: 2.2rem; border-radius: 999px; background: var(--surface-2); border-color: transparent; min-height: 38px; }
.chat-app .chat-list { flex: 1; overflow-y: auto; padding: 0 0.4rem 0.6rem; max-height: none; }
.chat-picker { position: absolute; inset: 0; background: var(--surface); display: flex; flex-direction: column; z-index: 2; animation: reveal 0.15s var(--ease); }
.conv {
  display: flex; align-items: center; gap: 0.75rem; width: 100%; text-align: left; white-space: normal;
  background: transparent; color: var(--text); border: none; border-radius: 12px; padding: 0.6rem; min-height: 64px; font-weight: 400;
}
.conv:hover { background: var(--surface-2); }
.conv.active { background: var(--brand-50); }
.conv .avatar { width: 46px; height: 46px; }
.conv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.conv-top, .conv-bottom { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.conv-top strong { font-size: 0.93rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { font-size: 0.72rem; color: var(--text-dim); flex-shrink: 0; }
.conv-preview { font-size: 0.84rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 0.25rem; min-width: 0; }
.conv-preview em { color: var(--accent-strong); font-style: normal; }
.conv.unread .conv-top strong { font-weight: 800; }
.conv.unread .conv-preview { color: var(--text); font-weight: 600; }
.conv.unread .conv-time { color: var(--success); font-weight: 700; }
.conv-unread { background: var(--success); color: #fff; font-size: 0.7rem; font-weight: 800; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; flex-shrink: 0; }
.chat-empty-list { text-align: center; color: var(--text-dim); padding: 2.5rem 1.2rem; display: grid; gap: 0.4rem; justify-items: center; font-size: 0.88rem; }
.chat-empty-list .icon svg { width: 34px; height: 34px; opacity: 0.5; }
.chat-empty-list strong { color: var(--text-2); }

.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--chat-bg); }
.chat-empty { margin: auto; text-align: center; color: var(--text-dim); display: grid; gap: 0.35rem; justify-items: center; padding: 2rem; }
.chat-empty-art { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 0.4rem; color: var(--accent-strong); background: radial-gradient(circle at 30% 30%, var(--gold-soft), var(--brand-100)); box-shadow: 0 0 0 8px color-mix(in srgb, var(--brand-100) 45%, transparent); }
.chat-empty-art svg { width: 38px; height: 38px; }
.chat-empty h3 { color: var(--text); }
.chat-empty button { margin-top: 0.6rem; }
.chat-open { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-header { display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.8rem; background: var(--surface); border-bottom: 1px solid var(--border); }
.chat-back { display: none; }
.chat-peer { flex: 1; display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.chat-peer .avatar { width: 40px; height: 40px; }
.chat-peer span { min-width: 0; }
.chat-peer strong { display: block; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-peer small { display: block; font-size: 0.75rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chat-app .msg-thread {
  flex: 1; overflow-y: auto; min-height: 0; max-height: none; padding: 0.8rem 1rem 1rem; gap: 0.18rem; background: transparent;
  background-image: radial-gradient(rgba(19, 98, 74, 0.06) 1px, transparent 1px); background-size: 18px 18px;
}
.chat-loading { margin: auto; }
.chat-loading .spinner { display: inline-block; width: 26px; height: 26px; border: 3px solid var(--brand-500); border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
.chat-start { margin: auto; max-width: 320px; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; display: grid; gap: 0.35rem; justify-items: center; color: var(--text-dim); font-size: 0.85rem; }
.chat-start .icon svg { width: 30px; height: 30px; color: var(--accent-strong); }
.chat-start strong { color: var(--text); font-size: 0.98rem; }
.day-sep { display: flex; justify-content: center; margin: 0.7rem 0 0.4rem; }
.day-sep span { background: var(--surface); color: var(--text-dim); font-size: 0.72rem; font-weight: 600; padding: 0.2rem 0.7rem; border-radius: 8px; box-shadow: var(--shadow-sm); }
.bubble-row { display: flex; }
.bubble-row.fresh { animation: reveal 0.16s var(--ease); }
.bubble-row.mine { justify-content: flex-end; }
.bubble {
  max-width: min(72%, 560px); padding: 0.4rem 0.55rem 0.3rem 0.7rem; border-radius: 12px; font-size: 0.93rem; line-height: 1.42;
  box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.12); position: relative; word-break: break-word;
}
.theirs .bubble { background: var(--bubble-theirs); border-top-left-radius: 4px; }
.mine .bubble { background: var(--bubble-mine); border-top-right-radius: 4px; }
.bubble-text { white-space: pre-wrap; }
.bubble-meta { float: right; display: inline-flex; align-items: center; gap: 0.2rem; margin: 0.35rem 0 -0.1rem 0.6rem; font-size: 0.68rem; color: var(--text-dim); white-space: nowrap; }
.bubble-row.failed .bubble { opacity: 0.8; }
.bubble-row.failed .bubble-meta { color: var(--danger); font-weight: 600; }
.tick { height: 11px; width: auto; flex-shrink: 0; }
.tick.pending { width: 12px; height: 12px; color: var(--tick-grey); }
.tick.sent, .tick.delivered { color: var(--tick-grey); }
.tick.seen { color: var(--tick-blue); }
.tick.failed { width: 13px; height: 13px; color: var(--danger); }
.conv-preview .tick { height: 10px; }

.chat-app .chat-compose { display: flex; align-items: flex-end; gap: 0.5rem; padding: 0.55rem 0.7rem; background: var(--surface); border-top: 1px solid var(--border); }
.chat-compose textarea { flex: 1; resize: none; min-height: 42px; max-height: 140px; border-radius: 22px; padding: 0.6rem 1rem; line-height: 1.4; background: var(--surface-2); border-color: transparent; }
.chat-compose textarea:focus { border-color: var(--brand-500); background: var(--surface); }
.send-btn { width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; flex-shrink: 0; }
.send-btn .icon svg { width: 20px; height: 20px; }
.send-btn:disabled { opacity: 0.45; }
.nav .badge-count#msg-badge { background: var(--success); color: #fff; }

@media (max-width: 980px) { .chat-app { grid-template-columns: 290px 1fr; } }
@media (max-width: 760px) {
  #tab-messages .chat-app { grid-template-columns: minmax(0, 1fr); }
  .chat-app[data-view="list"] .chat-main { display: none; }
  .chat-app[data-view="thread"] .chat-side { display: none; }
  .chat-back { display: inline-flex; }
  .bubble { max-width: 84%; }
  .nav button { position: relative; }
  .nav button #msg-badge { position: absolute; top: 2px; left: 50%; margin: 0; transform: translateX(6px); font-size: 0.6rem; padding: 0 0.35rem; }
}

/* App icon used as the logo (replaces the old letter tile) */
img.brand-seal.logo { background: none; border: none; padding: 0; border-radius: 12px; object-fit: contain; box-shadow: 0 2px 8px rgba(0,0,0,0.18); }
.sidebar img.brand-seal.logo, .auth-brand img.brand-seal.logo { box-shadow: 0 2px 10px rgba(0,0,0,0.35); }
img.brand-seal.logo.mobile-brand { width: 34px; height: 34px; border-radius: 9px; }

/* ---------- Chat attachments ---------- */
.attach-btn { width: 42px; height: 42px; min-height: 42px; padding: 0; border-radius: 50%; background: transparent; color: var(--text-dim); border: none; flex-shrink: 0; }
.attach-btn:hover { background: var(--surface-2); color: var(--text); }
.attach-btn .icon svg { width: 21px; height: 21px; }
.chat-attach { display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.8rem; background: var(--surface); border-top: 1px solid var(--border); animation: reveal 0.15s var(--ease); }
.chat-attach img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.chat-attach .file-meta { flex: 1; min-width: 0; }
.file-meta strong { display: block; font-size: 0.86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta small { display: block; font-size: 0.74rem; color: var(--text-dim); }
.file-badge { width: 40px; height: 48px; border-radius: 6px; color: #fff; font-size: 0.64rem; font-weight: 800; display: grid; place-items: end center; padding-bottom: 6px; flex-shrink: 0; letter-spacing: 0.03em; box-shadow: inset 0 10px 0 rgba(255,255,255,0.12); }
.bubble.has-att { padding: 0.3rem 0.3rem 0.3rem; max-width: min(72%, 380px); }
.bubble.has-att .bubble-text { display: block; padding: 0.35rem 0.4rem 0; }
.bubble.has-att .bubble-meta { margin-right: 0.3rem; }
.bubble-img { display: block; border-radius: 9px; overflow: hidden; background: var(--surface-3); line-height: 0; }
.bubble-img img { width: 100%; max-width: 340px; max-height: 340px; object-fit: cover; display: block; }
.bubble.photo-only { position: relative; }
.bubble.photo-only .bubble-meta { position: absolute; right: 0.75rem; bottom: 0.6rem; float: none; margin: 0; color: #fff; background: rgba(0,0,0,0.45); padding: 0.1rem 0.4rem; border-radius: 8px; }
.bubble.photo-only .bubble-meta .tick.sent, .bubble.photo-only .bubble-meta .tick.delivered, .bubble.photo-only .bubble-meta .tick.pending { color: #fff; }
.bubble-file { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.5rem; background: rgba(0,0,0,0.04); border-radius: 9px; min-width: 220px; }
.mine .bubble-file { background: rgba(19, 98, 74, 0.08); }
.bubble-file .file-meta { flex: 1; min-width: 0; }
.file-dl { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); border: 1px solid var(--border-strong); flex-shrink: 0; }
.file-dl:hover { background: var(--surface-2); text-decoration: none; }
.file-dl svg { width: 17px; height: 17px; }
.chat-main.dragging .msg-thread { outline: 3px dashed var(--brand-500); outline-offset: -10px; background-color: var(--brand-50); }

/* ---------- Messages: exact-fit layout ----------
   The chat fills the space under the header exactly (no page scroll, no
   magic "100vh - 150px"): main is a viewport-tall column and every level
   down is flex with min-height:0 so only the thread scrolls. */
body[data-tab="messages"] .feedback-fab { display: none; }
body[data-tab="messages"] .main { height: 100vh; height: 100dvh; overflow: hidden; }
body[data-tab="messages"] .content { flex: 1; min-height: 0; display: flex; flex-direction: column; max-width: 1440px; padding: 1rem clamp(0.75rem, 2vw, 1.5rem); }
body[data-tab="messages"] #tab-messages:not(.hidden) { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#tab-messages .chat-app { flex: 1; }
body[data-tab="messages"] .page-header { display: none; } /* the chat has its own "Chats" header */

/* grouped bubbles */
.chat-app .msg-thread { gap: 2px; padding: 0.6rem clamp(0.6rem, 3vw, 2.2rem) 0.9rem; }
.bubble-row:not(.cont) { margin-top: 0.45rem; }
.day-sep + .bubble-row { margin-top: 0; }
.bubble-row.cont.theirs .bubble { border-top-left-radius: 12px; }
.bubble-row.cont.mine .bubble { border-top-right-radius: 12px; }
.bubble { transition: box-shadow 0.15s ease; }
.bubble-row.menu-open .bubble, .bubble-row.editing .bubble { box-shadow: 0 0 0 2px var(--brand-500); }
.bubble .edited { font-style: italic; margin-right: 0.15rem; }
.bubble.deleted { background: transparent; box-shadow: none; border: 1px dashed var(--border-strong); color: var(--text-dim); font-style: italic; font-size: 0.86rem; }
.bubble.deleted .bubble-text { display: inline-flex; align-items: center; gap: 0.35rem; }
.bubble.deleted .icon svg { width: 14px; height: 14px; }

/* the little "v" in the corner of a bubble opens Copy / Edit / Delete */
.bubble-more {
  position: absolute; top: 3px; right: 3px; z-index: 1; width: 26px; height: 22px; min-height: 0; padding: 0; border-radius: 8px;
  color: var(--text-dim); border: none; opacity: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--bubble-theirs) 35%);
}
.mine .bubble-more { background: linear-gradient(90deg, transparent, var(--bubble-mine) 35%); }
.bubble-more svg { width: 16px; height: 16px; }
.bubble-more:hover { color: var(--text); }
.photo-only .bubble-more, .has-att .bubble-more { background: rgba(0, 0, 0, 0.4); color: #fff; top: 7px; right: 7px; }
@media (hover: hover) {
  .bubble:hover .bubble-more, .bubble-row.menu-open .bubble-more { opacity: 1; pointer-events: auto; }
}
.bubble-more:focus-visible { opacity: 1; pointer-events: auto; }
@media (hover: none) {
  .bubble { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
}

.msg-menu {
  position: fixed; z-index: 1200; min-width: 200px; padding: 6px; display: grid; gap: 2px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg);
  animation: pop 0.14s var(--ease); transform-origin: top;
}
.msg-menu button { justify-content: flex-start; gap: 0.65rem; background: transparent; color: var(--text); border: none; font-weight: 500; min-height: 40px; border-radius: 9px; padding: 0.45rem 0.7rem; }
.msg-menu button:hover, .msg-menu button:focus-visible { background: var(--surface-2); box-shadow: none; }
.msg-menu .icon svg { width: 18px; height: 18px; color: var(--text-dim); }
.msg-menu .danger-item, .msg-menu .danger-item .icon svg { color: var(--danger); }
@keyframes pop { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }

.confirm-card { max-width: 360px; text-align: left; }
.confirm-card h3 { margin-bottom: 0.35rem; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.2rem; }

/* editing banner above the composer */
.chat-editing { display: flex; align-items: center; gap: 0.7rem; padding: 0.5rem 0.8rem 0.5rem 1rem; background: var(--surface); border-top: 1px solid var(--border); animation: reveal 0.15s var(--ease); }
.chat-editing > .icon { color: var(--accent-strong); }
.chat-editing-body { flex: 1; min-width: 0; border-left: 3px solid var(--primary); padding-left: 0.6rem; }
.chat-editing-body strong { display: block; font-size: 0.8rem; color: var(--accent-strong); }
.chat-editing-body span { display: block; font-size: 0.84rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* reply: quote inside a bubble, the reply banner, swipe-to-reply */
.bubble-quote {
  display: flex; align-items: stretch; gap: 0.5rem; width: 100%; min-width: 180px; min-height: 0; margin: 0.1rem 0 0.3rem; padding: 0.3rem 0.5rem 0.3rem 0.6rem;
  background: rgba(0, 0, 0, 0.06); border: none; border-left: 4px solid var(--accent-strong); border-radius: 8px;
  color: var(--text); font: inherit; font-weight: 400; text-align: left; cursor: pointer; box-shadow: none;
}
.bubble-quote.bq-mine { border-left-color: var(--brand-500); }
.bubble-quote:hover { background: rgba(0, 0, 0, 0.1); box-shadow: none; }
.bq-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.bq-body strong { font-size: 0.78rem; color: var(--accent-strong); }
.bq-mine .bq-body strong { color: var(--brand-500); }
.bq-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 0.83rem; color: var(--text-dim); white-space: pre-wrap; }
.bq-text .icon svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 0.2rem; }
.bq-gone .bq-text { font-style: italic; }
.bq-thumb { width: 42px; height: 42px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.bubble.has-quote.has-att .bubble-img { margin-top: 0; }
.chat-reply .chat-editing-body strong { color: var(--brand-500); }
.chat-reply .bq-thumb { width: 38px; height: 38px; }
.chat-app .msg-thread { overflow-x: hidden; }
.bubble-row { position: relative; touch-action: pan-y; }
.bubble-row:not(.swiping) { transition: transform 0.2s var(--ease); }
.swipe-reply {
  position: absolute; left: -34px; top: 50%; width: 30px; height: 30px; margin-top: -15px; display: grid; place-items: center;
  border-radius: 50%; background: var(--surface); color: var(--text-dim); box-shadow: var(--shadow-sm); opacity: 0; transition: opacity 0.15s, transform 0.15s;
}
.swipe-reply svg { width: 16px; height: 16px; }
.bubble-row.swiping .swipe-reply { opacity: 0.6; }
.bubble-row.swipe-armed .swipe-reply { opacity: 1; transform: scale(1.12); color: var(--brand-500); }
.bubble-row.replying .bubble { box-shadow: 0 0 0 2px var(--brand-500); }
.bubble-row.flash .bubble { animation: quote-flash 1.5s var(--ease); }
@keyframes quote-flash { 0%, 40% { box-shadow: 0 0 0 3px var(--brand-500); filter: brightness(0.93); } 100% { box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.12); } }
.chat-compose.is-editing textarea { background: var(--surface); border-color: var(--brand-500); }
.attach-btn:disabled { opacity: 0.35; }

.chat-alert:empty { display: none; }
.chat-alert { padding: 0.4rem 0.7rem 0; background: var(--surface); border-top: 1px solid var(--border); }
.chat-alert .alert { margin: 0 0 0.4rem; }

.chat-start { gap: 0.25rem; padding: 1.4rem 1.6rem; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.chat-start-avatar { width: 64px; height: 64px; font-size: 1.3rem; margin-bottom: 0.35rem; }
.chat-start span:last-child { font-size: 0.92rem; }

.conv-deleted { display: inline-flex; align-items: center; gap: 0.3rem; font-style: italic; }
.conv-deleted svg { width: 13px; height: 13px; flex-shrink: 0; }
.conv { transition: background 0.12s ease; }
.conv.active { box-shadow: inset 3px 0 0 var(--primary); }
.chat-side-head h2 { font-size: 1.35rem; font-weight: 750; }
.chat-header { min-height: 60px; }

@media (max-width: 760px) {
  /* Messages: edge-to-edge, and an open chat takes the whole screen like
     any messaging app. Back returns to the list (and the tab bar). */
  body[data-tab="messages"] .main { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  body[data-tab="messages"] .content { padding: 0; }
  #tab-messages .chat-app { border: none; border-radius: 0; box-shadow: none; }
  body[data-tab="messages"][data-chat-view="thread"] .sidebar { display: none; }
  .chat-side-head, .chat-header { padding-top: max(0.6rem, env(safe-area-inset-top)); }
  body[data-tab="messages"][data-chat-view="thread"] .main { padding-bottom: env(safe-area-inset-bottom); }
  body[data-tab="messages"] #announcement, body[data-tab="messages"] #global-alert:empty { display: none; }
  .chat-app .msg-thread { padding: 0.5rem 0.6rem 0.8rem; }
}

/* ---------- Mentors & Campus life ---------- */
.discover-hero {
  position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: clamp(1.3rem, 3vw, 2rem); margin-bottom: 1.4rem; color: #fff;
  background: radial-gradient(700px 300px at 100% 0%, rgba(197, 154, 61, 0.35), transparent 60%), linear-gradient(135deg, var(--brand-700), var(--brand-900));
  box-shadow: var(--shadow);
}
.hero-campus { background: radial-gradient(650px 300px at 100% 0%, rgba(240, 190, 90, 0.4), transparent 60%), linear-gradient(135deg, #2f6b3a, #163f2a); }
.discover-hero::after { content: ""; position: absolute; right: -60px; bottom: -80px; width: 260px; height: 260px; border-radius: 50%; border: 40px solid rgba(255, 255, 255, 0.05); pointer-events: none; }
.hero-copy { position: relative; z-index: 1; max-width: 640px; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); }
.discover-hero h2 { color: #fff; font-size: clamp(1.35rem, 2.6vw, 1.8rem); font-weight: 750; margin: 0.35rem 0 0.3rem; }
.discover-hero p { color: rgba(255, 255, 255, 0.82); font-size: 0.95rem; }
.hero-search { position: relative; z-index: 1; display: flex; gap: 0.5rem; align-items: center; margin-top: 1.2rem; background: #fff; border-radius: 14px; padding: 6px 6px 6px 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); max-width: 720px; }
.hero-search > .icon { color: #66756e; }
.hero-search input { border: none; background: transparent; min-height: 44px; padding: 0 0.3rem; color: #16211d; font-size: 1rem; }
.hero-search input::placeholder { color: #7b8a83; }
.hero-search input:focus { box-shadow: none; }
.hero-search button { min-height: 44px; border-radius: 10px; padding: 0.55rem 1.2rem; flex-shrink: 0; }
.hero-chips { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 1rem; }
.hero-chip { min-height: 34px; padding: 0.3rem 0.85rem; border-radius: 999px; font-size: 0.83rem; font-weight: 600; background: rgba(255, 255, 255, 0.12); color: #fff; border: 1px solid rgba(255, 255, 255, 0.22); }
.hero-chip:hover { background: rgba(255, 255, 255, 0.22); }
.hero-chip[aria-pressed="true"] { background: var(--gold); color: #1c1606; border-color: var(--gold); }
.hero-chip .icon svg { width: 15px; height: 15px; }
.hero-more { position: relative; z-index: 1; margin-top: 0.9rem; }
.hero-more summary { cursor: pointer; font-size: 0.85rem; font-weight: 600; color: rgba(255, 255, 255, 0.85); width: fit-content; }
.hero-more[open] summary { margin-bottom: 0.7rem; }
.hero-more label { color: rgba(255, 255, 255, 0.85); }
.hero-more input, .hero-more select { background: #fff; color: #16211d; border-color: transparent; }

.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 0 0.1rem 0.8rem; }
.results-head > .muted { white-space: nowrap; } /* the count only; the hint under the title wraps */
.results-head h3 { font-size: 1.1rem; }
.people-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.person-card {
  display: flex; flex-direction: column; gap: 0.7rem; padding: 1.15rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); transition: transform 0.2s var(--ease), box-shadow 0.2s ease, border-color 0.2s ease; animation: reveal 0.25s var(--ease);
  position: relative;
}
.person-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.pc-top { display: flex; align-items: flex-start; gap: 0.8rem; }
.pc-avatar { width: 54px; height: 54px; font-size: 1.1rem; border: 2px solid var(--surface); box-shadow: 0 0 0 2px var(--brand-100); flex-shrink: 0; }
.is-campus .pc-avatar { box-shadow: 0 0 0 2px var(--gold-soft); }
.pc-id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.pc-name-line { display: flex; align-items: center; gap: 0.35rem; min-width: 0; }
.pc-name-line strong { display: block; font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-id .pc-sub { display: block; font-size: 0.8rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }

/* Mentor availability badge — comforting, clear, respectful */
.pc-mentor-status {
  display: inline-flex; align-items: center; gap: 0.38rem; padding: 0.16rem 0.55rem;
  border-radius: 999px; font-size: 0.72rem; font-weight: 600; width: fit-content; max-width: 100%;
  margin-top: 0.22rem; line-height: 1.25; letter-spacing: 0.01em; transition: all 0.15s ease;
}
.pc-mentor-status.is-available {
  background: var(--success-bg); color: var(--success); border: 1px solid color-mix(in srgb, var(--success) 24%, transparent);
}
.pc-mentor-status.is-full {
  background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border);
}
.pc-mentor-status .status-pulse-dot {
  width: 6.5px; height: 6.5px; border-radius: 50%; flex-shrink: 0;
}
.pc-mentor-status.is-available .status-pulse-dot {
  background: var(--success); box-shadow: 0 0 0 2px color-mix(in srgb, var(--success) 30%, transparent);
  animation: status-pulse 2.4s infinite ease-in-out;
}
.pc-mentor-status.is-full .status-pulse-dot {
  background: var(--text-dim);
}
.pc-mentor-status .status-text {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline !important; font-size: 0.72rem !important; color: inherit !important;
}
@keyframes status-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
}

/* Match badge with clear caption and interactive breakdown popover */
.pc-match {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
  flex-shrink: 0; cursor: pointer; user-select: none;
}
.pc-match:focus-visible {
  outline: 2px solid var(--brand-500); outline-offset: 3px; border-radius: 8px;
}
.match-ring {
  --p: 0; flex-shrink: 0; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--brand-500) calc(var(--p) * 1%), var(--surface-3) 0);
  transition: transform 0.18s var(--ease);
}
.pc-match:hover .match-ring { transform: scale(1.05); }
.is-campus .match-ring { background: conic-gradient(var(--gold) calc(var(--p) * 1%), var(--surface-3) 0); }
.match-ring span { width: 38px; height: 38px; border-radius: 50%; background: var(--surface); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.86rem; font-variant-numeric: tabular-nums; }
.match-ring small { font-size: 0.58rem; font-weight: 700; margin-left: 1px; }

.pc-match .match-caption {
  font-size: 0.65rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--brand-600); white-space: nowrap; display: block;
}
.is-campus .pc-match .match-caption { color: var(--warning); }

.pc-match-popover {
  position: absolute; top: calc(100% + 6px); right: -6px; width: 236px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 0.7rem 0.85rem; color: var(--text); z-index: 120;
  opacity: 0; pointer-events: none; transform: translateY(4px);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
}
.pc-match:hover .pc-match-popover,
.pc-match:focus .pc-match-popover,
.pc-match:focus-within .pc-match-popover {
  opacity: 1; pointer-events: auto; transform: translateY(0);
}
.pmp-head {
  display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--border);
  padding-bottom: 0.35rem; margin-bottom: 0.45rem;
}
.pmp-title { font-size: 0.74rem; font-weight: 700; color: var(--text); letter-spacing: 0.01em; }
.pmp-pct { font-size: 0.95rem; font-weight: 800; color: var(--brand-600); font-variant-numeric: tabular-nums; }
.is-campus .pmp-pct { color: var(--warning); }
.pmp-body { display: flex; flex-direction: column; gap: 0.25rem; }
.pmp-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.72rem; color: var(--text-2); }
.pmp-row strong { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.pmp-foot { margin-top: 0.45rem; padding-top: 0.35rem; border-top: 1px dashed var(--border); font-size: 0.67rem; color: var(--text-dim); line-height: 1.3; }

.pc-bio { font-size: 0.88rem; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pc-why { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-dim); margin-bottom: -0.25rem; }
.pc-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.pc-chip { font-size: 0.76rem; padding: 0.18rem 0.6rem; border-radius: 999px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.pc-chip.hit { background: var(--brand-100); color: var(--brand-600); border-color: transparent; font-weight: 700; }
.is-campus .pc-chip.hit { background: var(--gold-soft); color: var(--warning); }
.pc-cap {
  display: inline-flex; align-items: center; gap: 0.35rem; width: fit-content; font-size: 0.73rem;
  font-weight: 600; color: var(--success); background: var(--success-bg); padding: 0.15rem 0.55rem;
  border-radius: 999px; border: 1px solid color-mix(in srgb, var(--success) 22%, transparent);
}
.pc-cap.full { color: var(--text-dim); background: var(--surface-2); border-color: var(--border); }
.pc-actions { margin-top: auto; padding-top: 0.3rem; display: flex; }
.pc-actions button { flex: 1; }
.skeleton-card { pointer-events: none; }
.skeleton-dot { background: var(--surface-3); border: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero-search { background: var(--surface); }
  :root:not([data-theme="light"]) .hero-search input { color: var(--text); }
  :root:not([data-theme="light"]) .pc-chip.hit { color: var(--accent-strong); }
}
@media (max-width: 760px) {
  .discover-hero { border-radius: var(--radius); margin-bottom: 1.1rem; }
  .hero-search { padding: 5px 5px 5px 12px; }
  .hero-search button { padding: 0.5rem 0.85rem; }
  .hero-chips { flex-wrap: nowrap; overflow-x: auto; margin-right: -1.3rem; padding-right: 1.3rem; scrollbar-width: none; }
  .hero-chips::-webkit-scrollbar { display: none; }
  .hero-chip { flex-shrink: 0; }
}

/* "Only you can see your photo" nudge above the composer */
.photo-nudge { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0.8rem 0.7rem 0.9rem; margin-bottom: 0.9rem; border-radius: var(--radius); background: linear-gradient(135deg, var(--gold-soft), var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); animation: reveal 0.2s var(--ease); }
.nudge-avatar { width: 40px; height: 40px; }
.nudge-text { flex: 1; min-width: 0; }
.nudge-text strong { display: block; font-size: 0.9rem; }
.nudge-text span { display: block; font-size: 0.8rem; color: var(--text-dim); }
@media (max-width: 760px) { .photo-nudge { flex-wrap: wrap; } .photo-nudge #nudge-show { order: 3; width: 100%; } }

/* Tap anyone's picture (or name) to meet them full screen */
.avatar-btn { display: inline-flex; padding: 0; min-height: 0; background: none; border: none; border-radius: 50%; flex-shrink: 0; cursor: pointer; box-shadow: none; transition: transform 0.18s var(--ease); }
.avatar-btn:hover { background: none; box-shadow: none; transform: scale(1.06); }
.avatar-btn:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.name-link { display: inline; background: none; border: none; padding: 0; min-height: 0; font: inherit; font-weight: inherit; color: inherit; text-align: left; cursor: pointer; }
.name-link:hover { background: none; color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }

body.viewer-open { overflow: hidden; }
.viewer-close { position: fixed; top: max(14px, env(safe-area-inset-top)); right: 14px; z-index: 2; width: 44px; min-height: 44px; padding: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.22); color: #fff; backdrop-filter: blur(8px); }
.viewer-close:hover { background: rgba(255, 255, 255, 0.26); }

.photo-viewer { position: fixed; inset: 0; z-index: 1500; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(4, 10, 8, 0.97); cursor: zoom-out; animation: fade-in 0.2s ease; }
.photo-viewer figure { margin: 0; display: grid; gap: 0.8rem; justify-items: center; animation: zoom-in 0.28s var(--ease); }
.photo-viewer img { max-width: 96vw; max-height: 86vh; border-radius: 14px; object-fit: contain; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.photo-viewer figcaption { color: #fff; font-weight: 600; }
.photo-viewer figcaption:empty { display: none; }

.member-view {
  position: fixed; inset: 0; z-index: 1400; display: flex; align-items: center; justify-content: center; padding: 4.5rem 1.2rem 2rem; overflow-y: auto;
  background: radial-gradient(900px 500px at 50% -10%, rgba(197, 154, 61, 0.28), transparent 60%), rgba(6, 22, 17, 0.93);
  backdrop-filter: blur(14px); animation: fade-in 0.22s ease;
}
.mv-card { width: 100%; max-width: 440px; margin: auto; text-align: center; color: #fff; animation: zoom-in 0.32s var(--ease); }
.mv-photo { width: min(72vw, 320px); aspect-ratio: 1; margin: 0 auto 1.2rem; border-radius: 32px; overflow: hidden; box-shadow: 0 0 0 3px rgba(197, 154, 61, 0.55), 0 24px 60px rgba(0, 0, 0, 0.45); }
.mv-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mv-initials { width: 100%; height: 100%; display: grid; place-items: center; font-size: clamp(3rem, 16vw, 5.5rem); font-weight: 800; letter-spacing: 0.02em; color: #fff; background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.28), transparent 55%), var(--c); }
.member-view h2 { color: #fff; font-size: 1.6rem; font-weight: 750; letter-spacing: -0.01em; }
.mv-sub { margin-top: 0.25rem; color: var(--gold); font-weight: 600; font-size: 0.92rem; }
.mv-sub:empty, .mv-bio:empty, .mv-tags:empty, .mv-mentor-status:empty { display: none; }
.mv-mentor-status {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.22rem 0.8rem;
  border-radius: 999px; font-size: 0.78rem; font-weight: 600; margin: 0.6rem auto 0;
  width: fit-content; text-align: center;
}
.mv-mentor-status.is-available {
  background: rgba(31, 138, 91, 0.22); color: #5ee6a8; border: 1px solid rgba(94, 230, 168, 0.4);
}
.mv-mentor-status.is-full {
  background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.7); border: 1px solid rgba(255, 255, 255, 0.18);
}
.mv-mentor-status .status-pulse-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.mv-mentor-status.is-available .status-pulse-dot {
  background: #5ee6a8; box-shadow: 0 0 0 2px rgba(94, 230, 168, 0.4);
}
.mv-mentor-status.is-full .status-pulse-dot {
  background: rgba(255, 255, 255, 0.6);
}
.mv-bio { margin: 0.9rem auto 0; max-width: 380px; color: rgba(255, 255, 255, 0.85); font-size: 0.95rem; line-height: 1.6; white-space: pre-wrap; }
.mv-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem; margin-top: 1rem; }
.mv-tags .tag { background: rgba(255, 255, 255, 0.1); color: #fff; border: 1px solid rgba(255, 255, 255, 0.18); margin: 0; }
.mv-actions { margin-top: 1.4rem; display: flex; justify-content: center; }
.mv-actions button { min-height: 48px; padding: 0.7rem 1.8rem; border-radius: 999px; background: var(--gold); color: #1c1606; border-color: var(--gold); font-weight: 700; box-shadow: 0 10px 28px rgba(197, 154, 61, 0.35); }
.mv-actions button:hover { background: #d3aa50; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes zoom-in { from { opacity: 0; transform: scale(0.94) translateY(8px); } to { opacity: 1; transform: none; } }

/* Forwarded messages */
.fwd-label { display: flex; align-items: center; gap: 0.25rem; margin-bottom: 0.2rem; font-size: 0.72rem; font-style: italic; color: var(--text-dim); }
.fwd-label .icon svg { width: 13px; height: 13px; }
.bubble.photo-only .fwd-label { padding: 0.3rem 0.5rem 0; }

/* Forward picker */
.fwd-card { max-width: 420px; display: flex; flex-direction: column; padding: 1.1rem; }
.fwd-card .modal-head { margin-bottom: 0.6rem; }
.fwd-preview { display: flex; align-items: flex-start; gap: 0.5rem; padding: 0.55rem 0.7rem; margin-bottom: 0.7rem; border-left: 3px solid var(--primary); background: var(--surface-2); border-radius: 8px; font-size: 0.86rem; color: var(--text-2); overflow-wrap: anywhere; }
.fwd-preview .icon svg { width: 16px; height: 16px; color: var(--text-dim); }
.fwd-card .chat-search { margin: 0 0 0.4rem; }
.fwd-list { overflow-y: auto; max-height: min(46vh, 380px); margin: 0 -0.3rem; }
.fwd-sec { padding: 0.55rem 0.5rem 0.25rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-dim); }
.fwd-row { display: flex; align-items: center; gap: 0.7rem; width: 100%; justify-content: flex-start; text-align: left; background: transparent; color: var(--text); border: none; box-shadow: none; border-radius: 10px; padding: 0.45rem 0.5rem; min-height: 54px; font-weight: 400; }
.fwd-row:hover { background: var(--surface-2); box-shadow: none; }
.fwd-row .avatar { width: 40px; height: 40px; font-size: 0.85rem; }
.fwd-who { flex: 1; min-width: 0; display: grid; }
.fwd-who strong, .fwd-who small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fwd-who small { color: var(--text-dim); font-size: 0.78rem; }
.fwd-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong, var(--border)); display: grid; place-items: center; color: transparent; flex-shrink: 0; }
.fwd-check svg { width: 14px; height: 14px; }
.fwd-row.on .fwd-check { background: var(--primary); border-color: var(--primary); color: #fff; }
.fwd-foot { display: flex; align-items: center; gap: 0.8rem; justify-content: space-between; padding-top: 0.8rem; margin-top: 0.4rem; border-top: 1px solid var(--border); }
.fwd-foot .muted { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Opening screen ---------- */
.splash {
  position: fixed; inset: 0; z-index: 5000; display: grid; place-items: center; padding: 2rem 1.5rem; text-align: center; color: #fff;
  background: radial-gradient(800px 480px at 50% 0%, rgba(197, 154, 61, 0.3), transparent 65%), linear-gradient(160deg, var(--brand-700), var(--brand-900));
  transition: opacity 0.5s ease, visibility 0.5s ease;
  animation: splash-failsafe 0.5s 12s forwards; /* never stuck, even if the app fails to start */
}
.splash.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-inner { display: grid; justify-items: center; gap: 0.35rem; max-width: 460px; }
.splash-logo { width: 84px; height: 84px; border-radius: 22px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35); animation: splash-breathe 2.4s ease-in-out infinite; margin-bottom: 0.6rem; }
.splash-name { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.01em; }
.splash-uni { font-size: 0.8rem; color: rgba(255, 255, 255, 0.7); letter-spacing: 0.04em; }
.splash-line { margin-top: 1.4rem; font-size: 1.05rem; line-height: 1.55; font-weight: 500; color: #f4e6c4; opacity: 0; animation: splash-line 0.7s 0.25s var(--ease) forwards; }
.splash-dots { display: flex; gap: 6px; margin-top: 1.4rem; }
.splash-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); animation: pulse 1.1s ease-in-out infinite; }
.splash-dots i:nth-child(2) { animation-delay: 0.15s; }
.splash-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes splash-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes splash-line { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes splash-failsafe { to { opacity: 0; visibility: hidden; pointer-events: none; } }

/* ---------- Gentle scroll touches ---------- */
.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; transform: scaleX(0); transform-origin: 0 50%; background: linear-gradient(90deg, var(--brand-500), var(--gold)); pointer-events: none; }
body.scrolled .page-header { box-shadow: 0 6px 20px rgba(16, 33, 27, 0.07); }
.to-top { position: fixed; right: 1.1rem; bottom: calc(82px + env(safe-area-inset-bottom)); z-index: 55; width: 46px; min-height: 46px; padding: 0; border-radius: 50%; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(12px) scale(0.9); pointer-events: none; transition: opacity 0.25s, transform 0.25s var(--ease); }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
body[data-tab="messages"] .to-top { display: none; }
/* Above the Feedback button (or where it would be) on phones. */
@media (max-width: 760px) { .to-top { right: 0.8rem; bottom: calc(136px + env(safe-area-inset-bottom)); } }
.reveal-on .card.post:not(.in), .reveal-on .person-card:not(.in), .reveal-on .card.entity:not(.in) { opacity: 0; transform: translateY(16px); }
.reveal-on .card.post, .reveal-on .person-card, .reveal-on .card.entity { transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), box-shadow 0.15s ease, border-color 0.15s; }
.feed-end { text-align: center; color: var(--text-dim); font-size: 0.88rem; padding: 0.8rem 0 1.6rem; }

/* ---------- Search boxes ---------- */
.hero-search { transition: box-shadow 0.25s var(--ease), transform 0.25s var(--ease); }
.hero-search:focus-within { box-shadow: 0 0 0 3px rgba(197, 154, 61, 0.55), 0 12px 32px rgba(0, 0, 0, 0.25); transform: translateY(-1px); }
.hero-search:focus-within > .icon { color: var(--brand-600); }
.hero-directory { background: radial-gradient(650px 300px at 100% 0%, rgba(120, 170, 220, 0.3), transparent 60%), linear-gradient(135deg, #16495f, #0c2b3a); }
.hero-filters { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.9rem; max-width: 720px; }
.hero-filters select { flex: 1 1 150px; width: auto; min-width: 0; max-width: 100%; min-height: 40px; border-radius: 999px; padding: 0.4rem 2rem 0.4rem 0.95rem; font-size: 0.85rem; font-weight: 600; background-color: rgba(255, 255, 255, 0.12); color: #fff; border: 1px solid rgba(255, 255, 255, 0.24); }
.hero-filters select option { color: #16211d; background: #fff; }
.hero-filters select:focus { box-shadow: 0 0 0 3px rgba(197, 154, 61, 0.5); }
input[type="search"], .chat-search input, #chat-search, #fwd-search { transition: box-shadow 0.2s, border-color 0.2s; }

/* ---------- Study posts and short videos ---------- */
.composer-fields { flex: 1; min-width: 0; display: grid; }
.composer-title { border: none; background: transparent; box-shadow: none; padding: 0.4rem 0.2rem 0.1rem; min-height: 0; font-size: 1.08rem; font-weight: 700; }
.composer-title:focus { box-shadow: none; }
.composer-guide { margin: 0.3rem 0 0 3.4rem; font-size: 0.8rem; color: var(--text-dim); }
.topic-picker { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.5rem 0 0.2rem 3.4rem; }
.topic-picker button { min-height: 36px; padding: 0.3rem 0.85rem; border-radius: 999px; font-size: 0.84rem; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.topic-picker button:hover { background: var(--surface-3); }
.topic-picker button[aria-pressed="true"] { background: var(--gold-soft); color: var(--warning); border-color: var(--gold); }
.preview-wrap video { max-height: 220px; max-width: 100%; border-radius: var(--radius-sm); display: block; background: #000; }
.file-chip { display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.4rem 0.5rem 0.7rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); max-width: 100%; }
.file-chip strong { display: block; font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.file-chip small { color: var(--text-dim); font-size: 0.74rem; }
.file-chip .close-btn { position: static; background: none; color: var(--text-dim); width: 30px; min-height: 30px; padding: 0; }
.upload-progress { height: 4px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin: 0.6rem 0 0 3.4rem; }
.upload-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand-500), var(--gold)); transition: width 0.2s; }
.kind-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.kind-chips::-webkit-scrollbar { display: none; }
.kind-chips button { flex-shrink: 0; }
.filter-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-row button { flex-shrink: 0; }
.topic-row { margin-top: -0.4rem; }
.topic-row button[aria-pressed="true"] { background: var(--gold-soft); color: var(--warning); border-color: var(--gold); }
@media (max-width: 760px) {
  .composer-guide, .topic-picker, .upload-progress { margin-left: 0; }
}

.post-title { font-size: 1.12rem; font-weight: 750; line-height: 1.35; letter-spacing: -0.01em; margin: 0 0 0.45rem; word-break: break-word; }
.post-article { white-space: pre-wrap; word-break: break-word; font-size: 0.95rem; line-height: 1.7; color: var(--text-2); }
.post-article.clamped { max-height: 11.5em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.read-more { margin: 0.2rem 0 0.4rem; }
.post-kind.k-article { background: var(--brand-100); color: var(--brand-600); }
.post-kind.k-notes { background: var(--info-bg); color: var(--cat-support); }
.post-kind.k-book { background: var(--gold-soft); color: var(--warning); }
.post-kind.k-video { background: var(--surface-2); color: var(--text-2); text-transform: none; letter-spacing: 0; font-size: 0.74rem; }

.book-card { display: flex; gap: 0.9rem; align-items: flex-start; padding: 0.9rem; margin-bottom: 0.4rem; border-radius: var(--radius); background: linear-gradient(135deg, var(--gold-soft), var(--surface-2)); }
.book-cover { width: 76px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18); flex-shrink: 0; }
.book-cover.blank { display: grid; place-items: center; background: var(--brand-700); color: var(--gold); }
.book-cover.blank svg { width: 30px; height: 30px; }
.book-info { min-width: 0; }
.book-eyebrow { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--warning); }
.book-info .post-title { margin: 0.15rem 0 0.35rem; }
.book-info p { font-size: 0.9rem; line-height: 1.6; color: var(--text-2); white-space: pre-wrap; word-break: break-word; }

.file-card { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0.8rem; margin: 0.2rem 0 0.4rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); color: var(--text); text-decoration: none; transition: border-color 0.15s, background 0.15s; }
.file-card:hover { border-color: var(--brand-500); background: var(--brand-50); }
.file-icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--info-bg); color: var(--cat-support); flex-shrink: 0; }
.file-meta { flex: 1; min-width: 0; }
.file-meta strong { display: block; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta small { color: var(--text-dim); font-size: 0.76rem; }
.file-open { font-size: 0.82rem; font-weight: 700; color: var(--accent-strong); }

.post-video { display: block; width: 100%; max-height: 70vh; border-radius: var(--radius-sm); background: #000; margin: 0.2rem 0 0.4rem; }
.post-video.preparing { display: grid; place-items: center; aspect-ratio: 9 / 12; max-height: 320px; background: linear-gradient(135deg, var(--brand-800), var(--brand-900)); color: #fff; }
.post-status { display: flex; align-items: flex-start; gap: 0.5rem; margin: 0 0 0.6rem; padding: 0.55rem 0.75rem; border-radius: var(--radius-sm); font-size: 0.84rem; background: var(--surface-2); color: var(--text-2); }
.post-status .icon svg { width: 17px; height: 17px; }
.post-status.s-pending, .post-status.s-processing { background: var(--gold-soft); color: var(--warning); }
.post-status.s-rejected, .post-status.s-failed { background: var(--danger-bg); color: var(--danger); }

.post-media { position: relative; }
.post-image { touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.heart-burst { position: absolute; width: 96px; height: 96px; margin: -48px 0 0 -48px; color: #fff; pointer-events: none; filter: drop-shadow(0 6px 18px rgba(214, 61, 92, 0.55)); animation: heart-burst 0.85s var(--ease) forwards; }
.heart-burst svg { width: 100%; height: 100%; fill: #ff4d6d; stroke: #fff; stroke-width: 1.2; }
@keyframes heart-burst { 0% { opacity: 0; transform: scale(0.3); } 25% { opacity: 1; transform: scale(1.1); } 45% { transform: scale(0.95); } 80% { opacity: 1; transform: scale(1) translateY(-6px); } 100% { opacity: 0; transform: scale(1.05) translateY(-24px); } }

/* "Check your Spam folder" under every code-sent message: codes often land there. */
.spam-tip { display: block; margin-top: 0.3rem; font-size: 0.84rem; font-weight: 600; color: var(--warning); }

/* ---------- safety: Kalam Code, report, block ---------- */
.mv-actions { flex-direction: column; align-items: center; gap: 0.9rem; }
.mv-safety { display: flex; gap: 1.4rem; justify-content: center; }
.mv-actions .mv-safety button { min-height: 32px; padding: 0.2rem 0.4rem; background: none; border: none; box-shadow: none; color: rgba(255, 255, 255, 0.72); font-weight: 600; font-size: 0.85rem; gap: 0.35rem; border-radius: 8px; }
.mv-actions .mv-safety button:hover { color: #fff; }
.mv-safety .icon svg { width: 15px; height: 15px; }
.mv-blocked { margin: 0; color: rgba(255, 255, 255, 0.8); display: flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; }
.mv-blocked .icon svg { width: 16px; height: 16px; }

.chat-blocked { display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem 1rem; background: var(--surface); border-top: 1px solid var(--border); font-size: 0.88rem; color: var(--text-dim); }
.chat-blocked > span:nth-child(2) { flex: 1; }
.chat-blocked > .icon svg { width: 18px; height: 18px; color: var(--danger); }
.chat-start .chat-safety-tip { margin-top: 0.4rem; display: flex; gap: 0.4rem; align-items: flex-start; text-align: left; font-size: 0.76rem; color: var(--text-dim); line-height: 1.4; }
.chat-start .chat-safety-tip .icon svg { width: 15px; height: 15px; margin-top: 1px; }

.blocked-list { display: grid; gap: 0.55rem; }
.blocked-row { display: flex; align-items: center; gap: 0.7rem; }
.blocked-row .grow { flex: 1; min-width: 0; display: grid; }
.blocked-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.report-card { max-width: 440px; max-height: calc(100dvh - 2rem); overflow-y: auto; }
.report-reasons { display: grid; gap: 0.35rem; margin: 0.4rem 0 0.9rem; }
.report-reason { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.75rem; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-size: 0.9rem; font-weight: 500; }
.report-reason:has(input:checked) { border-color: var(--accent-strong); background: color-mix(in srgb, var(--accent-strong) 8%, transparent); }
.report-card .consent { margin: 0.2rem 0 0.9rem; }
.report-card .confirm-actions { margin-top: 0.4rem; }

.code-card { max-width: 480px; max-height: calc(100dvh - 2rem); overflow-y: auto; text-align: center; }
.code-hero { width: 64px; height: 64px; margin: 0 auto 0.6rem; border-radius: 50%; display: grid; place-items: center; color: var(--accent-strong); background: radial-gradient(circle at 30% 30%, var(--gold-soft), var(--brand-100)); }
.code-hero .icon svg { width: 30px; height: 30px; }
/* On a short phone the "I agree" button stays in view while the list scrolls. */
.code-card { padding-bottom: 0; }
.code-card #code-agree { margin: 1rem 0 1.1rem; position: sticky; bottom: 1.1rem; box-shadow: 0 0 0 0.5rem var(--surface), 0 1.2rem 0 0.5rem var(--surface); }
.code-list { list-style: none; margin: 0.8rem 0 0; padding: 0; display: grid; gap: 0.6rem; text-align: left; }
.code-list li { display: flex; gap: 0.7rem; align-items: flex-start; font-size: 0.9rem; line-height: 1.45; color: var(--text-dim); }
.code-list strong { color: var(--text); }
.code-emoji { font-size: 1.15rem; line-height: 1.3; flex-shrink: 0; }
.code-foot { margin: 0.8rem 0 0; text-align: left; }
.kalam-code-card h3 .icon svg { width: 18px; height: 18px; vertical-align: -3px; color: var(--accent-strong); }
.kalam-code-card .icon svg { width: 14px; height: 14px; vertical-align: -2px; }

/* ---------- Comfort & polish ---------- */
/* Urdu poetry in Nastaliq, the way it is meant to look. */
.post-verse.urdu { font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", serif; font-style: normal; font-size: 1.2rem; line-height: 2.4; border-left: none; border-right: 3px solid var(--gold); }
.composer-top textarea.verse-input:lang(ur) { font-family: "Noto Nastaliq Urdu", serif; }

/* Warm empty states. */
.empty-state.warm { color: var(--text-2); }
.empty-art { width: 150px; height: auto; color: var(--brand-500); margin: 0 auto 0.6rem; display: block; }

/* Post-shaped loading shimmer. */
.skeleton-post { pointer-events: none; }
.sk { display: block; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s ease-in-out infinite; }
.sk-avatar { width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; }
.sk-line { height: 12px; margin: 0.45rem 0; }
.post-who .sk-line { height: 10px; margin: 0.35rem 0; }
.sk-media { height: 180px; border-radius: var(--radius-sm); margin: 0.6rem 0; }
.sk-actions { display: flex; gap: 0.6rem; border-top: 1px solid var(--border); margin-top: 0.6rem; padding: 0.6rem 0 0.3rem; }
.sk-pill { width: 64px; height: 22px; border-radius: 999px; }

/* Kindness Pause. */
.kind-card { text-align: center; }
.kind-card .confirm-actions { justify-content: center; }

/* Glass header on phones: content blurs softly as it scrolls underneath. */
@media (max-width: 760px) {
  .page-header {
    background: rgba(15, 76, 58, 0.85); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
    border-bottom-color: rgba(255, 255, 255, 0.08); color: #fff; padding-top: max(0.8rem, env(safe-area-inset-top));
  }
  .page-header h1 { color: #fff; }
  .page-header .secondary, .page-header .ghost { background: rgba(255, 255, 255, 0.12); color: #fff; border-color: rgba(255, 255, 255, 0.18); }
}

/* ---------- Phone: bottom bar, pull to refresh, viewer ---------- */
.mobile-only, .bottom-nav { display: none; }
.bn-badge { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--gold); color: #1c1606; font-size: 0.66rem; font-weight: 800; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--brand-800); }
.discover-switch { gap: 0.3rem; background: var(--surface-3); padding: 4px; border-radius: 999px; margin-bottom: 0.9rem; }
.discover-switch button { flex: 1; min-height: 36px; border-radius: 999px; background: transparent; color: var(--text-2); border: none; }
.discover-switch button[aria-pressed="true"] { background: var(--surface); color: var(--accent-strong); box-shadow: var(--shadow-sm); }
@media (max-width: 760px) {
  .mobile-only { display: inline-flex; }
  .discover-switch.mobile-only { display: flex; }
  .sidebar { display: none !important; }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: 0.25rem 0.3rem calc(0.25rem + env(safe-area-inset-bottom));
    background: rgba(11, 61, 47, 0.92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-top: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.12);
  }
  .bottom-nav button {
    position: relative; flex: 1 1 0; min-width: 0; min-height: 54px; flex-direction: column; gap: 0.15rem; padding: 0.3rem 0.1rem;
    background: transparent; border: none; color: rgba(255, 255, 255, 0.66); font-size: 0.66rem; font-weight: 600; border-radius: 12px;
  }
  .bottom-nav button .tab-icon { width: 22px; height: 22px; transition: transform 0.2s var(--ease); }
  .bottom-nav button[aria-current="true"] { color: #fff; }
  .bottom-nav button[aria-current="true"] .tab-icon { transform: translateY(-1px) scale(1.08); color: var(--gold); }
  .bottom-nav button[aria-current="true"]::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold); }
  body[data-tab="messages"][data-chat-view="thread"] .bottom-nav { display: none; }
  body[data-tab="feed"] { overscroll-behavior-y: contain; }
}
.ptr { height: 0; overflow: hidden; display: grid; place-items: center; transition: height 0.25s var(--ease); }
.ptr.pulling { transition: none; }
.ptr svg { width: 48px; height: 32px; transform: translateY(calc((1 - var(--pull, 0)) * 14px)) scale(calc(0.6 + var(--pull, 0) * 0.4)); transition: transform 0.2s var(--ease); }
.ptr-far { fill: var(--brand-500); opacity: 0.45; }
.ptr-near { fill: var(--brand-600); }
.ptr-sun { fill: var(--gold); transform-origin: 38px 7px; transform: translateY(calc((1 - var(--pull, 0)) * 16px)); }
.ptr.armed svg { transform: scale(1.08); }
.ptr.refreshing .ptr-sun { animation: ptr-sun 0.9s ease-in-out infinite alternate; }
.ptr.refreshing .ptr-near { animation: ptr-hill 0.9s ease-in-out infinite alternate; }
@keyframes ptr-sun { from { transform: translateY(6px); opacity: 0.6; } to { transform: translateY(-3px); opacity: 1; } }
@keyframes ptr-hill { from { transform: translateY(1px); } to { transform: translateY(-1px); } }

.heart-burst { filter: drop-shadow(0 8px 22px rgba(201, 24, 74, 0.5)); animation: heart-float 1.15s var(--ease) forwards; }
.heart-burst svg { fill: none; stroke: none; }
.heart-burst i { position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px; border-radius: 50%; background: #ff8fa3; transform: rotate(var(--a)) translateY(0); animation: heart-spark 0.7s ease-out forwards; }
.heart-burst i:nth-child(odd) { background: #c59a3d; }
@keyframes heart-float { 0% { opacity: 0; transform: scale(0.3); } 22% { opacity: 1; transform: scale(1.15); } 40% { transform: scale(0.95); } 60% { opacity: 1; transform: scale(1) translateY(-10px); } 100% { opacity: 0; transform: scale(0.9) translateY(-90px); } }
@keyframes heart-spark { 0% { opacity: 0; transform: rotate(var(--a)) translateY(0) scale(0.4); } 30% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--a)) translateY(-62px) scale(1); } }

.photo-viewer { touch-action: none; transition: background-color 0.15s ease; }
.photo-viewer img { will-change: transform; transform-origin: center; }

/* ---------- Reactions, Save, search, trending ---------- */
.react-wrap { position: relative; display: inline-flex; align-items: center; }
.react-emoji { font-size: 1.05rem; line-height: 1; }
.like-btn.liked { color: var(--text); }
.like-btn.pop .react-emoji { display: inline-block; animation: heart-pop 0.45s var(--ease); }
.react-top { font-size: 0.8rem; letter-spacing: -0.2em; margin-left: -0.15rem; padding-right: 0.3rem; pointer-events: none; }
.react-bar {
  position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 30; display: flex; gap: 0.15rem; padding: 0.3rem 0.4rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(6px) scale(0.9); transform-origin: bottom left; pointer-events: none; transition: opacity 0.15s ease, transform 0.18s var(--ease);
}
.react-bar button { min-height: 40px; width: 40px; padding: 0; background: transparent; border: none; border-radius: 50%; font-size: 1.45rem; transition: transform 0.15s var(--ease); }
.react-bar button:hover, .react-bar button:focus-visible { background: var(--surface-2); transform: translateY(-4px) scale(1.25); }
.react-bar button.on { background: var(--brand-100); }
.react-wrap.open .react-bar, .react-wrap:focus-within .react-bar { opacity: 1; transform: none; pointer-events: auto; }
@media (hover: hover) { .react-wrap:hover .react-bar { opacity: 1; transform: none; pointer-events: auto; transition-delay: 0.35s; } }
.save-btn.saved { color: var(--gold) !important; }
.save-btn.saved svg { fill: currentColor; }

.feed-search { position: relative; margin: 0.2rem 0 0.7rem; }
.feed-search > .icon { position: absolute; left: 0.95rem; top: 50%; transform: translateY(-50%); color: var(--text-dim); pointer-events: none; }
.feed-search input { padding-left: 2.5rem; padding-right: 2.6rem; border-radius: 999px; background: var(--surface); min-height: 44px; }
.feed-search .close-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; min-height: 34px; padding: 0; border-radius: 50%; }
.trending { display: flex; gap: 0.4rem; overflow-x: auto; align-items: center; margin: 0 0 0.7rem; padding-bottom: 2px; scrollbar-width: none; }
.trending::-webkit-scrollbar { display: none; }
.trending-label { flex-shrink: 0; font-size: 0.75rem; font-weight: 700; color: var(--text-dim); padding-right: 0.2rem; }
.trending button { flex-shrink: 0; min-height: 32px; padding: 0.25rem 0.75rem; border-radius: 999px; font-size: 0.8rem; font-weight: 650; background: var(--gold-soft); color: var(--warning); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); }
.trending button small { margin-left: 0.3rem; opacity: 0.7; font-weight: 600; }
.trending button[aria-pressed="true"] { background: var(--gold); color: #1c1606; }
.post-kind.k-lostfound { background: var(--info-bg); color: var(--cat-support); }
.post-kind.k-lostfound.t-found { background: var(--success-bg); color: var(--success); }
.hashtag { display: inline; min-height: 0; padding: 0; border: none; background: none; color: var(--accent-strong); font: inherit; font-weight: 650; unicode-bidi: isolate; }
.hashtag:hover { background: none; text-decoration: underline; }

/* ---------- Notification bell ---------- */
.bell-btn { position: relative; width: 40px; padding: 0; }
.bell-btn .icon svg { width: 1.3em; height: 1.3em; }
.bell-btn.ring .icon { animation: bell-ring 0.9s ease; transform-origin: 50% 10%; }
@keyframes bell-ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(16deg); } 30% { transform: rotate(-14deg); } 45% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } 75% { transform: rotate(3deg); } }
.bell-badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #e0434f; color: #fff; font-size: 0.66rem; font-weight: 800; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.bell-panel {
  position: fixed; top: 64px; right: max(1rem, calc((100vw - 1200px) / 2)); z-index: 1200; width: min(400px, calc(100vw - 1.5rem));
  max-height: min(70vh, 560px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); animation: reveal 0.18s var(--ease);
}
.bell-head { display: flex; align-items: center; justify-content: space-between; padding: 0.8rem 1rem 0.5rem; }
.bell-list { overflow-y: auto; padding: 0 0.4rem 0.5rem; }
.notice { width: 100%; display: flex; align-items: flex-start; gap: 0.65rem; padding: 0.6rem; background: transparent; color: var(--text); border: none; border-radius: var(--radius); text-align: left; white-space: normal; font-weight: 400; }
.notice:hover { background: var(--surface-2); }
.notice.unread { background: var(--brand-50); }
.notice .avatar { width: 40px; height: 40px; flex-shrink: 0; }
.notice-body { display: grid; gap: 0.15rem; min-width: 0; font-size: 0.88rem; }
.notice-quote { color: var(--text-2); font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notice-body small { color: var(--text-dim); font-size: 0.74rem; }
.card.post.flash { animation: post-flash 1.6s ease; }
@keyframes post-flash { 0%, 40% { box-shadow: 0 0 0 3px var(--gold); } 100% { box-shadow: var(--shadow-sm); } }
@media (max-width: 760px) {
  .bell-panel { top: calc(58px + env(safe-area-inset-top)); left: 0.75rem; right: 0.75rem; width: auto; max-height: calc(100vh - 150px); }
  .page-header .bell-btn { background: rgba(255, 255, 255, 0.12); color: #fff; }
  .bell-badge { box-shadow: 0 0 0 2px var(--brand-700); }
  #main-mobile-btn span:last-child { display: none; }
}
@media (max-width: 760px) {
  .page-header .bell-btn:hover, .page-header .bell-btn[aria-expanded="true"] { background: rgba(255, 255, 255, 0.24); color: #fff; }
}

/* ---------- Polls ---------- */
.poll-editor { display: grid; gap: 0.45rem; margin: 0.5rem 0 0.2rem 3.4rem; }
.poll-editor input { min-height: 40px; border-radius: 10px; }
.poll-editor .linklike { justify-self: start; }
.poll { display: grid; gap: 0.45rem; margin: 0.3rem 0 0.5rem; }
.poll-opt {
  position: relative; overflow: hidden; justify-content: space-between; min-height: 44px; padding: 0.55rem 0.9rem; border-radius: 12px;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border); font-weight: 600; white-space: normal; text-align: left;
}
.poll-opt:hover { background: var(--surface-3); border-color: var(--brand-500); }
.poll-fill { position: absolute; inset: 0 auto 0 0; width: var(--pct); background: color-mix(in srgb, var(--brand-500) 18%, transparent); transition: width 0.6s var(--ease); }
.poll-opt.mine { border-color: var(--brand-500); }
.poll-opt.mine .poll-fill { background: color-mix(in srgb, var(--brand-500) 30%, transparent); }
.poll-text, .poll-pct { position: relative; }
.poll-pct { font-variant-numeric: tabular-nums; color: var(--accent-strong); }
.poll-meta { font-size: 0.78rem; color: var(--text-dim); }
.post-kind.k-poll { background: var(--brand-100); color: var(--brand-600); }
@media (max-width: 760px) { .poll-editor { margin-left: 0; } }

/* ---------- Daily Campus Pulse & streaks ---------- */
.pulse-card {
  position: relative; overflow: hidden; border: none; color: #fff; padding: 1.1rem 1.2rem 1rem;
  background: radial-gradient(420px 200px at 100% 0%, rgba(245, 196, 92, 0.45), transparent 65%), linear-gradient(135deg, var(--brand-600), var(--brand-800));
}
.pulse-card h2 { color: #fff; font-size: 1.2rem; line-height: 1.35; margin: 0.35rem 0 0.8rem; }
.pulse-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.pulse-eyebrow { font-size: 0.74rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #f6dca0; }
.pulse-count { font-size: 0.76rem; color: rgba(255, 255, 255, 0.75); }
.pulse-form { display: flex; gap: 0.4rem; }
.pulse-form input { border-radius: 999px; background: rgba(255, 255, 255, 0.95); color: #16211d; border-color: transparent; min-height: 42px; }
.pulse-form button { background: var(--gold); color: #1c1606; border-radius: 999px; min-height: 42px; }
.pulse-mine { background: rgba(255, 255, 255, 0.12); border-radius: 12px; padding: 0.55rem 0.8rem; font-size: 0.92rem; }
.pulse-mine span { display: block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #f6dca0; }
.pulse-mine .linklike, .pulse-card > .linklike { color: #f6dca0; }
.pulse-answers { display: grid; gap: 0.5rem; margin: 0.8rem 0 0.3rem; }
.pulse-answer { display: flex; gap: 0.55rem; align-items: flex-start; }
.pulse-answer .avatar { width: 30px; height: 30px; font-size: 0.7rem; border-color: rgba(255, 255, 255, 0.3); }
.pulse-answer strong { font-size: 0.8rem; color: #fff; }
.pulse-answer p { font-size: 0.88rem; color: rgba(255, 255, 255, 0.9); word-break: break-word; }
.pulse-foot { font-size: 0.72rem; color: rgba(255, 255, 255, 0.6); margin-top: 0.5rem; }
.streak-chip { display: inline-flex; align-items: center; gap: 0.2rem; min-height: 32px; padding: 0 0.6rem; border-radius: 999px; background: var(--gold-soft); color: var(--warning); font-size: 0.85rem; animation: reveal 0.3s var(--ease); }
.streak-chip b { font-weight: 800; }
.pf-streak { margin-top: 0.35rem; font-size: 0.88rem; color: var(--warning); }
@media (max-width: 760px) { .page-header .streak-chip { background: rgba(255, 255, 255, 0.14); color: #ffe2a0; } }
@media (max-width: 760px) { #main-mobile-btn { display: none; } }

/* ---------- Chat: kept messages, typing, online ---------- */
.bubble-meta .kept { color: var(--gold); margin-right: 0.25rem; font-size: 0.8rem; }
.peer-avatar { position: relative; display: inline-flex; }
.peer-avatar.is-online::after { content: ""; position: absolute; right: 1px; bottom: 1px; width: 11px; height: 11px; border-radius: 50%; background: #2fbf71; box-shadow: 0 0 0 2px var(--surface); }
.peer-online { color: #2fbf71 !important; font-weight: 600; }
.peer-typing { color: var(--accent-strong) !important; font-weight: 600; font-style: italic; }
.typing-dots { display: inline-flex; gap: 2px; margin-left: 3px; }
.typing-dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; animation: typing-dot 1.2s infinite ease-in-out; }
.typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.typing-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-dot { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* ---------- Voice notes ---------- */
.mic-btn { background: var(--primary); }
.voice-note { display: flex; align-items: center; gap: 0.55rem; min-width: min(240px, 62vw); padding: 0.2rem 0.1rem; }
.voice-play { width: 38px; min-height: 38px; padding: 0; border-radius: 50%; flex-shrink: 0; background: var(--primary); color: #fff; }
.voice-play svg { width: 16px; height: 16px; }
.voice-play.loading { opacity: 0.6; animation: pulse-soft 1s ease-in-out infinite; }
@keyframes pulse-soft { 50% { opacity: 0.3; } }
.voice-wave { flex: 1; display: flex; align-items: center; gap: 2px; height: 30px; }
.voice-wave i { flex: 1; height: var(--h); min-height: 3px; border-radius: 2px; background: color-mix(in srgb, var(--text-dim) 50%, transparent); transition: background 0.15s; }
.voice-wave i.on { background: var(--accent-strong); }
.voice-time { font-size: 0.75rem; color: var(--text-dim); font-variant-numeric: tabular-nums; min-width: 2.4em; }
.voice-rec { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.7rem calc(0.5rem + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #e0434f; animation: pulse-soft 1s ease-in-out infinite; }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 2.6em; }
.rec-wave { flex: 1; display: flex; align-items: center; gap: 2px; height: 30px; overflow: hidden; justify-content: flex-end; }
.rec-wave i { width: 3px; flex-shrink: 0; height: var(--h); border-radius: 2px; background: var(--accent-strong); }

/* ---------- Anonymous posts & verified badges ---------- */
.anon-toggle { margin: 0.6rem 0 0 3.4rem; font-size: 0.84rem; color: var(--text-2); }
.anon-avatar { background: linear-gradient(135deg, #5b6b64, #3d4b45) !important; font-size: 1.2rem; }
.post-kind.k-anon { background: var(--surface-3); color: var(--text-2); text-transform: none; letter-spacing: 0; }
.vbadge { display: inline-flex; align-items: center; gap: 0.2rem; margin-left: 0.35rem; padding: 0.05rem 0.45rem; border-radius: 999px; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.02em; vertical-align: 0.1em; white-space: nowrap; }
.vb-CR, .vb-GR { background: #e3effd; color: #1f5fae; }
.vb-FACULTY { background: #f3e8fd; color: #6d3fa8; }
.vb-HOD { background: #fdf0d5; color: #93620a; }
.vb-SOCIETY { background: #dff5e9; color: #1b7a4b; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .vb-CR, :root:not([data-theme="light"]) .vb-GR { background: #16293f; color: #8fbcf2; }
  :root:not([data-theme="light"]) .vb-FACULTY { background: #2a1d3a; color: #c9a6f2; }
  :root:not([data-theme="light"]) .vb-HOD { background: #33280f; color: #f0c56a; }
  :root:not([data-theme="light"]) .vb-SOCIETY { background: #12301f; color: #7fd9a8; }
}
.mv-card h2 .vbadge { font-size: 0.75rem; }
.vtick { display: inline-grid; place-items: center; width: 1.05em; height: 1.05em; margin-left: 0.3rem; border-radius: 50%; background: var(--brand-600, #13624a); color: #fff; font-size: 0.7em; font-weight: 900; line-height: 1; vertical-align: 0.1em; }
@media (max-width: 760px) { .anon-toggle { margin-left: 0; } }

/* ---------- Campus: events & point bus ---------- */
.campus-switch { display: flex; gap: 0.3rem; background: var(--surface-3); padding: 4px; border-radius: 999px; margin-bottom: 1rem; max-width: 520px; }
.campus-switch button { flex: 1; min-height: 38px; border-radius: 999px; background: transparent; color: var(--text-2); border: none; font-size: 0.85rem; }
.campus-switch button[aria-selected="true"] { background: var(--surface); color: var(--accent-strong); box-shadow: var(--shadow-sm); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 1rem; }
.ev-form { margin-bottom: 1rem; }
.ev-group { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin: 1.1rem 0 0.5rem; }
.ev-card { display: flex; gap: 0.9rem; align-items: flex-start; margin-bottom: 0.7rem; }
.ev-date { flex-shrink: 0; width: 56px; text-align: center; border-radius: 12px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.ev-date b { display: block; font-size: 1.4rem; padding: 0.3rem 0 0.1rem; }
.ev-date span { display: block; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; background: var(--primary); color: #fff; padding: 0.15rem 0; }
.ev-body { min-width: 0; flex: 1; }
.ev-cat { font-size: 0.72rem; font-weight: 700; color: var(--accent-strong); }
.ev-body h3 { margin: 0.15rem 0 0.25rem; }
.ev-meta { font-size: 0.84rem; color: var(--text-2); }
.ev-details { font-size: 0.88rem; margin-top: 0.35rem; white-space: pre-wrap; word-break: break-word; }
.ev-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.6rem; }
.bus-search { padding: 0 0 0.8rem; max-width: 420px; }
.bus-search .icon { left: 0.8rem; }
.bus-card header { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.bus-next { font-size: 0.85rem; background: var(--success-bg); color: var(--success); padding: 0.25rem 0.7rem; border-radius: 999px; }
.bus-next.done { background: var(--surface-2); color: var(--text-dim); }
.bus-row { display: flex; gap: 0.7rem; align-items: baseline; margin: 0.3rem 0; }
.bus-label { width: 92px; flex-shrink: 0; font-size: 0.75rem; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; }
.bus-times { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.bus-time { font-size: 0.82rem; font-weight: 650; padding: 0.15rem 0.55rem; border-radius: 8px; background: var(--brand-100); color: var(--brand-600); font-variant-numeric: tabular-nums; }
.bus-time.gone { opacity: 0.4; text-decoration: line-through; }
.bus-stops { margin-top: 0.5rem; }
.bus-stops summary { cursor: pointer; font-size: 0.84rem; font-weight: 600; color: var(--accent-strong); }
.bus-stops ol { list-style: none; margin: 0.5rem 0 0; padding: 0 0 0 0.9rem; border-left: 2px dashed var(--brand-500); }
.bus-stops li { position: relative; padding: 0.2rem 0 0.2rem 0.6rem; font-size: 0.86rem; }
.bus-stops li::before { content: ""; position: absolute; left: -1.28rem; top: 0.55rem; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand-500); }
.bus-stops li.hit { font-weight: 700; color: var(--accent-strong); }
.bus-stops li:last-child::before { background: var(--brand-500); }

/* Evening sheet (read from the Transport Unit's photo) */
.bus-ev-head { display: grid; gap: 0.35rem; }
.bus-ev-head h3 { margin: 0; font-size: 1.15rem; }
.bus-ev-head .alert { margin: 0.3rem 0 0; }
.bus-ev-eyebrow { font-size: 0.74rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-strong); }
.bus-notice { font-size: 0.84rem; background: var(--warning-bg); color: var(--warning); border-radius: var(--radius-sm); padding: 0.45rem 0.7rem; margin: 0.2rem 0; }
.bus-mystop { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.88rem; font-weight: 650; }
.bus-mystop select { width: auto; min-width: 0; flex: 1 1 180px; max-width: 280px; }
.bus-ev-list { padding: 0.4rem 1rem 0.8rem; }
.bus-group h4 { margin: 0.9rem 0 0.35rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); display: flex; justify-content: space-between; gap: 0.5rem; }
.bus-ur { text-transform: none; letter-spacing: 0; font-weight: 600; }
.bus-ev-row { display: flex; justify-content: space-between; align-items: center; gap: 0.7rem; padding: 0.5rem 0; border-top: 1px solid var(--border); }
.bus-ev-row.mine { background: var(--brand-100); margin: 0 -0.6rem; padding: 0.5rem 0.6rem; border-radius: var(--radius-sm); border-top-color: transparent; }
.bus-ev-stops { font-size: 0.9rem; line-height: 1.4; min-width: 0; }
.bus-ev-stops .hit { font-weight: 750; color: var(--accent-strong); }
.bus-moved { display: block; font-size: 0.76rem; color: var(--warning); font-weight: 650; }
.bus-ev-buses { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.3rem; flex-shrink: 0; max-width: 55%; }
.bus-chip { min-width: 2.1rem; text-align: center; font-weight: 800; font-size: 0.92rem; padding: 0.2rem 0.5rem; border-radius: 8px; background: var(--brand-600); color: #fff; font-variant-numeric: tabular-nums; }
.bus-chip.unsure { background: var(--warning-bg); color: var(--warning); border: 1px dashed var(--warning); }
.bus-unclear { font-size: 0.74rem; color: var(--warning); font-weight: 650; align-self: center; }
.bus-other-head { margin-top: 1.4rem; }
.bus-other-head h3 { margin: 0; }
.bus-admin-card { border: 1px dashed var(--border-strong); display: grid; gap: 0.5rem; }
.bus-admin-top { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.file-btn { display: inline-flex; align-items: center; gap: 0.3rem; cursor: pointer; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 0.35rem 0.8rem; font-weight: 650; font-size: 0.85rem; background: var(--surface); }
.bus-status { font-size: 0.9rem; margin: 0; }
.bus-status .spinner { display: inline-block; vertical-align: -2px; margin-right: 0.3rem; }
.bus-time-form { display: flex; align-items: flex-end; gap: 0.5rem; flex-wrap: wrap; }
.bus-time-form label { display: grid; gap: 0.2rem; font-size: 0.8rem; font-weight: 700; }
.bus-time-form input { width: auto; }
.bus-review summary { cursor: pointer; font-weight: 700; color: var(--accent-strong); }
.bus-review-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 0.8rem; margin-top: 0.6rem; align-items: start; }
.bus-review-photo img { width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border); position: sticky; top: 0.5rem; }
.bus-rev-row { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) 6.5rem 8rem; gap: 0.35rem; align-items: center; padding: 0.2rem 0.3rem; border-radius: 6px; font-size: 0.8rem; }
.bus-rev-row input, .bus-rev-row select { min-height: 32px; padding: 0.2rem 0.4rem; font-size: 0.85rem; }
.bus-rev-row.s-unclear { background: var(--warning-bg); }
.bus-rev-row.extra { grid-template-columns: minmax(0, 1fr) 8rem; }
.bus-rev-n { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.bus-rev-stops em { color: var(--warning); font-style: normal; }
.bus-rev-sub { font-weight: 700; font-size: 0.8rem; margin: 0.6rem 0 0.2rem; }
@media (max-width: 760px) {
  .bus-review-grid { grid-template-columns: 1fr; }
  .bus-review-photo img { position: static; }
  .bus-rev-row { grid-template-columns: 1.4rem minmax(0, 1fr) 5.5rem; }
  .bus-rev-row select { grid-column: 2 / -1; }
  .bus-ev-buses { max-width: 50%; }
}

/* Feed: "Your bus" line */
.mybus-card { display: flex; align-items: center; gap: 0.6rem; width: 100%; text-align: left; font: inherit; color: var(--text); cursor: pointer; padding: 0.7rem 1rem; min-height: 0; }
.mybus-card:hover { background: var(--surface-2); }
.mybus-icon { font-size: 1.3rem; }
.mybus-text { flex: 1; font-size: 0.92rem; }
.mybus-go { font-size: 1.3rem; color: var(--text-dim); }

/* ---------- Today's 5 (daily department quiz) ---------- */
.quiz-card { display: grid; gap: 0.55rem; border-top: 3px solid var(--gold); }
.quiz-card.compact { gap: 0.2rem; }
.quiz-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.quiz-eyebrow { font-size: 0.74rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--warning); }
.quiz-dots { display: inline-flex; align-items: center; gap: 0.5rem; padding-right: 3px; }
.quiz-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); transition: transform 0.2s var(--ease); }
.quiz-dot.right { background: var(--success); }
.quiz-dot.wrong { background: var(--danger); }
.quiz-dot.on { transform: scale(1.3); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--text-dim); }
.quiz-meta { margin: 0; font-size: 0.76rem; color: var(--text-dim); font-weight: 650; }
.quiz-stem { margin: 0; font-size: 1.02rem; line-height: 1.45; white-space: pre-line; }
.quiz-opts { display: grid; gap: 0.45rem; }
.quiz-opt { display: flex; align-items: center; gap: 0.6rem; width: 100%; text-align: left; justify-content: flex-start; background: var(--surface); color: var(--text); border: 1.5px solid var(--border-strong); border-radius: var(--radius); padding: 0.55rem 0.75rem; min-height: 46px; font-weight: 550; transition: background 0.15s, border-color 0.15s, opacity 0.15s; }
.quiz-opt:hover:not([aria-disabled]) { border-color: var(--accent-strong); background: var(--surface-2); }
.quiz-opt[aria-disabled] { cursor: default; }
.quiz-opt.pending { border-color: var(--accent-strong); opacity: 0.7; }
.quiz-letter { flex-shrink: 0; width: 1.7rem; height: 1.7rem; border-radius: 50%; display: grid; place-items: center; font-size: 0.8rem; font-weight: 800; background: var(--surface-2); }
.quiz-text { flex: 1; min-width: 0; word-break: break-word; }
.quiz-mark { font-weight: 900; font-size: 1.1rem; }
.quiz-opt.right { background: var(--success-bg); border-color: var(--success); color: var(--success); animation: reveal 0.25s var(--ease); }
.quiz-opt.right .quiz-letter { background: var(--success); color: #fff; }
.quiz-opt.wrong { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); animation: shake 0.3s; }
.quiz-opt.wrong .quiz-letter { background: var(--danger); color: #fff; }
.quiz-opt.dim { opacity: 0.55; }
.quiz-result { font-weight: 800; font-size: 0.95rem; }
.quiz-result.right { color: var(--success); }
.quiz-result.wrong { color: var(--danger); }
.quiz-explain { background: var(--surface-2); border-radius: var(--radius); padding: 0.7rem 0.85rem; display: grid; gap: 0.45rem; font-size: 0.9rem; line-height: 1.5; animation: reveal 0.3s var(--ease); }
.quiz-explain p { margin: 0; }
.quiz-dyk { color: var(--text); }
.quiz-rate, .quiz-src { font-size: 0.78rem; color: var(--text-dim); }
.quiz-nav { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.quiz-left { font-size: 0.78rem; color: var(--text-dim); }
.quiz-summary { margin: 0; font-size: 0.9rem; }
.campus-switch button { white-space: nowrap; padding: 0 0.4rem; }

/* ---------- Buddy pairing ---------- */
.buddy-consent { margin: -0.2rem 0 1rem; font-size: 0.86rem; padding: 0.7rem 0.8rem; border-radius: var(--radius); background: var(--brand-50); border: 1px solid var(--brand-100); }
.buddy-card { border-top: 3px solid var(--gold); }
.buddy-label { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-dim); margin: 0.4rem 0; }
.buddy-person { display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem; border-radius: var(--radius); background: var(--surface-2); margin-bottom: 0.5rem; flex-wrap: wrap; }
.buddy-who { flex: 1; min-width: 150px; display: grid; }
.buddy-who small { color: var(--text-dim); font-size: 0.78rem; }
.buddy-reason { font-size: 0.78rem; color: var(--accent-strong); font-weight: 600; }
.buddy-actions { display: flex; align-items: center; gap: 0.5rem; }

/* ---------- Course Vault ---------- */
.vault-editor, .vault-filters { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.vault-editor { margin: 0.5rem 0 0.2rem 3.4rem; }
.vault-editor select, .vault-editor input, .vault-filters select, .vault-filters input { width: auto; min-height: 36px; padding: 0.3rem 0.6rem; font-size: 0.84rem; border-radius: 10px; flex: 1 1 140px; }
.vault-filters { margin: -0.3rem 0 1rem; padding: 0.7rem; border-radius: var(--radius); background: var(--brand-50); border: 1px solid var(--brand-100); }
.vault-title { flex-basis: 100%; font-size: 0.85rem; color: var(--accent-strong); }
.course-line { font-size: 0.82rem; color: var(--text-2); background: var(--surface-2); border-radius: 8px; padding: 0.3rem 0.6rem; margin: 0.1rem 0 0.5rem; display: inline-block; }
@media (max-width: 760px) { .vault-editor { margin-left: 0; } }
.upload-label { font-size: 0.78rem; color: var(--text-dim); margin: 0.3rem 0 0; font-variant-numeric: tabular-nums; }
.vault-cta { margin: 0.9rem auto 0; }

/* ---------- Round 2: habit loops ---------- */
.spring-pop { animation: spring-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes spring-pop { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
.streak-card { display: flex; align-items: center; gap: 0.7rem; padding: 0.75rem 1rem; margin-bottom: 1rem; border-radius: var(--radius-lg); background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); font-size: 0.9rem; }
.streak-card > span:nth-child(2) { flex: 1; }
.streak-card strong { display: block; }
.streak-flame { font-size: 1.6rem; display: inline-block; }
.streak-card.done { background: var(--success-bg); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.streak-card.urgent { background: #fff1d6; border-color: #f0a830; animation: streak-pulse 1.6s ease-in-out infinite; }
.streak-card.urgent .streak-flame { animation: flicker 0.9s ease-in-out infinite alternate; }
.streak-card button { background: var(--gold); color: #1c1606; }
@keyframes streak-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(240, 168, 48, 0.45); } 50% { box-shadow: 0 0 0 8px rgba(240, 168, 48, 0); } }
@keyframes flicker { from { transform: scale(1) rotate(-4deg); } to { transform: scale(1.12) rotate(4deg); } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .streak-card.urgent { background: #33250c; } }
.confetti { position: fixed; left: 50%; top: 45%; z-index: 3000; pointer-events: none; }
.confetti i { position: absolute; width: 8px; height: 12px; border-radius: 2px; opacity: 0; }
.confetti.go i { animation: confetti 1.5s cubic-bezier(0.2, 0.7, 0.3, 1) var(--d) forwards; }
@keyframes confetti { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--x), calc(var(--y) + 420px)) rotate(var(--r)); } }
.notice-toast {
  position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 2500;
  display: flex; align-items: center; gap: 0.6rem; max-width: min(92vw, 440px); padding: 0.5rem 1rem 0.5rem 0.5rem; border-radius: 999px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-weight: 400; font-size: 0.86rem;
  white-space: normal; text-align: left; animation: notice-drop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.notice-toast:hover { background: var(--surface-2); }
.notice-toast .avatar { width: 34px; height: 34px; flex-shrink: 0; }
.notice-toast-icon { font-size: 1.3rem; padding-left: 0.4rem; }
.notice-toast.leaving { transition: opacity 0.3s, transform 0.3s; opacity: 0; transform: translate(-50%, -20px); }
@keyframes notice-drop { from { opacity: 0; transform: translate(-50%, -30px); } to { opacity: 1; transform: translate(-50%, 0); } }
.active-filter { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin: -0.2rem 0 0.8rem; padding: 0.45rem 0.5rem 0.45rem 0.9rem; border-radius: 999px; background: var(--brand-100); color: var(--brand-600); font-size: 0.85rem; font-weight: 650; }
.active-now { display: flex; align-items: center; gap: 0.45rem; font-size: 0.84rem; color: var(--text-2); margin: 0 0 0.8rem 0.2rem; }
.active-now i { width: 9px; height: 9px; border-radius: 50%; background: #2fbf71; box-shadow: 0 0 0 0 rgba(47, 191, 113, 0.6); animation: live-dot 2s infinite; }
@keyframes live-dot { 70% { box-shadow: 0 0 0 7px rgba(47, 191, 113, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 191, 113, 0); } }

/* ---------- Round 2: comfort ---------- */
.kind-tip { font-size: 0.86rem; margin-top: 0.6rem; padding: 0.6rem 0.8rem; border-radius: var(--radius); background: var(--brand-50); color: var(--text-2); text-align: left; }
.voice-preview { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.7rem calc(0.5rem + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); }
.vp-note { flex: 1; min-width: 0; background: var(--bubble-mine); border-radius: 14px; padding: 0.2rem 0.5rem; }
.vp-trash { color: #d0433b !important; }
.vp-send { background: #1f9a5a; }
.chat-waiting { margin: 0 0.8rem 0.4rem; padding: 0.55rem 0.9rem; border-radius: 12px; background: var(--gold-soft); color: var(--warning); font-size: 0.86rem; font-weight: 600; text-align: center; }
.thanks-btn.on { color: var(--gold) !important; }
.thanks-count { font-size: 0.8rem; color: var(--text-dim); font-weight: 600; padding: 0 0.4rem; }
.mv-bio { white-space: pre-line; }

/* ---------- Round 2: network & voice scrubbing ---------- */
.voice-wave { cursor: pointer; touch-action: pan-y; }
.offline-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 2600; display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: calc(0.35rem + env(safe-area-inset-top)) 1rem 0.35rem; background: #5b4a1f; color: #fff4d6; font-size: 0.82rem; font-weight: 600; }
.offline-bar .spinner { width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }

/* ---------- Feedback history (replies from the team) ---------- */
.fb-history { margin-top: 1.1rem; border-top: 1px solid var(--border); padding-top: 0.9rem; max-height: 260px; overflow-y: auto; }
.fb-history h4 { font-size: 0.85rem; margin: 0 0 0.5rem; color: var(--text-2); }
.fb-past { padding: 0.55rem 0.7rem; border-radius: var(--radius); background: var(--surface-2); margin-bottom: 0.45rem; font-size: 0.86rem; }
.fb-past p { margin-top: 0.25rem; word-break: break-word; }
.fb-past-top { display: flex; justify-content: space-between; align-items: center; }
.fb-past-top small { color: var(--text-dim); }
.fb-past-status { font-size: 0.72rem; font-weight: 800; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--surface-3); color: var(--text-2); }
.fb-past-status.s-fixed { background: var(--success-bg); color: var(--success); }
.fb-past-status.s-planned, .fb-past-status.s-seen { background: var(--info-bg); color: var(--cat-support); }
.fb-reply { padding: 0.4rem 0.6rem; border-left: 3px solid var(--brand-500); background: var(--brand-50); border-radius: 0 8px 8px 0; }

/* ---------- Calm feed: less at first, more on tap ---------- */
.composer.collapsed { padding: 0.7rem 0.9rem; }
.composer.collapsed .composer-top textarea { height: 44px !important; min-height: 44px; padding-top: 0.6rem; overflow: hidden; resize: none; cursor: text; border-radius: 999px; background: var(--surface-2); padding-left: 1rem; }
.composer.collapsed .composer-bar, .composer.collapsed .topic-picker, .composer.collapsed .poll-editor, .composer.collapsed .vault-editor,
.composer.collapsed .anon-toggle, .composer.collapsed .composer-guide, .composer.collapsed #composer-title,
.composer.collapsed #composer-photo-row, .composer.collapsed #composer-media-row { display: none !important; }
.composer.collapsed .composer-top { align-items: center; }
.composer-open { display: none; }
.composer.collapsed .composer-open { display: inline-flex; align-items: center; gap: 0.35rem; flex-shrink: 0; height: 44px; padding: 0 1.15rem; border-radius: 999px; font-weight: 700; box-shadow: var(--shadow-sm, 0 2px 6px rgba(0, 0, 0, 0.12)); }
.search-toggle { flex-shrink: 0; width: 38px; padding: 0 !important; }
.search-toggle.on { background: var(--brand-100) !important; color: var(--brand-600) !important; border-color: var(--brand-500) !important; }
.search-toggle .icon svg { width: 16px; height: 16px; }
.filter-row:not(.show-extra) .extra:not([aria-pressed="true"]) { display: none; }
.more-filters { flex-shrink: 0; color: var(--accent-strong) !important; }
.search-panel { animation: reveal 0.18s var(--ease); }
.pulse-card { padding: 0.95rem 1.1rem; }
.pulse-card h2 { font-size: 1.08rem; margin: 0.3rem 0 0.7rem; }
.pulse-actions { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.pulse-answer-btn { background: var(--gold); color: #1c1606; border-radius: 999px; padding-inline: 1.1rem; }
.pulse-actions .linklike { color: #f6dca0; }
.pulse-form { margin-bottom: 0.6rem; }
.pulse-mine { margin-bottom: 0.6rem; }
@media (max-width: 760px) {
  .post-actions .lbl, .thanks-btn > span:first-of-type { display: none; }
  .post-actions { gap: 0; }
  .composer.collapsed .composer-top textarea { white-space: nowrap; }
}

/* ---------- Phones: everything fits the screen ----------
   One thing wider than the screen (a long name, a link that can't wrap) made phones
   zoom the whole page out or slide sideways, so the app looked oddly spread. */
@media (max-width: 760px) {
  .main { overflow-x: clip; } /* last guard: a stray long word never widens the page */
  .tab-panel { min-width: 0; }
  .grid, .people-grid { grid-template-columns: minmax(0, 1fr); }
  .grid > *, .people-grid > * { min-width: 0; }
  .linklike, .name-link { white-space: normal; text-align: left; overflow-wrap: anywhere; }
  .results-head { flex-wrap: wrap; gap: 0.15rem 1rem; }
  .page-header { gap: 0.6rem; }
  .page-header h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* one line: the bar keeps its height */
  .header-actions { flex-shrink: 0; }
  /* Messages ("Press back again to exit", "Saved") sit above the bottom bar, inside the screen. */
  .toast-host { left: 0.75rem; right: 0.75rem; bottom: calc(76px + env(safe-area-inset-bottom)); justify-items: center; }
  .toast { max-width: 100%; }
  .content { padding: 0.85rem 0.75rem 2rem; }
  .post-text, .comment .bubble p, .tag { overflow-wrap: anywhere; }
  /* Profile: photo on top, then name and settings, buttons full width. */
  .profile-hero { justify-content: center; gap: 0.9rem; }
  .profile-hero > div { flex: 1 1 100% !important; min-width: 0 !important; }
  .profile-hero > div > button { width: 100%; white-space: normal; }
  .profile-hero .hint { max-width: none !important; }
}
