:root {
  --bg: #f0f2f5;
  --surface: #ffffff;
  --text: #1c1e21;
  --muted: #65676b;
  --border: #e4e6eb;
  --primary: #5b5bd6;
  --primary-hover: #4a4ac4;
  --like: #e0245e;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  --topbar-h: 60px;
  /* Tints used for hover, selection and notices */
  --tint: #ececfb;
  --tint-soft: #f7f7fe;
  --danger-soft: #ffe3ea;
  --dash: #c5c5f0;
  --warn-bg: #fff3bf;
  --warn-text: #946c00;
  --notice-bg: #fff9db;
  --notice-border: #ffe066;
  --chip: #ffffff;
  color-scheme: light;
}

/* Dark theme (Settings → Appearance) */
:root[data-theme="dark"] {
  --bg: #18191a;
  --surface: #242526;
  --text: #e4e6eb;
  --muted: #b0b3b8;
  --border: #3a3b3c;
  --primary: #7373e6;
  --primary-hover: #8585ee;
  --like: #f25c84;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --tint: #33335c;
  --tint-soft: #2a2a40;
  --danger-soft: #4a2430;
  --dash: #4d4d85;
  --warn-bg: #3d3414;
  --warn-text: #ffd866;
  --notice-bg: #302a12;
  --notice-border: #6b5a12;
  --chip: #3a3b3c;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.4;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
.muted { color: var(--muted); font-size: 13px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar__inner {
  max-width: 1200px;
  height: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}
/* The Pager logo: the tilted pager (images/pager-mark.svg) next to the word, in Danish red */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.22em;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -1px;
  color: #C8102E;
  text-decoration: none;
}
.logo::before {
  content: "";
  flex: none;
  width: 1.22em;
  height: 1.1em;
  background: url("../images/pager-mark.svg") center / contain no-repeat;
}
:root[data-theme="dark"] .logo { color: #E0354A; }
:root[data-theme="dark"] .logo::before { background-image: url("../images/pager-mark-dark.svg"); }
.search { flex: 1; max-width: 420px; }
.search input {
  width: 100%;
  padding: 9px 16px;
  border: none;
  border-radius: 999px;
  background: var(--bg);
  outline: none;
}
.search input:focus { box-shadow: 0 0 0 2px var(--primary); }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: var(--bg);
  font-size: 18px;
}
.icon-btn:hover { background: var(--border); }
.icon-btn.active { box-shadow: inset 0 0 0 2px var(--primary); }
.badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--like);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
}

/* ---------- Layout ---------- */
.layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}
.sidebar {
  position: sticky;
  top: calc(var(--topbar-h) + 18px); /* + the 2px padding below = cards line up with the feed */
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr); /* never wider than its column */
  align-content: start;
  /* Stays put while the feed scrolls. Taller than the window? It scrolls on its own (hover over it),
     never sideways, and a soft fade shows there's more (js/sidebar.js sets has-more-above/below). */
  max-height: calc(100vh - var(--topbar-h) - 20px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain; /* reaching its end doesn't start scrolling the page */
  scrollbar-width: none;
  padding: 2px 2px 18px;
  margin: -2px;
}
.sidebar::-webkit-scrollbar { display: none; }
.sidebar.has-more-below { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 56px), transparent); }
.sidebar.has-more-above { -webkit-mask-image: linear-gradient(to top, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to top, #000 calc(100% - 40px), transparent); }
.sidebar.has-more-above.has-more-below {
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 40px, #000 calc(100% - 56px), transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 40px, #000 calc(100% - 56px), transparent);
}
.feed { display: grid; gap: 16px; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.card__title { margin: 0 0 12px; font-size: 15px; color: var(--muted); }

/* ---------- Avatars ---------- */
.avatar {
  --size: 40px;
  width: var(--size);
  height: var(--size);
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: calc(var(--size) * 0.38);
  background: var(--avatar-bg, linear-gradient(135deg, #5b5bd6, #d6336c));
  padding: 0;
}
.avatar::after { content: attr(data-initials); }
.avatar--sm { --size: 36px; }
.avatar--lg { --size: 72px; }

/* ---------- Left sidebar ---------- */
.profile-card { text-align: center; }
.profile-card .avatar { margin: 0 auto 8px; }
.profile-card__name { margin: 0; font-size: 18px; }
.profile-card__stats {
  display: flex;
  justify-content: space-around;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.profile-card__stats div, .stat-link { display: flex; flex-direction: column; }
.stat-link { padding: 4px 6px; border-radius: 8px; color: inherit; text-decoration: none; }
.stat-link:hover, .stat-link:focus-visible { background: var(--bg); }
.stat-link:hover strong, .stat-link:focus-visible strong { color: var(--primary); }
.profile-header__stats a { color: inherit; text-decoration: none; }
.profile-header__stats a:hover strong, .profile-header__stats a:focus-visible strong { color: var(--primary); }
.profile-header__stats a:hover { text-decoration: underline; }
.profile-card__stats span { font-size: 12px; color: var(--muted); }

.menu { display: grid; gap: 2px; padding: 8px; }
.menu__item { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-radius: 8px; font-weight: 500; }
.menu__item .pill { margin-left: auto; }
.menu__item:hover { background: var(--bg); }
.menu__item.active { background: var(--tint); color: var(--primary); }

/* ---------- Stories ---------- */
.stories {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}
.stories::-webkit-scrollbar { display: none; }
.story {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 72px;
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0;
}
.story__ring {
  padding: 3px;
  border-radius: 50%;
  background: linear-gradient(45deg, #f59f00, #d6336c, #5b5bd6);
}
.story.seen .story__ring { background: var(--border); }
.story.no-story .story__ring { background: transparent; }
.story:hover .story__name { text-decoration: underline; }

/* Friends / Followers tabs above the row */
.people__tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.people__tab {
  border: none;
  background: none;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  color: var(--muted);
}
.people__tab:hover { background: var(--bg); }
.people__tab.active { background: var(--tint); color: var(--primary); }
.people__tab .count { font-weight: 500; opacity: 0.8; margin-left: 2px; }
.people__empty { align-self: center; }
.story__ring .avatar { --size: 60px; border: 3px solid var(--surface); }
.story__name {
  font-size: 12px;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Composer ---------- */
.composer__row { display: flex; gap: 12px; }
.composer textarea {
  flex: 1;
  resize: none;
  border: none;
  border-radius: 20px;
  background: var(--bg);
  padding: 10px 16px;
  font: inherit;
  outline: none;
}
.composer__actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.composer__tools { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: none;
  background: none;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 500;
}
.chip:hover { background: var(--bg); }

.btn {
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-weight: 600;
}
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn--primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--link { background: none; color: var(--primary); padding: 4px 0; font-size: 13px; }

/* ---------- Posts ---------- */
#posts { display: grid; gap: 16px; }
.post { padding: 0; overflow: hidden; }
.post__header { display: flex; align-items: center; gap: 10px; padding: 14px 16px; }
.post__author { font-weight: 600; }
.post__more { margin-left: auto; border: none; background: none; font-size: 20px; color: var(--muted); }
.post__text { padding: 0 16px 12px; margin: 0; white-space: pre-wrap; }
.post__media {
  aspect-ratio: 4 / 3;
  background: var(--media-bg);
  display: grid;
  place-items: center;
  font-size: 64px;
  user-select: none;
}
.post__stat-btn { border: none; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.post__stat-btn:hover { text-decoration: underline; color: var(--text); }
.action.is-open { color: var(--primary); }
.post__stats {
  display: flex;
  justify-content: space-between;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--muted);
}
.post__actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 12px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.action {
  border: none;
  background: none;
  padding: 8px;
  margin: 4px 0;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 600;
}
.action:hover { background: var(--bg); }
.action.liked { color: var(--like); }

.comments { padding: 10px 16px 14px; display: grid; gap: 8px; }
.comment { display: flex; gap: 8px; align-items: flex-start; }
.comment .avatar { --size: 30px; }
.comment__bubble { background: var(--bg); border-radius: 14px; padding: 6px 12px; }
.comment__author { display: block; font-size: 13px; font-weight: 600; }
.comment-form { display: flex; gap: 8px; align-items: center; }
.comment-form .avatar { --size: 30px; }
.comment-form input {
  flex: 1;
  border: none;
  border-radius: 999px;
  background: var(--bg);
  padding: 8px 14px;
  outline: none;
  font: inherit;
}

/* ---------- Right sidebar ---------- */
.suggestions, .trending { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.suggestion { display: flex; align-items: center; gap: 10px; }
.suggestion__info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.suggestion__info strong { font-size: 14px; }
.trending li { display: flex; flex-direction: column; }
.trending a { font-weight: 600; color: var(--primary); }
.footer { padding: 0 8px; }

/* ---------- Links to profiles ---------- */
.name-link { font-weight: 600; }
.name-link:hover { text-decoration: underline; }
a.avatar:hover { filter: brightness(0.92); }
.avatar.active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary); }
.avatar--xl { --size: 150px; border: 5px solid var(--surface); }
.avatar--friend { --size: 64px; }

.btn--secondary { background: var(--bg); color: var(--text); }
.btn--secondary:hover { background: var(--border); }
.btn--link.is-following { color: var(--muted); }

.empty { text-align: center; color: var(--muted); padding: 32px 16px; }
.empty h2 { color: var(--text); margin-top: 0; }

/* ---------- Profile page ---------- */
/* Profile pages: left sidebar + profile content */
.layout--profile { grid-template-columns: 260px minmax(0, 1fr); }
.profile-page {
  min-width: 0;
  display: grid;
  gap: 16px;
}
#profile-friends { scroll-margin-top: calc(var(--topbar-h) + 20px); }

.profile-header { padding: 0; overflow: hidden; }
.profile-header__cover {
  height: 260px;
  background: var(--cover-bg);
}
.profile-header__main {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  padding: 0 32px 24px;
  margin-top: -60px; /* pulls avatar up over the cover */
}
.profile-header__info { flex: 1; min-width: 0; padding-bottom: 4px; }
.profile-header__name { margin: 64px 0 0; font-size: 30px; line-height: 1.1; }
.profile-header__info .muted { margin: 2px 0 10px; }
.profile-header__stats { display: flex; gap: 20px; flex-wrap: wrap; }
.profile-header__bio { margin: 10px 0 0; }
.profile-header__actions { display: flex; gap: 8px; padding-bottom: 4px; }

.tabs { display: flex; gap: 4px; padding: 6px; }
.tab {
  border: none;
  background: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  color: var(--muted);
}
.tab:hover { background: var(--bg); }
.tab.active { color: var(--primary); background: var(--tint); }

.profile-body {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.profile-side { display: grid; gap: 16px; align-content: start; }
.profile-posts { display: grid; gap: 16px; }

.intro__bio { text-align: center; margin: 0 0 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.intro__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.friends-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.friend { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.friend__name { font-size: 13px; }

/* Instagram-style photo grid */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
}
.photo-grid .empty { grid-column: 1 / -1; }
.photo {
  position: relative;
  aspect-ratio: 1;
  border: none;
  padding: 0;
  background: var(--media-bg);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.photo__emoji { font-size: 48px; }
.photo__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- Photo posts ---------- */
.post__media--image { aspect-ratio: auto; display: block; background: #000; }
.post__media--image img {
  display: block;
  width: 100%;
  max-height: 680px;
  object-fit: contain;
}

.composer { transition: box-shadow 0.15s; }
.composer.is-dragging { box-shadow: 0 0 0 2px var(--primary), var(--shadow); }
.composer.is-loading .composer__photo::after { content: " …"; }
.composer__preview {
  position: relative;
  margin: 12px 0 0 52px;
  width: fit-content;
  max-width: calc(100% - 52px);
}
.composer__preview img {
  display: block;
  max-width: 100%;
  max-height: 260px;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.composer__remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
}
.composer__remove:hover { background: rgba(0, 0, 0, 0.8); }
.composer__error { margin: 10px 0 0 52px; color: var(--like); font-size: 13px; }
.photo__overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.15s;
}
.photo:hover .photo__overlay { opacity: 1; }

.profile-main { display: grid; gap: 16px; }
.profile-header__main { flex-wrap: wrap; }
.profile-header__info { min-width: 300px; }
.profile-header__stats span { white-space: nowrap; }
.profile-header__actions { flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }

/* ---------- Friends & requests ---------- */
.btn--sm { padding: 6px 12px; font-size: 13px; }
.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 6px;
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.pill {
  display: inline-block;
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--like);
  color: #fff;
  font-size: 12px;
  text-align: center;
}
.requests { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.requests__subtitle { margin: 16px 0 10px; font-size: 13px; color: var(--muted); }
.request { display: flex; gap: 10px; align-items: flex-start; }
.request .avatar { --size: 48px; }
.request__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.request__actions { display: flex; gap: 6px; margin-top: 8px; }
.request__actions .btn { flex: 1; }
#friend-requests { scroll-margin-top: calc(var(--topbar-h) + 20px); }
#friend-requests:target { box-shadow: 0 0 0 2px var(--primary); }
.btn--block { width: 100%; margin-top: 14px; }

/* ---------- Edit profile dialog ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.modal {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: none;
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  color: var(--text);
}
.modal::backdrop { background: rgba(0, 0, 0, 0.5); }
.modal__form { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.modal__header h2 { margin: 0; font-size: 18px; }
.modal__close {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: var(--bg);
}
.modal__close:hover { background: var(--border); }
.modal__body { padding: 20px; overflow-y: auto; display: grid; gap: 16px; }
.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

.edit-preview { position: relative; margin-bottom: 36px; }
.edit-preview__cover { height: 110px; border-radius: 10px; }
.avatar--preview {
  --size: 84px;
  position: absolute;
  left: 20px;
  bottom: -36px;
  border: 4px solid var(--surface);
}

.field { display: grid; gap: 6px; margin: 0; padding: 0; border: none; min-width: 0; }
.field__label { font-weight: 600; font-size: 14px; padding: 0; }
.field input,
.field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  resize: vertical;
  outline: none;
}
.field input:focus,
.field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--tint); }
.field .invalid { border-color: var(--like); }
.field__hint { font-size: 12px; color: var(--muted); }
.field__error { font-size: 12px; color: var(--like); }
.field__error:empty { display: none; }
.field__prefix {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding-left: 12px;
  color: var(--muted);
}
.field__prefix:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--tint); }
.field__prefix input { border: none; padding-left: 2px; box-shadow: none !important; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--swatch);
  cursor: pointer;
}
.swatches--wide .swatch { width: 56px; border-radius: 8px; }
.swatch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.swatch:has(input:checked) { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary); }
.swatch:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 4px; }


/* ---------- Customizable profile sections ---------- */
.zone { display: grid; gap: 16px; align-content: start; }
.zone--featured { grid-template-columns: 1fr; }
.section { scroll-margin-top: calc(var(--topbar-h) + 20px); }
.section__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.section__header .card__title { margin-bottom: 12px; }
.section__empty { margin: 0; }
.btn--link-inline {
  border: none;
  background: none;
  padding: 0;
  color: var(--primary);
  font-weight: 600;
}

/* Customize mode: dashed zones + per-section controls */
.zone.is-customizing {
  padding: 10px;
  border: 2px dashed var(--dash);
  border-radius: calc(var(--radius) + 4px);
  background: rgba(91, 91, 214, 0.04);
}
.zone.is-customizing::before {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--primary);
}
.zone[data-zone="side"].is-customizing::before { content: "Sidebar"; }
.zone[data-zone="featured"].is-customizing::before { content: "Featured"; }
.zone__hint { margin: 0; text-align: center; padding: 8px; }
.section__controls { display: flex; gap: 2px; flex-shrink: 0; }
.ctrl {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
.ctrl:hover:not(:disabled) { background: var(--tint); color: var(--primary); }
.ctrl[data-section-action="remove"]:hover { background: var(--danger-soft); color: var(--like); }
.ctrl:disabled { opacity: 0.35; cursor: default; }
.add-section {
  width: 100%;
  padding: 12px;
  border: 2px dashed var(--dash);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--primary);
  font-weight: 600;
}
.add-section:hover { background: var(--tint); }

/* Top 4 (Letterboxd-style posters / album covers) */
.top4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.top4__item { margin: 0; min-width: 0; }
.top4__item figcaption {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.poster {
  aspect-ratio: 2 / 3;
  border-radius: 6px;
  background: var(--poster-bg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: flex-end;
  padding: 8px;
  overflow: hidden;
  transition: transform 0.15s;
}
.poster--square { aspect-ratio: 1; }
.top4__item:hover .poster { transform: translateY(-2px); }
.poster__title {
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.15;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  overflow-wrap: anywhere;
}
/* Narrow sidebar: smaller poster text */
.profile-side .poster__title { font-size: 10px; }
.profile-side .poster { padding: 5px; }
.profile-side .top4 { gap: 6px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--tint);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
}
.ranked { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.quote { margin: 0; padding-left: 14px; border-left: 4px solid var(--primary); }
.quote p { margin: 0; font-size: 17px; font-style: italic; }
.quote footer { margin-top: 6px; color: var(--muted); font-size: 13px; }

/* Add-section picker + section editor */
.section-picker { display: grid; gap: 8px; }
.picker-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  text-align: left;
}
.picker-item:hover { border-color: var(--primary); background: var(--tint-soft); }
.picker-item__icon { font-size: 26px; }
.top4-inputs { display: grid; gap: 8px; }
.top4-row { display: flex; align-items: center; gap: 8px; }
.top4-row__num { width: 20px; font-weight: 700; color: var(--muted); text-align: center; }
.top4-row { flex-wrap: wrap; }
.top4-row input { flex: 2; min-width: 0; }
.top4-row .top4-row__year { flex: 0 0 70px; }
.top4-row__thumb {
  flex: 0 0 34px;
  height: 51px;
  border-radius: 4px;
  background: var(--bg);
  border: 1px dashed var(--border);
  overflow: hidden;
}
.top4-row__thumb.is-square { height: 34px; }
.top4-row__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.top4-row__thumb:has(img) { border-style: solid; }
.top4-row.is-loading .top4-row__thumb { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }
.top4-row__status { flex-basis: 100%; padding-left: 70px; font-size: 12px; color: var(--muted); }
.top4-row__status:empty { display: none; }
.field select,
.field input[type="date"] {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  background: var(--surface);
}

/* Real poster images (Wikipedia or uploaded) */
.poster--image { padding: 0; background: transparent; }
.poster--image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* Many poster/cover scans have thin white edges baked into the image.
     Zooming in slightly lets the rounded box crop them off. */
  transform: scale(1.06);
}

/* Relationship: linked partner */
.partner-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px;
  border-radius: 10px;
  background: var(--bg);
}
.partner-card:hover { background: var(--tint); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .layout--profile { grid-template-columns: minmax(0, 1fr); max-width: 1000px; }
  .sidebar--left { display: none; }
}
@media (max-width: 860px) {
  .profile-body { grid-template-columns: 1fr; }
  .profile-side { position: static; }
  .profile-header__main { flex-direction: column; align-items: center; text-align: center; }
  .profile-header__name { margin-top: 8px; }
  .profile-header__stats { justify-content: center; }
}
@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding: 12px 0; }
  .sidebar--right { display: none; }
  .card { border-radius: 0; }
  .search { display: none; }
  .profile-header__cover { height: 180px; }
  .field-row { grid-template-columns: 1fr; }
  .avatar--xl { --size: 120px; }
}

/* ---------- Post audiences ---------- */
.composer__send { display: flex; align-items: center; gap: 8px; }
/* Composer: "🌍 Everyone ▾" */
.audience-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: none;
  border-radius: 999px;
  background: var(--bg);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
}
.audience-btn:hover, .audience-btn[aria-expanded="true"] { background: var(--border); }
.audience-btn__caret { font-size: 10px; color: var(--muted); }
.audience-icon { cursor: default; }

/* ⋯ on your own posts */
.post__more { border-radius: 50%; width: 34px; height: 34px; cursor: pointer; transition: background 0.15s; }
.post__more:hover, .post__more[aria-expanded="true"] { background: var(--bg); }

/* Floating menu */
.audience-menu {
  position: absolute;
  z-index: 200;
  width: 300px;
  padding: 6px;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.04);
  animation: menu-in 0.12s ease-out;
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } }
.audience-menu__title { margin: 6px 10px 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.audience-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: none;
  font: inherit;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}
.audience-option:hover, .audience-option:focus-visible { background: var(--bg); outline: none; }
.audience-option__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg);
  font-size: 18px;
}
.audience-option[aria-checked="true"] .audience-option__icon { background: var(--tint); }
.audience-option__text { flex: 1; display: grid; gap: 1px; min-width: 0; }
.audience-option__text strong { font-size: 14px; }
.audience-option__text span { font-size: 12px; color: var(--muted); }
.audience-option__check {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
}
.audience-option[aria-checked="true"] .audience-option__check {
  border: 6px solid var(--primary);
}
.hidden-note { margin: 0; padding: 12px 16px; color: var(--text); background: var(--tint-soft); }
.hidden-note .muted { display: block; margin-top: 2px; }

/* ---------- Events ---------- */
.events-page { min-width: 0; display: grid; gap: 16px; align-content: start; }
.events-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.events-header__title { margin: 0 0 4px; font-size: 26px; }
.events-header .muted { margin: 0; }
.events-subtitle { margin: 12px 0 0; font-size: 18px; }
.events-hidden-note { margin: 0; text-align: center; }

.invite-banner { background: var(--notice-bg); border: 1px solid var(--notice-border); }
.invite-banner--inline { margin: 0 20px 12px; padding: 10px 14px; border-radius: 10px; }

.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 600;
  color: var(--muted);
}
.filter-chip:hover { border-color: var(--primary); color: var(--text); }
.filter-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.filter-chip .count { opacity: 0.75; font-weight: 500; margin-left: 2px; }

.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.event-grid--past { opacity: 0.7; }
.event-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; transition: transform 0.15s, box-shadow 0.15s; }
.event-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1); }
.event-card__media { position: relative; }
.event-card__media .date-badge { position: absolute; left: 12px; bottom: -18px; }
.event-card__body { padding: 26px 16px 14px; display: grid; gap: 4px; flex: 1; }
.event-card__time { margin: 0; color: var(--like); font-weight: 700; font-size: 13px; }
.event-card__title { margin: 0; font-size: 17px; }
.event-card__meta { margin: 0; font-size: 13px; color: var(--muted); }
.event-card__footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 13px; }

.event-cover {
  aspect-ratio: 16 / 7;
  background: var(--cover-bg, var(--bg));
  display: grid;
  place-items: center;
  overflow: hidden;
}
.event-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.event-cover__emoji { font-size: 48px; }
.event-cover--large { aspect-ratio: 16 / 6; }
.event-cover--large .event-cover__emoji { font-size: 80px; }

.date-badge {
  display: grid;
  width: 52px;
  border-radius: 10px;
  overflow: hidden;
  text-align: center;
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}
.date-badge__month { background: var(--like); color: #fff; font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 2px 0; }
.date-badge__day { font-size: 22px; font-weight: 800; padding: 2px 0 4px; }

.tag--host { background: var(--tint); color: var(--primary); }
.tag--invite { background: var(--warn-bg); color: var(--warn-text); }

.back-link { color: var(--primary); font-weight: 600; width: fit-content; }
.back-link:hover { text-decoration: underline; }

.event-detail { padding: 0; overflow: hidden; }
.event-detail__head { display: flex; gap: 16px; align-items: flex-start; padding: 20px 20px 12px; }
.event-detail__info { min-width: 0; display: grid; gap: 4px; }
.event-detail__info p { margin: 0; }
.event-detail__title { margin: 0; font-size: 28px; line-height: 1.15; }
.event-detail__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}
.event-detail__host-actions { margin-left: auto; display: flex; gap: 8px; }
.btn--danger:hover { background: var(--danger-soft); color: var(--like); }
.event-detail__grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.event-description { margin: 0; white-space: pre-wrap; }

.guests__title { margin: 14px 0 8px; font-size: 13px; color: var(--muted); }
.guests__title:first-child { margin-top: 0; }
.guests { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.guest { display: flex; align-items: center; gap: 10px; }
.guest .avatar { --size: 32px; }
.guest__name { font-size: 14px; }
.comments--event { padding: 0; }
.comment__time { display: block; font-size: 11px; margin-top: 2px; }

/* Create / edit event dialog */
.event-cover-picker { display: grid; gap: 8px; }
.event-cover-picker__preview {
  border-radius: 10px;
  overflow: hidden;
  border: 1px dashed var(--border);
  min-height: 80px;
  display: grid;
  place-items: center;
}
.event-cover-picker__preview .event-cover { width: 100%; }
.event-cover-picker__actions { display: flex; gap: 8px; }
.invite-list { display: grid; gap: 4px; max-height: 220px; overflow-y: auto; }
.invite-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
}
.invite-option:hover { background: var(--bg); }
.invite-option .avatar { --size: 30px; }
.invite-option input { width: auto; }

/* Home: upcoming events card */
.mini-events { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 10px; }
.mini-event { display: flex; align-items: center; gap: 10px; }
.mini-event .date-badge { width: 42px; box-shadow: none; border: 1px solid var(--border); }
.mini-event .date-badge__day { font-size: 17px; }
.mini-event__body { display: flex; flex-direction: column; min-width: 0; font-size: 14px; }
.mini-event:hover strong { text-decoration: underline; }

@media (max-width: 860px) {
  .event-detail__grid { grid-template-columns: 1fr; }
  .event-detail__host-actions { margin-left: 0; }
}

/* ---------- Messages ---------- */
.chat-app {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  height: calc(100vh - var(--topbar-h) - 40px);
  min-height: 480px;
  padding: 0;
  overflow: hidden;
  position: sticky;
  top: calc(var(--topbar-h) + 20px);
}
.avatar--xs { --size: 28px; }
.chat-avatar--group { background: var(--tint); font-size: calc(var(--size) * 0.5); }
.chat-avatar--group::after { content: none; }

/* Left: chat list */
.chat-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border); }
.chat-list__header { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 8px; }
.chat-list__header h1 { margin: 0; font-size: 24px; }
.chat-list__actions { display: flex; gap: 6px; }
.chat-list__actions .icon-btn { width: 36px; height: 36px; font-size: 16px; }
.chat-search {
  margin: 4px 16px 10px;
  padding: 9px 14px;
  border: none;
  border-radius: 999px;
  background: var(--bg);
  font: inherit;
  outline: none;
}
.chat-search:focus { box-shadow: 0 0 0 2px var(--primary); }
.chat-filters { padding: 0 16px 8px; }
.chat-items { list-style: none; margin: 0; padding: 0 8px 8px; overflow-y: auto; flex: 1; }
.chat-list__empty { padding: 24px 12px; text-align: center; }
.chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
}
.chat-item:hover { background: var(--bg); }
.chat-item.active { background: var(--tint); }
.chat-item .avatar { --size: 48px; }
.chat-item__body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.chat-item__top { display: flex; align-items: baseline; gap: 8px; }
.chat-item__name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item__time { font-size: 12px; color: var(--muted); flex: none; }
.chat-item__preview { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item.is-unread .chat-item__name { font-weight: 800; }
.chat-item.is-unread .chat-item__preview { color: var(--text); font-weight: 600; }
.chat-item__unread {
  flex: none;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

/* Right: conversation */
.chat-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.thread-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.thread-header__text { flex: 1; min-width: 0; }
.thread-header__title { margin: 0; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-header .muted { margin: 0; font-size: 13px; }
.thread-info-btn { width: 36px; height: 36px; font-size: 18px; color: var(--primary); }
.thread-info-btn[aria-expanded="true"] { background: var(--tint); }
.thread-back { display: none; border: none; background: none; font-size: 22px; padding: 4px 8px 4px 0; cursor: pointer; }

.thread-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.thread-main.with-info { grid-template-columns: minmax(0, 1fr) 280px; }
.thread-conversation { display: flex; flex-direction: column; min-height: 0; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 2px; }

.thread-intro { text-align: center; padding: 16px 0 24px; }
.thread-intro .avatar { margin: 0 auto 8px; }
.thread-intro h2 { margin: 0; font-size: 18px; }
.thread-intro p { margin: 4px 0 0; }
.thread-day { display: flex; justify-content: center; margin: 14px 0 8px; }
.thread-day span { font-size: 12px; font-weight: 600; color: var(--muted); }
.msg-system { margin: 6px 0; text-align: center; font-size: 12px; color: var(--muted); }

.msg-row { display: flex; align-items: flex-end; gap: 8px; max-width: 75%; }
.msg-row.is-first { margin-top: 8px; }
.msg-row--mine { align-self: flex-end; }
.msg-row--theirs { align-self: flex-start; }
.msg-row__avatar { width: 28px; flex: none; }
.msg-row__content { position: relative; display: flex; flex-direction: column; min-width: 0; }
.msg-row--mine .msg-row__content { align-items: flex-end; }
.msg-row__name { font-size: 12px; color: var(--muted); margin: 0 0 2px 12px; }
.msg {
  margin: 0;
  padding: 8px 12px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg-row--theirs .msg { background: var(--bg); color: var(--text); }
.msg-row--mine .msg { background: var(--primary); color: #fff; }
/* Joined-up corners inside a run of messages */
.msg-row--theirs:not(.is-first) .msg { border-top-left-radius: 6px; }
.msg-row--theirs:not(.is-last) .msg { border-bottom-left-radius: 6px; }
.msg-row--mine:not(.is-first) .msg { border-top-right-radius: 6px; }
.msg-row--mine:not(.is-last) .msg { border-bottom-right-radius: 6px; }

.chat-composer { display: flex; align-items: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.chat-composer textarea {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: 20px;
  background: var(--bg);
  font: inherit;
  line-height: 1.35;
  resize: none;
  outline: none;
  max-height: 140px;
}
.chat-composer textarea:focus { box-shadow: 0 0 0 2px var(--primary); }
.send-btn {
  flex: none;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}
.send-btn:hover { background: var(--primary-hover); }
.thread-locked { margin: 0; padding: 14px 16px; border-top: 1px solid var(--border); text-align: center; color: var(--muted); font-size: 14px; }
.thread-locked a { color: var(--primary); font-weight: 600; }

/* Empty / unavailable / invitation views */
.thread-empty, .thread-invite {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 32px;
  text-align: center;
}
.thread-empty__icon { font-size: 48px; }
.thread-empty h2, .thread-invite h2 { margin: 8px 0 0; }
.thread-empty p, .thread-invite p { margin: 4px 0; }
.thread-empty__actions, .thread-invite__actions { display: flex; gap: 8px; margin-top: 12px; }
.thread-invite .avatar--xl { border: none; font-size: 72px; }
.thread-invite__members { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { border: 2px solid var(--surface); margin-left: -8px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* Group details panel */
.thread-info { border-left: 1px solid var(--border); padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.thread-info__head { text-align: center; display: grid; justify-items: center; gap: 6px; }
.thread-info__head h3 { margin: 0; font-size: 17px; }
.thread-info__heading { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.people-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.people-list li { display: flex; align-items: center; gap: 10px; }
.people-list__name { flex: 1; min-width: 0; display: grid; font-size: 14px; }
.people-list__name .tag { justify-self: start; margin-top: 2px; }
.people-list__name .muted { font-size: 12px; }
.thread-info__leave { margin-top: auto; background: none; color: var(--like); }

/* Dialog bits */
.people-search { padding: 9px 14px; border: 1px solid var(--border); border-radius: 999px; font: inherit; outline: none; }
.people-search:focus { border-color: var(--primary); }
.people-picker { max-height: 300px; }
button.invite-option { width: 100%; border: none; background: none; font: inherit; text-align: left; color: inherit; }
.invite-option__text { display: grid; min-width: 0; }
.invite-option__text .muted { font-size: 12px; }
.invite-option[hidden] { display: none; }
.emoji-picker { display: flex; flex-wrap: wrap; gap: 5px; }
.emoji-picker__option { position: relative; cursor: pointer; }
.emoji-picker__option input { position: absolute; opacity: 0; }
.emoji-picker__option span[aria-hidden] {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  font-size: 18px;
  border: 2px solid transparent;
}
.emoji-picker__option input:checked + span { border-color: var(--primary); background: var(--tint); }
.emoji-picker__option input:focus-visible + span { box-shadow: 0 0 0 3px var(--tint); }

/* Reactions */
.msg-line { display: flex; align-items: center; gap: 4px; max-width: 100%; }
.msg-row--mine .msg-line { flex-direction: row-reverse; }
.msg-line .msg { min-width: 0; }
.msg-react-btn {
  flex: none;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: none;
  font-size: 15px;
  cursor: pointer;
  opacity: 0;
  filter: grayscale(1);
  transition: opacity 0.12s, background 0.12s;
}
.msg-row:hover .msg-react-btn,
.msg-row.is-picking .msg-react-btn,
.msg-react-btn:focus-visible { opacity: 1; }
.msg-react-btn:hover, .msg-react-btn[aria-expanded="true"] { background: var(--bg); filter: none; }
@media (hover: none) { .msg-react-btn { opacity: 0.6; } }
.msg-reactions {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: -6px 0 2px 8px;
  padding: 1px 6px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--chip);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  font: inherit;
  font-size: 13px;
  line-height: 18px;
  cursor: pointer;
  position: relative;
  z-index: 1;
}
.msg-row--mine .msg-reactions { align-self: flex-end; margin: -6px 8px 2px 0; }
.msg-reactions.is-mine { background: var(--tint); }
.msg-reactions__count { font-size: 12px; font-weight: 600; color: var(--muted); }
.reaction-picker {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  z-index: 5;
  display: flex;
  gap: 2px;
  padding: 4px;
  background: var(--surface);
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.04);
  animation: menu-in 0.12s ease-out;
}
.reaction-picker.is-below { bottom: auto; top: calc(100% + 4px); }
.msg-row--mine .reaction-picker { left: auto; right: 0; }
.reaction-picker button {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: none;
  font-size: 20px;
  cursor: pointer;
  transition: transform 0.1s, background 0.1s;
}
.reaction-picker button:hover, .reaction-picker button:focus-visible { transform: scale(1.2); background: var(--bg); outline: none; }
.reaction-picker button.is-selected { background: var(--tint); }

@media (max-width: 1100px) {
  .thread-main.with-info { grid-template-columns: minmax(0, 1fr); }
  .thread-main.with-info .thread-conversation { display: none; }
  .thread-info { border-left: none; }
}
@media (max-width: 760px) {
  .chat-app { grid-template-columns: 1fr; height: calc(100vh - var(--topbar-h) - 24px); top: var(--topbar-h); }
  .chat-app.has-active .chat-list { display: none; }
  .chat-app:not(.has-active) .chat-thread { display: none; }
  .thread-back { display: block; }
}

/* ---------- Floating chats (top-bar dropdown + docked windows) ---------- */
.messenger-panel {
  position: fixed;
  z-index: 150;
  width: 360px;
  max-height: min(560px, calc(100vh - var(--topbar-h) - 24px));
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.04);
  animation: menu-in 0.12s ease-out;
}
.messenger-panel[hidden] { display: none; }
.messenger-panel__header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px; }
.messenger-panel__header h2 { margin: 0; font-size: 20px; }
.messenger-panel .chat-items { padding: 0 8px 8px; }
.messenger-panel .chat-item .avatar { --size: 44px; }

.chat-dock {
  position: fixed;
  right: 16px;
  bottom: 0;
  z-index: 140;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none;
}
.chat-window {
  pointer-events: auto;
  width: 330px;
  height: 450px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 12px 12px 0 0;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}
.chat-window.is-min { height: auto; width: 260px; }
.chat-window__header { display: flex; align-items: center; gap: 2px; padding: 6px; border-bottom: 1px solid var(--border); }
.chat-window.is-min .chat-window__header { border-bottom: none; }
.chat-window__title {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border: none;
  border-radius: 8px;
  background: none;
  font: inherit;
  text-align: left;
  color: inherit;
  cursor: pointer;
}
.chat-window__title:hover { background: var(--bg); }
.chat-window__title .avatar { --size: 32px; }
.chat-window__name { flex: 1; min-width: 0; display: grid; line-height: 1.2; }
.chat-window__name strong, .chat-window__name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-window__name strong { font-size: 14px; }
.chat-window__name small { font-size: 12px; color: var(--muted); }
.chat-window__btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: none;
  font-size: 15px;
  color: var(--primary);
  text-decoration: none;
  cursor: pointer;
}
.chat-window__btn:hover { background: var(--bg); }
.chat-window__messages { padding: 10px; }
.chat-window .thread-intro { padding: 8px 0 12px; }
.chat-window .thread-intro .avatar--lg { --size: 56px; }
.chat-window .thread-intro h2 { font-size: 15px; }
.chat-window .msg { font-size: 14px; }
.chat-window .msg-row { max-width: 85%; }
.chat-window .chat-composer { padding: 8px 10px; }
.chat-window .send-btn { width: 36px; height: 36px; }
.chat-window .thread-locked { padding: 10px; font-size: 13px; }
.chat-window__body { flex: 1; overflow-y: auto; display: flex; }
.chat-window .thread-invite { padding: 16px; }
.chat-window .thread-invite .avatar--xl { --size: 80px; font-size: 40px; }
.chat-window .thread-invite h2 { font-size: 17px; }
.chat-window .thread-invite p { font-size: 14px; }

@media (max-width: 760px) {
  .messenger-panel { width: auto; left: 8px; right: 8px !important; }
  .chat-dock { left: 8px; right: 8px; justify-content: flex-end; }
  .chat-window { width: 100%; height: min(450px, 70vh); }
  .chat-window:not(:last-child) { display: none; }
}

/* ---------- Photos page (Instagram-style) ---------- */
.photos-page { min-width: 0; display: grid; gap: 16px; align-content: start; }
.photos-header { display: grid; gap: 14px; }
.photos-header__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.photos-header__title { margin: 0 0 4px; font-size: 26px; }
.photos-header .muted { margin: 0; }
.view-toggle { display: flex; padding: 3px; border-radius: 10px; background: var(--bg); }
.view-toggle__btn {
  width: 38px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: none;
  font-size: 18px;
  color: var(--muted);
  cursor: pointer;
}
.view-toggle__btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* The picture: square, edge to edge */
.picture {
  position: relative;
  aspect-ratio: 1;
  background: var(--media-bg, #000);
  display: grid;
  place-items: center;
  overflow: hidden;
  user-select: none;
}
.picture img { width: 100%; height: 100%; object-fit: cover; display: block; }
.picture--emoji span { font-size: clamp(72px, 18vw, 140px); filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.18)); }

/* Scroll view: one column of big photos */
.ig-feed { display: grid; gap: 20px; justify-items: center; }
.ig-card { width: 100%; max-width: 500px; padding: 0; overflow: hidden; }
.ig-header { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-size: 14px; }
.ig-header__name { font-weight: 700; color: inherit; }
.ig-header .muted { font-size: 13px; }
.ig-header .audience-icon { margin-left: auto; font-size: 13px; }
.ig-delete { border: 0; background: none; cursor: pointer; font-size: 14px; padding: 4px 6px; border-radius: 8px; opacity: .7; }
.ig-delete:hover, .ig-delete:focus-visible { opacity: 1; background: var(--bg); }
.ig-card__media { position: relative; cursor: pointer; }
.ig-card__body { padding: 6px 14px 12px; display: grid; gap: 6px; }
.ig-actions { display: flex; gap: 4px; margin-left: -6px; }
.ig-action {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: none;
  font-size: 22px;
  cursor: pointer;
  transition: transform 0.1s;
}
.ig-action:hover { background: var(--bg); }
.ig-action:active { transform: scale(0.88); }
.ig-action.is-liked { animation: like-pop 0.3s ease-out; }
@keyframes like-pop { 50% { transform: scale(1.25); } }
.ig-likes { margin: 0; font-weight: 700; font-size: 14px; }
.ig-likes .muted { font-weight: 400; }
.ig-caption { margin: 0; font-size: 14px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.ig-caption__name { font-weight: 700; color: inherit; margin-right: 2px; }
.ig-more, .ig-view-comments {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  justify-self: start;
}
.ig-more:hover, .ig-view-comments:hover { color: var(--text); }
.ig-comment-form { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--border); padding-top: 8px; margin-top: 2px; }
.ig-comment-form input { flex: 1; border: none; outline: none; font: inherit; font-size: 14px; background: none; padding: 6px 0; }
.ig-comment-form .btn--link { font-weight: 700; font-size: 14px; }
.ig-comment-form .btn--link:disabled { opacity: 0.4; cursor: default; }

/* Grid view */
.photos-grid { padding: 4px; }
.photos-grid .photo__emoji { font-size: clamp(36px, 6vw, 64px); }

/* Double-click heart */
.heart-burst {
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: 96px;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.3));
  animation: heart-burst 0.8s ease-out forwards;
}
@keyframes heart-burst {
  15% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
  30% { transform: translate(-50%, -50%) scale(0.95); }
  45%, 70% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .heart-burst, .ig-action.is-liked { animation-duration: 0.01s; }
}

/* Full-screen viewer */
.photo-viewer {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  display: none;
}
.photo-viewer[open] { display: grid; place-items: center; }
.photo-viewer::backdrop { background: rgba(0, 0, 0, 0.82); }
.viewer {
  --viewer-h: min(720px, calc(100vh - 80px), calc(100vw - 480px));
  display: grid;
  grid-template-columns: var(--viewer-h) 340px; /* square photo column + comments */
  height: var(--viewer-h);
  background: var(--surface);
  border-radius: 6px;
  overflow: hidden;
}
.viewer__media { position: relative; background: #000; display: grid; place-items: center; min-width: 0; min-height: 0; }
.viewer__media .picture { width: 100%; height: 100%; }
.viewer__media .picture--contain img { object-fit: contain; }
.viewer__side { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--border); }
.viewer__side .ig-header { border-bottom: 1px solid var(--border); padding: 12px 14px; }
.viewer__comments { flex: 1; overflow-y: auto; padding: 14px; display: grid; gap: 14px; align-content: start; }
.viewer__comment { display: flex; gap: 10px; align-items: flex-start; }
.viewer__comment p { margin: 3px 0 0; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; white-space: pre-wrap; }
.viewer__delete { font-size: 12px; padding: 0 4px; color: var(--muted); }
.viewer__delete:hover { color: var(--like); }
.viewer__time { display: block; font-size: 12px; margin-top: 4px; }
.viewer__empty { margin: auto 0; text-align: center; font-size: 14px; }
.viewer__footer { border-top: 1px solid var(--border); padding: 6px 14px 10px; display: grid; gap: 4px; }
.viewer__close, .viewer__nav {
  position: fixed;
  z-index: 1;
  border: none;
  background: none;
  color: #fff;
  cursor: pointer;
}
.viewer__close { top: 14px; right: 18px; font-size: 26px; width: 44px; height: 44px; }
.viewer__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-size: 30px;
  line-height: 1;
  padding-bottom: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
.viewer__nav:hover, .viewer__close:hover { transform: translateY(-50%) scale(1.08); }
.viewer__close:hover { transform: scale(1.1); }
.viewer__nav--prev { left: 20px; }
.viewer__nav--next { right: 20px; }

@media (max-width: 900px) {
  .viewer { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); width: calc(100vw - 24px); height: calc(100vh - 80px); }
  .viewer__media .picture { height: auto; max-height: 50vh; }
  .viewer__side { border-left: none; }
  .viewer__nav { top: 25vh; transform: none; } /* over the photo, clear of the comment box */
  .viewer__nav:hover { transform: scale(1.08); }
}
@media (max-width: 760px) {
  .ig-feed { gap: 8px; }
  .ig-card { max-width: none; }
}

/* ---------- Customizable left sidebar ---------- */
/* Small ✏️ in the top-right corner of the first card */
.sidebar--left { position: sticky; }
.sb-customize {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: var(--bg);
  font-size: 14px;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.15s, background 0.15s;
}
.sb-customize:hover, .sb-customize:focus-visible { opacity: 1; background: var(--tint); }
.sb-empty { margin: 0; font-size: 13px; padding: 4px 4px 0; }

/* Shortcuts card */
.shortcuts { padding: 14px 8px 8px; }
.shortcuts .card__title { margin: 0 8px 8px; }
.shortcut-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.shortcut {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  color: inherit;
}
a.shortcut:hover { background: var(--bg); }
.shortcut .avatar { --size: 28px; flex: none; }
.shortcut .chat-avatar--group { font-size: 15px; }
.shortcut__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Edit mode */
.sidebar--left.is-customizing {
  padding: 10px;
  border: 2px dashed var(--dash);
  border-radius: calc(var(--radius) + 4px);
  background: rgba(91, 91, 214, 0.04);
  gap: 12px;
}
.sb-edit-bar {
  display: grid;
  gap: 10px;
  padding: 12px;
  /* Stays on screen while you scroll, so Done is always in reach */
  position: sticky;
  top: calc(var(--topbar-h) + 12px);
  z-index: 5;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}
.sb-edit-bar p { margin: 2px 0 0; font-size: 13px; }
.sb-edit-bar__actions { display: flex; gap: 6px; }
.sb-edit-bar__actions .btn { flex: 1; }
.sb-block { display: grid; gap: 6px; }
.sb-block__bar { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 2px; }
.sb-block__title { font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--primary); }
.sb-controls { display: flex; gap: 2px; flex: none; margin-left: auto; }
.sb-controls .ctrl { width: 26px; height: 26px; font-size: 13px; }
.ctrl[data-sb="remove"]:hover { background: var(--danger-soft); color: var(--like); }
.menu__item--edit { padding: 6px 6px 6px 12px; }
.menu__item--edit:hover { background: none; }
.menu__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shortcut--edit { padding: 4px 6px 4px 8px; }
.sb-add { padding: 8px; font-size: 13px; margin-top: 4px; }
.sb-add[aria-expanded="true"] { background: var(--tint); border-style: solid; }
.sb-add-list { display: grid; gap: 2px; padding: 4px; border-radius: 8px; background: var(--bg); }
.sb-add-list__empty { margin: 0; padding: 6px 8px; font-size: 13px; }
.sb-add-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: none;
  border-radius: 6px;
  background: none;
  font: inherit;
  font-size: 14px;
  text-align: left;
  color: inherit;
  cursor: pointer;
}
.sb-add-option::before { content: "＋"; color: var(--primary); font-weight: 700; }
.sb-add-option:hover, .sb-add-option:focus-visible { background: var(--surface); outline: none; }
.sb-add-option .avatar { --size: 24px; }
/* While editing, let the sidebar grow with the page instead of scrolling inside itself */
.sidebar--left.is-customizing { position: static; max-height: none; overflow: visible; grid-template-columns: minmax(0, 1fr); }
.sb-block { grid-template-columns: minmax(0, 1fr); }
.is-customizing .shortcuts .card__title { display: none; } /* the bar above already says "Shortcuts" */

/* ---------- Friends page ---------- */
.friends-page { min-width: 0; display: grid; gap: 16px; align-content: start; }
.friends-header { display: grid; gap: 12px; padding-bottom: 0; }
.friends-header__title { margin: 0; font-size: 26px; }
.friends-tabs { display: flex; gap: 4px; margin: 0 -4px; overflow-x: auto; }
.friends-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px 12px;
  border: none;
  border-bottom: 3px solid transparent;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
}
.friends-tab:hover { color: var(--text); }
.friends-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.friends-tab .count { font-weight: 500; opacity: 0.8; }
.friends-panel { display: grid; gap: 12px; }
.friends-heading { margin: 8px 0 0; font-size: 17px; }
.friends-heading:first-child { margin-top: 0; }
.friends-count { margin: 0; font-size: 14px; }
.friends-restore { margin: 4px 0 0; text-align: center; font-size: 14px; }
.friends-toolbar { display: flex; gap: 12px; align-items: center; padding: 10px 12px; }
.friends-search {
  flex: 1;
  min-width: 0;
  padding: 9px 14px;
  border: none;
  border-radius: 999px;
  background: var(--bg);
  font: inherit;
  outline: none;
}
.friends-search:focus { box-shadow: 0 0 0 2px var(--primary); }
.friends-sort { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.friends-sort select { padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; background: var(--surface); }
.friends-empty { display: grid; justify-items: center; gap: 4px; }
.friends-empty__icon { font-size: 44px; }
.friends-empty h2 { margin: 4px 0 0; }
.friends-empty p { margin: 0; }

/* Person cards */
.person-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.person-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; text-align: center; }
.person-card__cover { display: block; height: 64px; background: var(--cover-bg); }
.person-card__avatar { --size: 84px; margin: -42px auto 0; border: 4px solid var(--surface); }
.person-card__body { padding: 8px 14px 0; flex: 1; }
.person-card__name { margin: 0; font-size: 16px; }
.person-card__name .name-link { color: inherit; }
.person-card__sub {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.35;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}
.person-card__actions { display: grid; gap: 6px; padding: 12px 14px 14px; }
.person-card__actions .btn { width: 100%; justify-content: center; text-align: center; }
.btn--quiet { background: none; color: var(--muted); }
.btn--quiet:hover { background: var(--bg); color: var(--text); }
.avatar-stack--xs .avatar { --size: 20px; font-size: 8px; border-width: 1.5px; margin-left: -6px; }
.avatar-stack--xs .avatar:first-child { margin-left: 0; }

/* ---------- Blogs ---------- */
.blogs-page { min-width: 0; display: grid; gap: 16px; align-content: start; }
.blogs-header { display: grid; gap: 14px; }
.blogs-header__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.blogs-header__title { margin: 0 0 4px; font-size: 26px; }
.blogs-header .muted { margin: 0; }
.breadcrumb a { font-weight: 600; color: var(--muted); font-size: 14px; }
.breadcrumb a:hover { color: var(--primary); }
.blog-meta-item { white-space: nowrap; }

.blog-cover {
  height: 110px;
  background: var(--cover-bg);
  display: grid;
  place-items: center;
  font-size: 44px;
}
.blog-cover span { filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.2)); }
.blog-cover--hero { height: 160px; font-size: 64px; }
.blog-cover--preview { height: 48px; width: 72px; border-radius: 8px; font-size: 24px; }

/* List */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.blog-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; color: inherit; transition: transform 0.15s, box-shadow 0.15s; }
.blog-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1); }
.blog-card__body { padding: 14px 16px 16px; display: grid; gap: 8px; flex: 1; align-content: start; }
.blog-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.blog-card__name { margin: 0; font-size: 17px; }
.blog-card__desc { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.4; }
.blog-card__meta { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.blog-card__footer { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; margin-top: auto; }
.avatar-stack--sm .avatar { --size: 24px; font-size: 9px; border-width: 2px; margin-left: -7px; }
.avatar-stack--sm .avatar:first-child { margin-left: 0; }

/* One blog */
.blog-hero { padding: 0; overflow: hidden; }
.blog-hero__body { padding: 18px 20px 20px; display: grid; gap: 10px; }
.blog-hero__top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.blog-hero__name { margin: 0; font-size: 28px; }
.blog-hero__desc { margin: 0; font-size: 15px; line-height: 1.5; }
.blog-hero__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 14px; }
.blog-hero__meta .name-link { color: var(--text); font-weight: 600; }
.blog-hero__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.blog-hero__actions:empty { display: none; }
.blog-invite { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.blog-invite__actions { display: flex; gap: 6px; }
.blog-posts { display: grid; gap: 12px; }
.blog-section-title { margin: 4px 0 0; font-size: 18px; }
.blog-section-title .muted { font-size: 14px; font-weight: 500; }
.blog-post-row { padding: 0; }
.blog-post-row__link { display: block; padding: 16px 18px 6px; color: inherit; }
.blog-post-row__link:hover .blog-post-row__title { color: var(--primary); }
.blog-post-row__top { display: flex; align-items: center; gap: 8px; }
.blog-post-row__title { margin: 0; font-size: 19px; }
.blog-post-row__excerpt { margin: 6px 0 0; color: var(--muted); line-height: 1.5; font-size: 15px; }
.blog-post-row__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 6px 18px 14px; font-size: 13px; }
.blog-post-row__meta .name-link { color: var(--text); font-weight: 600; }
.blog-post-row__stats { margin-left: auto; }

/* One post */
.blog-article { padding: 32px clamp(20px, 5vw, 56px); }
.blog-draft-note { margin: 0 0 16px; padding: 10px 14px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-text); font-size: 14px; }
.blog-article__title { margin: 0 0 16px; font-size: clamp(26px, 3.2vw, 36px); line-height: 1.2; }
.blog-article__byline { display: flex; align-items: center; gap: 10px; padding-bottom: 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.blog-article__byline p { margin: 2px 0 0; font-size: 13px; }
.blog-article__author { font-weight: 700; color: var(--text); }
.blog-article__tools { margin-left: auto; display: flex; gap: 6px; }
.blog-article__body { font-family: Georgia, "Times New Roman", serif; font-size: 19px; line-height: 1.7; padding: 12px 0 8px; max-width: 680px; }
.blog-article__body p { margin: 18px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.blog-article__footer { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--border); }
.blog-history { margin-left: auto; font-size: 14px; }
.blog-history summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.blog-history ol { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.blog-history li { display: flex; align-items: center; gap: 8px; }
.blog-comments { display: grid; gap: 10px; }

/* Editor */
.blog-editor { display: grid; gap: 8px; padding: 20px clamp(20px, 5vw, 48px) 16px; }
.blog-editor__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.blog-editor__writers { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.blog-editor__title {
  border: none;
  outline: none;
  font: inherit;
  font-size: clamp(26px, 3.2vw, 34px);
  font-weight: 800;
  padding: 12px 0 4px;
  background: none;
}
.blog-editor__title.invalid { box-shadow: inset 0 -2px 0 var(--like); }
.blog-editor__body {
  border: none;
  outline: none;
  resize: none;
  min-height: 280px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  line-height: 1.7;
  padding: 8px 0;
  background: none;
  overflow: hidden;
}
.blog-editor__footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--surface); }
.blog-editor__count { margin-right: auto; font-size: 13px; }

/* Dialog bits */
.blog-form-preview { display: flex; align-items: center; gap: 12px; font-size: 16px; }
.swatch-option { position: relative; cursor: pointer; }
.swatch-option input { position: absolute; opacity: 0; }
.swatch-option__chip { display: block; width: 44px; height: 30px; border-radius: 8px; border: 3px solid transparent; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); }
.swatch-option input:checked + .swatch-option__chip { border-color: var(--surface); box-shadow: 0 0 0 2px var(--primary); }
.swatch-option input:focus-visible + .swatch-option__chip { box-shadow: 0 0 0 2px var(--primary), 0 0 0 5px var(--tint); }
.radio-row { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; font-size: 14px; cursor: pointer; }
.radio-row input { margin-top: 3px; width: auto; flex: none; }
.radio-row input:disabled + span { opacity: 0.45; }
.blog-delete { justify-self: start; }

/* ---------- Reels (short vertical videos) ---------- */
.reels-page {
  min-width: 0;
  height: calc(100vh - var(--topbar-h) - 40px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}
.reels-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.reels-head__title { margin: 0; font-size: 24px; }
.reels-tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface); border-radius: 999px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.reels-tab {
  border: none;
  background: none;
  padding: 7px 14px;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.reels-tab:hover { color: var(--text); background: var(--bg); }
.reels-tab.active { background: var(--primary); color: #fff; }
.reels-tab .count { font-weight: 500; opacity: 0.75; margin-left: 2px; }
.reels-head__create { margin-left: auto; }

.reels-stage { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
.reels-feed {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.reels-feed::-webkit-scrollbar { display: none; }
.reels-nav { display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.reels-nav__btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.reels-nav__btn:hover:not(:disabled) { background: var(--tint); color: var(--primary); }
.reels-nav__btn:disabled { opacity: 0.35; cursor: default; }

/* One reel = one full screen of the feed */
.reel {
  position: relative;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  /* The video is as tall as fits, leaving room for the buttons (and the comments panel when open) */
  container-type: size;
  --rail: 80px;
  --panel: 0px;
  --frame-h: min(100cqh - 2px, (100cqw - var(--rail) - var(--panel)) * 16 / 9);
}
.reel.has-comments { --panel: 354px; }
.reel__frame {
  position: relative;
  height: var(--frame-h);
  aspect-ratio: 9 / 16;
  flex: none;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  color: #fff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}
.reel__media { position: absolute; inset: 0; cursor: pointer; }
.reel__video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.reel__missing { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: #ccc; }
.reel__shade {
  position: absolute;
  inset: auto 0 0 0;
  height: 45%;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
  pointer-events: none;
}
.reel__paused {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  font-size: 32px;
  padding-left: 6px;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}
.reel.is-paused .reel__paused { opacity: 1; }

.reel__controls { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; z-index: 1; }
.reel-ctrl {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}
.reel-ctrl:hover, .reel-ctrl:focus-visible { background: rgba(0, 0, 0, 0.65); }

.reel__info {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 18px;
  display: grid;
  gap: 6px;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.reel__info a, .reel__info button { pointer-events: auto; }
.reel__author { display: flex; align-items: center; gap: 8px; min-width: 0; }
.reel__author .avatar { flex: none; border: 2px solid #fff; }
.reel__name { color: #fff; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reel__time { color: rgba(255, 255, 255, 0.8); font-size: 13px; white-space: nowrap; }
.reel__follow {
  margin-left: 4px;
  padding: 4px 12px;
  border: 1.5px solid #fff;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.reel__follow:hover { background: rgba(255, 255, 255, 0.15); }
.reel__follow.is-on { border-color: rgba(255, 255, 255, 0.5); color: rgba(255, 255, 255, 0.85); font-weight: 600; }
.reel__caption { margin: 0; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.reel__more { border: none; background: none; padding: 0; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.reel__sound-name { display: flex; align-items: center; gap: 6px; font-size: 13px; min-width: 0; }
.reel__marquee { overflow: hidden; white-space: nowrap; max-width: 70%; mask-image: linear-gradient(90deg, #000 85%, transparent); }
.reel__marquee span { display: inline-block; padding-right: 30px; }
.reel.is-playing .reel__marquee span { animation: reel-marquee 8s linear infinite; }
@keyframes reel-marquee { from { transform: translateX(40%); } to { transform: translateX(-100%); } }

.reel__progress { position: absolute; left: 0; right: 0; bottom: 0; height: 12px; cursor: pointer; z-index: 1; }
.reel__progress::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.25); }
.reel__progress-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: #fff; }
.reel__progress:hover::before, .reel__progress:hover .reel__progress-bar { height: 5px; }

.reel .heart-burst { z-index: 2; }

/* Buttons beside the reel */
/* As tall as the video, with the buttons at the bottom */
.reel__rail { height: var(--frame-h); display: flex; flex-direction: column; justify-content: flex-end; gap: 14px; padding-bottom: 12px; }
.reel-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.reel-btn__icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  font-size: 21px;
  transition: transform 0.12s, background 0.12s;
}
.reel-btn:hover .reel-btn__icon { background: var(--tint); }
.reel-btn:active .reel-btn__icon { transform: scale(0.92); }
.reel-btn.is-on .reel-btn__icon { background: var(--tint); }
.reel-btn[data-reel-action="like"].is-on .reel-btn__icon { animation: reel-like 0.35s ease-out; }
@keyframes reel-like { 50% { transform: scale(1.2); } }

/* Comments: a panel beside the reel (like YouTube Shorts on a computer) */
.reel-comments {
  flex: none;
  width: 340px;
  height: var(--frame-h);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  color: var(--text);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  animation: reel-panel 0.18s ease-out;
}
@keyframes reel-panel { from { opacity: 0; transform: translateX(-12px); } }
.reel-comments__head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--border); font-size: 16px; }
.reel-comments__list { flex: 1; overflow-y: auto; display: grid; align-content: start; gap: 10px; padding: 12px 14px; }
.reel-comments__empty { margin: 16px 0; text-align: center; }
.reel-comments__form { padding: 10px 12px; border-top: 1px solid var(--border); }

/* Sample scenes: emoji moving on a gradient (paused unless the reel is playing) */
.reel-scene { position: absolute; inset: 0; overflow: hidden; background: var(--bg); }
.reel-scene__e {
  position: absolute;
  left: 50%;
  top: 48%;
  translate: -50% -50%;
  font-size: 110px;
  line-height: 1;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.25));
  animation: 3s ease-in-out infinite both paused;
}
.reel-scene__e:not(:first-child) { font-size: 48px; }
.reel-scene__text {
  position: absolute;
  left: 50%;
  top: 16%;
  translate: -50% 0;
  max-width: 85%;
  padding: 6px 14px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reel.is-playing .reel-scene__e { animation-play-state: running; }

.reel-scene--rise .reel-scene__e { animation-name: scene-rise; animation-duration: 7s; }
@keyframes scene-rise { 0% { transform: translateY(60%) scale(0.7); } 70%, 100% { transform: translateY(-10%) scale(1.25); } }

.reel-scene--float .reel-scene__e { animation-name: scene-float; }
.reel-scene--float .reel-scene__e:not(:first-child) { left: 68%; top: 34%; animation-name: scene-twinkle; animation-duration: 1.6s; }
@keyframes scene-float { 50% { transform: translateY(-18px) rotate(-4deg); } }
@keyframes scene-twinkle { 0%, 100% { transform: scale(0.6); opacity: 0.4; } 50% { transform: scale(1.1); opacity: 1; } }

.reel-scene--pop .reel-scene__e { animation-name: scene-pop; animation-duration: 2.4s; animation-delay: calc(var(--i) * 0.35s); }
.reel-scene--pop .reel-scene__e:not(:first-child) { left: calc(18% + var(--i) * 15%); top: calc(70% - (var(--i) % 2) * 8%); }
@keyframes scene-pop { 0%, 100% { transform: scale(0.85) rotate(0); } 30% { transform: scale(1.15) rotate(10deg); } 60% { transform: scale(1) rotate(-6deg); } }

.reel-scene--waves .reel-scene__e { animation-name: scene-rock; animation-duration: 3.5s; top: 60%; }
.reel-scene--waves .reel-scene__e:not(:first-child) { top: 36%; left: 30%; font-size: 70px; animation: none; opacity: 0.85; }
.reel-scene--waves::after {
  content: "";
  position: absolute;
  inset: 68% -50% 0;
  background: repeating-linear-gradient(170deg, rgba(255, 255, 255, 0.18) 0 6px, transparent 6px 26px);
  animation: scene-water 4s linear infinite paused;
}
.reel.is-playing .reel-scene--waves::after { animation-play-state: running; }
@keyframes scene-rock { 0%, 100% { transform: translateX(-30px) rotate(-7deg); } 50% { transform: translateX(30px) rotate(7deg); } }
@keyframes scene-water { to { transform: translateX(25%); } }

.reel-scene--grow .reel-scene__e { animation-name: scene-grow; animation-duration: 6s; animation-timing-function: linear; top: 58%; }
.reel-scene--grow .reel-scene__e:not(:first-child) { font-size: 110px; animation-delay: calc(var(--i) * 2s); }
@keyframes scene-grow { 0% { transform: scale(0.2); opacity: 0; } 8% { opacity: 1; } 30% { transform: scale(1); opacity: 1; } 34%, 100% { transform: scale(1.05); opacity: 0; } }

.reel-scene--rain .reel-scene__e { animation-name: scene-fall; animation-duration: 3s; animation-timing-function: linear; animation-delay: calc(var(--i) * -0.75s); left: calc(15% + var(--i) * 22%); }
.reel-scene--rain .reel-scene__e:first-child { font-size: 64px; }
@keyframes scene-fall { from { transform: translateY(-420px) rotate(0); } to { transform: translateY(420px) rotate(180deg); } }

.reel-scene--bounce .reel-scene__e { animation-name: scene-bounce; animation-duration: 0.9s; }
.reel-scene--bounce .reel-scene__e:not(:first-child) { left: 72%; top: 30%; animation-name: scene-twinkle; animation-duration: 0.9s; }
@keyframes scene-bounce { 0%, 100% { transform: translateY(0) scale(1.05, 0.95) rotate(-6deg); } 50% { transform: translateY(-60px) scale(0.95, 1.05) rotate(6deg); } }

.reel-scene--steam .reel-scene__e { top: 60%; animation-name: scene-float; animation-duration: 4s; }
.reel-scene--steam .reel-scene__e:not(:first-child) { top: 40%; animation-name: scene-steam; animation-duration: 2.2s; animation-timing-function: ease-out; }
@keyframes scene-steam { from { transform: translateY(20px) scale(0.6); opacity: 0.9; } to { transform: translateY(-90px) scale(1.3); opacity: 0; } }

.reel-scene--dash .reel-scene__e { top: 58%; animation-name: scene-dash; animation-duration: 2.5s; animation-timing-function: linear; }
.reel-scene--dash .reel-scene__e:not(:first-child) { margin-left: -70px; margin-top: 20px; animation-delay: -0.08s; opacity: 0.8; }
@keyframes scene-dash { from { transform: translateX(-260px); } to { transform: translateX(260px); } }

@media (prefers-reduced-motion: reduce) {
  .reel-scene__e, .reel-scene--waves::after, .reel__marquee span, .reel-comments, .reel-btn__icon { animation: none !important; }
}

.reels-empty { height: 100%; display: grid; place-content: center; justify-items: center; gap: 8px; text-align: center; }
.reels-empty h2 { margin: 0; }
.reels-empty p { margin: 0 0 8px; }
.reels-empty__icon { font-size: 56px; }

.toast {
  position: fixed;
  left: 50%;
  top: calc(var(--topbar-h) + 16px);
  z-index: 50;
  max-width: calc(100vw - 32px);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(28, 30, 33, 0.92);
  color: #fff;
  font-weight: 600;
  overflow-wrap: anywhere;
  translate: -50% -12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, translate 0.2s;
}
.toast.is-shown { opacity: 1; translate: -50% 0; }

/* Upload dialog */
.modal.reel-dialog { width: min(680px, calc(100vw - 32px)); }
.reel-form { grid-template-columns: 190px minmax(0, 1fr); align-items: start; }
.reel-form__fields { display: grid; gap: 16px; }
.reel-form__fields select { padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font: inherit; background: var(--surface); }
.reel-form__preview {
  position: relative;
  aspect-ratio: 9 / 16;
  border: 2px dashed var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
  display: grid;
}
.reel-form__preview.is-over { border-color: var(--primary); background: var(--tint); }
.reel-form__preview video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.reel-form__pick { display: grid; place-content: center; justify-items: center; gap: 4px; padding: 12px; text-align: center; cursor: pointer; font-size: 14px; }
.reel-form__pick-icon { font-size: 40px; }
.reel-form__duration { position: absolute; right: 8px; bottom: 8px; padding: 2px 8px; border-radius: 6px; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 12px; font-weight: 600; }

@media (max-width: 760px) {
  .reels-page { height: calc(100vh - var(--topbar-h) - 24px); padding: 0 8px; }
  .reels-nav { display: none; }
  .reels-stage { grid-template-columns: minmax(0, 1fr); }
  .reel { --rail: 0px; --panel: 0px; }
  .reel-comments { position: absolute; inset: auto 0 0 0; width: auto; height: 62%; z-index: 3; border-radius: 16px 16px 0 0; }
  .reel__rail { position: absolute; right: 8px; bottom: 80px; z-index: 2; height: auto; }
  .reel__rail .reel-btn { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
  .reel__rail .reel-btn__icon { background: rgba(0, 0, 0, 0.35); box-shadow: none; }
  .reel__info { right: 76px; }
  .reel-form { grid-template-columns: 1fr; }
  .reel-form__preview { width: 160px; justify-self: center; }
}

/* Reels shared in chats */
.msg-reel-wrap { display: grid; gap: 4px; justify-items: inherit; }
.msg-row--mine .msg-reel-wrap { justify-items: end; }
.msg-reel {
  display: flex;
  flex-direction: column;
  width: 150px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border);
}
.msg-reel:hover { border-color: var(--primary); }
.msg-reel__thumb {
  position: relative;
  aspect-ratio: 9 / 13;
  display: grid;
  place-items: center;
  background: var(--bg); /* the reel's gradient, set inline as --bg */
}
.msg-reel__emoji { font-size: 44px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25)); }
.msg-reel__play {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding-left: 3px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.15s;
}
.msg-reel:hover .msg-reel__play, .msg-reel:focus-visible .msg-reel__play { opacity: 1; }
.msg-reel__badge {
  position: absolute;
  left: 6px;
  top: 6px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.msg-reel__body { display: grid; gap: 2px; padding: 7px 9px 9px; font-size: 12px; text-align: left; }
.msg-reel__caption { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Share sheet */
.modal.share-dialog { width: min(460px, calc(100vw - 32px)); }
.share-body { gap: 14px; }
.share-reel { display: flex; align-items: center; gap: 12px; }
.share-reel__thumb { width: 48px; flex: none; aspect-ratio: 9 / 14; border-radius: 8px; overflow: hidden; }
.share-reel__thumb .msg-reel__emoji { font-size: 22px; }
.share-reel__text { display: grid; gap: 2px; min-width: 0; font-size: 14px; }
.share-reel__text .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.share-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.share-quick__btn {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 10px 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.share-quick__btn:hover { background: var(--bg); }
.share-quick__btn.is-on { border-color: var(--primary); background: var(--tint); color: var(--primary); }
.share-quick__icon { font-size: 20px; }
.share-search, .share-note {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  outline: none;
}
.share-search:focus, .share-note:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--tint); }
.share-results { max-height: 260px; overflow-y: auto; margin: -4px -8px; }
.share-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.share-target { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 10px; cursor: pointer; }
.share-target:hover { background: var(--bg); }
.share-target.is-picked { background: var(--tint); }
.share-target .avatar { flex: none; }
.share-target__text { flex: 1; min-width: 0; display: grid; font-size: 14px; }
.share-target__text strong, .share-target__text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.share-target__check { width: 20px; height: 20px; flex: none; accent-color: var(--primary); }
.share-empty { margin: 8px; text-align: center; }

/* ---------- Saving and sharing posts ---------- */
.action.is-saved { color: var(--primary); }
.ig-action--save { margin-left: auto; }
.post.is-highlighted { box-shadow: 0 0 0 3px var(--primary), 0 8px 24px rgba(91, 91, 214, 0.25); transition: box-shadow 0.4s; }
.post:focus { outline: none; }

/* Preview at the top of the share window */
.share-preview { display: flex; align-items: center; gap: 12px; min-width: 0; }
.share-preview__thumb {
  width: 52px;
  height: 52px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
}
.share-preview__thumb--tall { height: 76px; width: 48px; }
.share-preview__thumb img { width: 100%; height: 100%; object-fit: cover; }
.share-preview__emoji { font-size: 24px; }
.share-preview__text { display: grid; gap: 2px; min-width: 0; font-size: 14px; }
.share-preview__text .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.share-quick__label { display: block; }

/* A post sent in a chat */
.msg-post {
  display: grid;
  gap: 6px;
  width: 230px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  text-align: left;
}
.msg-post:hover { border-color: var(--primary); }
.msg-post__head { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.msg-post__media { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--bg); }
.msg-post__media img { width: 100%; height: 100%; object-fit: cover; }
.msg-post__emoji { font-size: 44px; }
.msg-post__text { font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.msg-post--gone { width: auto; color: var(--muted); font-size: 13px; display: flex; gap: 6px; }

/* ---------- Saved page ---------- */
.saved-page { min-width: 0; display: grid; gap: 16px; align-content: start; }
.saved-header { padding: 18px 18px 0; display: grid; gap: 10px; }
.saved-header__title { margin: 0; font-size: 24px; }
.saved-header p { margin: 4px 0 0; }
.saved-section { display: grid; gap: 10px; }
.saved-section__title { margin: 4px 0 0; font-size: 17px; }
.saved-section__title .muted { font-weight: 500; }
.saved-empty { display: grid; justify-items: center; gap: 4px; padding: 32px 16px; text-align: center; }
.saved-empty h2 { margin: 0; font-size: 18px; }
.saved-empty p { margin: 0; }
.saved-empty__icon { font-size: 40px; }
.saved-reels {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.saved-reel { position: relative; }
.saved-reel__link {
  position: relative;
  aspect-ratio: 9 / 16;
  display: grid;
  place-items: center;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  transition: transform 0.15s;
}
.saved-reel__link:hover { transform: translateY(-2px); }
.saved-reel__link::after { content: ""; position: absolute; inset: 50% 0 0; background: linear-gradient(transparent, rgba(0, 0, 0, 0.6)); }
.saved-reel__emoji { font-size: 56px; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.25)); }
.saved-reel__info {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 1;
  display: grid;
  gap: 2px;
  font-size: 12px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.saved-reel__info span:not(.saved-reel__stats) { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.saved-reel__stats { opacity: 0.85; font-weight: 600; }
.saved-reel__unsave {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  font-size: 15px;
  cursor: pointer;
}
.saved-reel__unsave:hover { background: #fff; transform: scale(1.06); }

/* ---------- Film search in the Top 4 editor (TMDB) ---------- */
.top4-row { position: relative; }
.movie-suggest {
  position: absolute;
  top: calc(100% - 2px);
  left: 70px;
  right: 0;
  z-index: 5;
  max-height: 260px;
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}
.movie-suggest[hidden] { display: none; }
.movie-option { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.movie-option:hover, .movie-option.is-active { background: var(--tint); }
.movie-option__poster {
  flex: none;
  width: 32px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg);
  font-size: 16px;
}
.movie-option__poster img { width: 100%; height: 100%; object-fit: cover; }
.movie-option__text { display: grid; min-width: 0; font-size: 14px; }
.movie-option__text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.movie-option__text .muted { font-size: 12px; }
.movie-suggest__note { padding: 10px 8px; font-size: 13px; color: var(--muted); }
.movie-suggest__credit { padding: 6px 8px 2px; font-size: 11px; color: var(--muted); text-align: right; border-top: 1px solid var(--border); margin-top: 4px; }
.tmdb-credit { display: block; margin-top: 2px; font-size: 11px; }

/* ---------- Sidebar footer links ---------- */
.sb-footer { display: flex; flex-wrap: wrap; gap: 4px 6px; padding: 0 8px 4px; font-size: 12px; color: var(--muted); }
.sb-footer a { color: inherit; text-decoration: none; }
.sb-footer a:hover, .sb-footer a[aria-current] { color: var(--primary); text-decoration: underline; }

/* ---------- About page ---------- */
.about-page { min-width: 0; display: grid; gap: 16px; align-content: start; }
.about-page [id] { scroll-margin-top: calc(var(--topbar-h) + 20px); }
.about-hero { padding: 40px 32px; text-align: center; display: grid; justify-items: center; gap: 10px; }
.about-hero__logo { font-size: 40px; }
.about-hero__title { margin: 0; font-size: 32px; }
.about-hero__lead { margin: 0; font-size: 19px; font-weight: 600; max-width: 34ch; }
.about-hero .muted { margin: 0; max-width: 52ch; line-height: 1.5; }
.about-section { padding: 22px 24px; }
.about-section__title { margin: 0 0 14px; font-size: 19px; }
.about-features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.about-features a {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 12px;
  padding: 12px;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  height: 100%;
}
.about-features a:hover { background: var(--bg); }
.about-features__icon { grid-row: span 2; font-size: 24px; }
.about-features span:last-child { color: var(--muted); font-size: 13px; line-height: 1.4; }
.about-privacy { margin: 0; padding-left: 20px; display: grid; gap: 10px; line-height: 1.5; }
.about-credits { padding: 8px 4px 24px; display: grid; gap: 10px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--border); margin-top: 8px; }
.about-credits__title { margin: 8px 0 0; font-size: 14px; color: var(--text); }
.about-credit { display: flex; align-items: center; gap: 12px; }
.about-credit p { margin: 0; line-height: 1.5; }
.about-credit a { color: var(--primary); }
.about-credit__logo:empty { display: none; }
.about-credit__logo-img { height: 18px; width: auto; display: block; }
.about-credits__copy { margin: 4px 0 0; }

/* ---------- Settings page ---------- */
.settings-page { min-width: 0; display: grid; gap: 16px; align-content: start; }
.settings-header { padding: 18px 20px; }
.settings-header__title { margin: 0; font-size: 24px; }
.settings-header p { margin: 4px 0 0; }
.settings-section { padding: 20px; display: grid; gap: 14px; }
.settings-section__title { margin: 0; font-size: 18px; }
.settings-fieldset { margin: 0; padding: 0; border: none; min-width: 0; display: grid; gap: 10px; }
.settings-legend { padding: 0; margin-bottom: 10px; font-weight: 600; font-size: 14px; }
.settings-hint { margin: -4px 0 12px; font-size: 13px; }
.settings-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.settings-note { margin: 0; font-size: 13px; }

.theme-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.theme-option {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
}
.theme-option:hover { border-color: var(--dash); }
.theme-option:has(input:checked) { border-color: var(--primary); background: var(--tint-soft); }
.theme-option:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.theme-option input { position: absolute; opacity: 0; pointer-events: none; }
.theme-option__text { display: grid; gap: 2px; font-size: 14px; }
.theme-option__text .muted { font-size: 12px; }
.theme-option:has(input:checked) .theme-option__text strong::after { content: " ✓"; color: var(--primary); }

/* Mini page drawings */
.theme-mini {
  display: grid;
  grid-template-columns: 30% 1fr;
  grid-template-rows: 14px 1fr;
  gap: 6px;
  height: 84px;
  padding: 6px;
  border-radius: 8px;
  overflow: hidden;
}
.theme-mini__bar { grid-column: 1 / -1; border-radius: 4px; }
.theme-mini__side { border-radius: 4px; }
.theme-mini__card { border-radius: 4px; padding: 6px; display: grid; gap: 5px; align-content: start; }
.theme-mini__card span { height: 6px; border-radius: 3px; }
.theme-mini__card span:last-child { width: 60%; }
.theme-mini--light { background: #f0f2f5; }
.theme-mini--light .theme-mini__bar, .theme-mini--light .theme-mini__side, .theme-mini--light .theme-mini__card { background: #fff; }
.theme-mini--light .theme-mini__card span { background: #d8dae0; }
.theme-mini--light .theme-mini__card span:first-child { background: #5b5bd6; }
.theme-mini--dark { background: #18191a; }
.theme-mini--dark .theme-mini__bar, .theme-mini--dark .theme-mini__side, .theme-mini--dark .theme-mini__card { background: #242526; }
.theme-mini--dark .theme-mini__card span { background: #3a3b3c; }
.theme-mini--dark .theme-mini__card span:first-child { background: #7373e6; }
.theme-mini-split { display: grid; grid-template-columns: 1fr 1fr; border-radius: 8px; overflow: hidden; }
.theme-mini-split .theme-mini { border-radius: 0; }

.privacy-options { display: grid; gap: 10px; }
.privacy-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
}
.privacy-option:hover { border-color: var(--dash); }
.privacy-option:has(input:checked) { border-color: var(--primary); background: var(--tint-soft); }
.privacy-option input { margin: 4px 0 0; width: 18px; height: 18px; flex: none; accent-color: var(--primary); }
.privacy-option__icon { font-size: 22px; line-height: 1; }
.privacy-option__text { display: grid; gap: 3px; font-size: 14px; line-height: 1.45; }

/* ---------- Private profiles ---------- */
.tag--private { background: var(--tint); color: var(--primary); }
.profile-locked { padding: 40px 24px; display: grid; justify-items: center; gap: 6px; text-align: center; }
.profile-locked h2 { margin: 0; font-size: 20px; }
.profile-locked p { margin: 0; max-width: 46ch; }
.profile-locked__icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
  border: 2px solid var(--text);
  border-radius: 50%;
  font-size: 30px;
}
.preview-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 12px 16px;
  background: var(--tint);
  border: 1px solid var(--dash);
  font-size: 14px;
}
.preview-banner__actions { display: flex; align-items: center; gap: 14px; }
.preview-banner a:not(.btn) { color: var(--primary); font-weight: 600; }
.audience-menu__note { margin: -2px 10px 8px; padding: 8px 10px; border-radius: 8px; background: var(--tint); font-size: 12px; line-height: 1.4; }

@media (max-width: 760px) {
  .theme-options { grid-template-columns: 1fr; }
}

/* ---------- Profile picture + cover photo ---------- */
.profile-header__cover { position: relative; }
.profile-header__avatar { position: relative; flex-shrink: 0; }
.photo-btn { cursor: pointer; }
.photo-btn--cover {
  position: absolute;
  right: 16px;
  bottom: 16px;
  background: rgba(255, 255, 255, 0.92);
  color: #1c1e21;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.photo-btn--cover:hover { background: #fff; }
:root[data-theme="dark"] .photo-btn--cover { background: rgba(36, 37, 38, 0.92); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); }
:root[data-theme="dark"] .photo-btn--cover:hover { background: var(--border); }
.photo-btn--avatar {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid var(--surface);
  background: var(--bg);
  font-size: 16px;
  display: grid;
  place-items: center;
  padding: 0;
}
.photo-btn--avatar:hover { background: var(--border); }
.photo-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.photo-pick { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Calendar ---------- */
.calendar-page { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 16px; align-items: start; min-width: 0; }
.cal { padding: 18px; display: grid; gap: 14px; min-width: 0; }
.cal__header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cal__heading { margin: 0; font-size: 22px; margin-right: auto; }
.cal__nav { display: flex; align-items: center; gap: 6px; }
.cal__arrow { width: 34px; height: 34px; font-size: 22px; line-height: 1; }
.cal__title { margin: 0 4px; font-size: 17px; min-width: 9.5em; text-align: center; }
.cal__filters { display: flex; flex-wrap: wrap; gap: 6px; }
.cal-filter { font-size: 13px; padding: 5px 10px; border: 1px solid var(--border); }
.cal-filter[aria-pressed="true"] {
  background: color-mix(in srgb, var(--kind-color) 16%, var(--surface));
  border-color: color-mix(in srgb, var(--kind-color) 55%, var(--surface));
  color: var(--text);
  font-weight: 600;
}
.cal-filter[aria-pressed="false"] { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
.cal__weekdays, .cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal__weekdays span { font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; padding-bottom: 4px; }
.cal__grid { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; gap: 1px; background: var(--border); }
.cal-day {
  min-height: 96px;
  min-width: 0;
  border: none;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}
.cal-day:hover { background: var(--bg); }
.cal-day.is-outside { background: var(--bg); }
.cal-day.is-outside .cal-day__num { color: var(--muted); font-weight: 400; }
.cal-day:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; position: relative; z-index: 1; }
.cal-day.is-selected { box-shadow: inset 0 0 0 2px var(--primary); }
.cal-day__num { font-size: 13px; font-weight: 600; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.is-today .cal-day__num { background: var(--primary); color: #fff; }
.cal-day__items { display: grid; gap: 3px; min-width: 0; }
.cal-chip {
  display: block;
  font-size: 11.5px;
  line-height: 1.35;
  padding: 1px 5px;
  border-radius: 4px;
  border-left: 3px solid var(--kind-color);
  background: color-mix(in srgb, var(--kind-color) 15%, var(--surface));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-day__more { font-size: 11px; color: var(--muted); padding-left: 4px; }

.cal-agenda { padding: 18px; position: sticky; top: calc(var(--topbar-h) + 18px); max-height: calc(100vh - var(--topbar-h) - 36px); overflow: auto; }
.cal-agenda__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.cal-agenda__title { margin: 0; font-size: 16px; }
.cal-agenda__head .btn { white-space: nowrap; flex: none; }
.cal-agenda__subtitle { margin: 20px 0 4px; font-size: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.cal-agenda__day { margin: 10px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.cal-agenda__jump { border: none; background: none; padding: 0; font: inherit; color: var(--muted); cursor: pointer; text-transform: inherit; letter-spacing: inherit; }
.cal-agenda__jump:hover { color: var(--primary); text-decoration: underline; }
.cal-agenda__empty { margin: 10px 0 0; font-size: 14px; }
.cal-agenda__more { display: inline-block; margin-top: 16px; font-size: 14px; font-weight: 600; }
.cal-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.cal-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border-left: 3px solid var(--kind-color);
  background: color-mix(in srgb, var(--kind-color) 9%, var(--surface));
  font-size: 14px;
}
.cal-item__time { grid-column: 1; font-size: 12px; color: var(--muted); }
.cal-item__main { grid-column: 1; display: grid; gap: 2px; min-width: 0; }
.cal-item__title { color: var(--text); font-weight: 600; }
a.cal-item__title:hover { color: var(--primary); }
.cal-item__sub { font-size: 12.5px; overflow-wrap: anywhere; }
.cal-item .btn { grid-column: 2; grid-row: 1 / span 2; align-self: center; }

.field--check { display: flex; align-items: center; gap: 8px; align-self: end; padding-bottom: 10px; cursor: pointer; }
.field--check input { width: auto; flex: none; }
.plan-delete { margin-right: auto; }

@media (max-width: 1100px) {
  .calendar-page { grid-template-columns: minmax(0, 1fr); }
  .cal-agenda { position: static; max-height: none; }
}

/* ---------- Top bar: customize + panels ---------- */
.topbar__inner { position: relative; }
.topbar-customize {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: none;
  font-size: 13px;
  opacity: 0.55;
  transition: opacity 0.15s, background 0.15s;
}
.topbar-customize:hover, .topbar-customize:focus-visible, .topbar-customize[aria-expanded="true"] { opacity: 1; background: var(--tint); }
.icon-btn[aria-expanded="true"] { box-shadow: inset 0 0 0 2px var(--primary); background: var(--tint); }
.topbar__actions.is-customizing .icon-btn { outline: 2px dashed var(--dash); outline-offset: 2px; }

.topbar-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 16px;
  width: 380px;
  max-height: calc(100vh - var(--topbar-h) - 24px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  padding: 14px;
  z-index: 20;
}
.topbar-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.topbar-panel__title { margin: 0; font-size: 18px; outline: none; }
.topbar-panel .btn--link-inline:disabled { color: var(--muted); cursor: default; text-decoration: none; }

/* Notifications */
.notif-tabs { display: flex; gap: 6px; margin: 10px 0 6px; }
.notif-tabs .chip[aria-pressed="true"] { background: var(--tint); color: var(--primary); font-weight: 600; }
.notif-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.notif { border-radius: 10px; }
.notif.is-unread { background: color-mix(in srgb, var(--primary) 7%, var(--surface)); }
.notif__link { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; color: var(--text); }
.notif__link:hover { background: var(--bg); }
.notif__link:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.notif__avatar { position: relative; flex: none; }
.notif__avatar .avatar { --size: 48px; }
.notif__type {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  font-size: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.notif__body { display: grid; gap: 2px; min-width: 0; flex: 1; font-size: 14px; line-height: 1.35; }
.notif__time { font-size: 12px; color: var(--muted); }
.notif.is-unread .notif__time { color: var(--primary); font-weight: 600; }
.notif__dot { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--primary); }
.notif__actions { display: flex; gap: 6px; padding: 0 8px 10px 66px; }
.notif-empty { text-align: center; padding: 24px 0; font-size: 14px; }

/* Customize top bar */
.tb-edit__hint { margin: 6px 0 10px; font-size: 13px; }
.tb-edit__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.tb-edit__item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; background: var(--bg); }
.tb-edit__icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); }
.tb-edit__label { font-weight: 600; font-size: 14px; }
.tb-edit__subtitle { margin: 14px 0 6px; font-size: 14px; }
.tb-edit__add .sb-add-option:disabled { opacity: 0.5; cursor: not-allowed; }
.tb-edit__footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* ---------- Top bar: 👥 friends dropdown ---------- */
.tb-section { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.tb-section:first-of-type { border-top: none; padding-top: 0; }
.tb-section__title { margin: 0 0 6px; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.tb-section__empty { margin: 4px 0; font-size: 13px; }
.tb-people { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.tb-person { display: flex; align-items: center; gap: 8px; }
.tb-person__link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 6px; border-radius: 8px; color: var(--text); }
.tb-person__link:hover { background: var(--bg); }
.tb-person__link .avatar { --size: 40px; }
.tb-person__text { display: grid; min-width: 0; font-size: 14px; }
.tb-person__text strong, .tb-person__text .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-person__text .muted { font-size: 12px; }
.tb-person__actions { display: flex; gap: 4px; flex: none; }
.tb-search {
  width: 100%;
  padding: 8px 12px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
}
.tb-search:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--tint); }
#tb-friend-list { max-height: 260px; overflow: auto; }

/* ---------- Discover ---------- */
.discover-page { display: grid; gap: 16px; align-content: start; min-width: 0; }
.discover-header { padding: 20px; display: grid; gap: 10px; }
.discover-header__title { margin: 0; font-size: 24px; }
.discover-header > .muted { margin: -4px 0 0; font-size: 14px; }
.discover-tabs .chip { border: 1px solid var(--border); }
.discover-tabs .chip[aria-pressed="true"] { background: var(--tint); color: var(--primary); border-color: transparent; font-weight: 600; }
.discover-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.discover-tags > .muted { margin-right: 2px; font-weight: 600; }
.discover-tag { border: none; background: var(--bg); color: var(--primary); border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 600; }
.discover-tag:hover { background: var(--tint); }
.discover-tag[aria-pressed="true"] { background: var(--primary); color: #fff; }
.discover-filter { margin: 0; font-size: 14px; }

.discover-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 210px;
  grid-auto-flow: dense;
  gap: 8px;
}
.dc-tile {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: var(--tile-bg, var(--surface));
  color: var(--text);
  display: grid;
  place-items: center;
  min-width: 0;
}
a.dc-tile:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.dc-tile--reel { grid-row: span 2; color: #fff; }
.dc-tile__img { width: 100%; height: 100%; object-fit: cover; }
.dc-tile__emoji { font-size: 64px; transition: transform 0.2s; }
.dc-tile--reel .dc-tile__emoji { font-size: 84px; }
a.dc-tile:hover .dc-tile__emoji { transform: scale(1.08); }
.dc-tile__scene-text { position: absolute; top: 46px; left: 12px; right: 12px; text-align: center; font-weight: 800; font-size: 18px; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); }
.dc-tile__badge {
  position: absolute; top: 10px; left: 10px;
  padding: 3px 8px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.45); color: #fff; font-size: 12px; font-weight: 600;
}
.dc-tile__overlay {
  position: absolute; inset: auto 0 0 0;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 24px 10px 8px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
  color: #fff; font-size: 12.5px; font-weight: 600;
  opacity: 0; transition: opacity 0.15s;
}
.dc-tile__overlay--always, a.dc-tile:hover .dc-tile__overlay, a.dc-tile:focus-visible .dc-tile__overlay { opacity: 1; }
.dc-tile__who { display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-tile__who .avatar { --size: 22px; font-size: 9px; }

.dc-tile--card { background: var(--surface); border: 1px solid var(--border); display: grid; grid-template-rows: 1fr auto; place-items: stretch; }
.dc-card__cover { display: grid; place-items: center; font-size: 44px; background: var(--tile-bg); min-height: 0; }
.dc-card__cover--event { background: var(--cover-bg, var(--bg)); aspect-ratio: auto; height: 100%; }
.dc-card__body { display: grid; gap: 2px; padding: 10px 12px 12px; min-width: 0; }
.dc-card__kicker { font-size: 12px; color: var(--primary); font-weight: 600; }
.dc-card__title { font-size: 15px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-card__sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.dc-tile--card:hover .dc-card__title { color: var(--primary); }

.dc-tile--person { background: var(--surface); border: 1px solid var(--border); align-content: center; gap: 4px; padding: 12px; text-align: center; }
.dc-person__name { font-weight: 700; color: var(--text); }
.dc-person__name:hover { color: var(--primary); }
.dc-person__bio { font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dc-tile--person .btn { margin-top: 4px; }

@media (max-width: 900px) {
  .discover-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Search: box in the top bar ---------- */
.search { position: relative; }
.search input { color: var(--text); }
.search-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(460px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - var(--topbar-h) - 24px));
  overflow: auto;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  z-index: 30;
}
.search-panel__head { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px 6px; font-weight: 700; font-size: 14px; }
.search-panel__group { padding: 8px 8px 2px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.search-panel__hint { margin: 0; padding: 10px 8px; color: var(--muted); font-size: 14px; }
.search-option { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; color: var(--text); }
.search-option:hover, .search-option[aria-selected="true"] { background: var(--bg); }
.search-option[aria-selected="true"] { box-shadow: inset 0 0 0 2px var(--primary); }
.search-option--all { margin-top: 4px; border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; padding-top: 10px; color: var(--primary); }
.search-option .avatar, .search-option .sr-thumb { --size: 36px; width: 36px; height: 36px; flex: none; }
.search-option .date-badge { transform: scale(0.75); margin: -8px -6px; }
.sr-text { display: grid; min-width: 0; font-size: 14px; line-height: 1.3; }
.sr-text strong, .sr-text .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-text strong .muted { font-weight: 400; }
.sr-text mark, .sr-row mark { background: color-mix(in srgb, #fab005 35%, transparent); color: inherit; border-radius: 2px; padding: 0 1px; }
.sr-thumb {
  --size: 44px;
  width: var(--size);
  height: var(--size);
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--thumb-bg, var(--bg));
  font-size: calc(var(--size) * 0.5);
  font-weight: 800;
  color: var(--primary);
  overflow: hidden;
}
.sr-thumb--img { object-fit: cover; padding: 0; }
.sr-thumb--icon { background: var(--bg); font-size: 16px; }

/* ---------- Search results page ---------- */
.search-page { display: grid; gap: 16px; align-content: start; min-width: 0; }
.search-header { padding: 20px; display: grid; gap: 12px; }
.search-header__title { margin: 0; font-size: 22px; overflow-wrap: anywhere; }
.search-header > .muted { margin: -4px 0 0; font-size: 14px; }
.search-tabs .chip { border: 1px solid var(--border); }
.search-tabs .chip[aria-pressed="true"] { background: var(--tint); color: var(--primary); border-color: transparent; font-weight: 600; }
.search-tabs .chip:disabled { opacity: 0.45; cursor: default; }
.search-tabs__count { font-size: 12px; color: var(--muted); margin-left: 2px; }
.search-section { padding: 16px 16px 12px; }
.search-section__title { margin: 0 0 6px; font-size: 16px; display: flex; align-items: center; gap: 6px; }
.search-section__more { margin-top: 6px; }
.search-recent { border: 1px solid var(--border); color: var(--text); }
.sr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sr-row { display: flex; align-items: center; gap: 8px; }
.sr-row__link { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 8px; border-radius: 10px; color: var(--text); }
.sr-row__link:hover { background: var(--bg); }
.sr-row__link .avatar { --size: 44px; }
.sr-row .sr-text { font-size: 15px; }
.sr-row .sr-text .muted { font-size: 13px; }
#sr-posts { display: grid; gap: 16px; }
.sr-thumb__emoji { font-size: inherit; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25)); }

/* ---------- Communities ---------- */
.communities-page { display: grid; gap: 20px; align-content: start; min-width: 0; }
.comm-hero { padding: 26px 28px; display: grid; grid-template-columns: 1fr auto; gap: 16px 20px; align-items: start; }
.comm-hero__title { margin: 0; font-size: 24px; }
.comm-hero .muted { margin: 6px 0 0; font-size: 14.5px; line-height: 1.5; }
.comm-tabs { grid-column: 1 / -1; }
.comm-tabs .chip, .comm-sort .chip { border: 1px solid var(--border); }
.comm-tabs .chip[aria-pressed="true"], .comm-sort .chip[aria-pressed="true"] { background: var(--tint); color: var(--primary); border-color: transparent; font-weight: 600; }
.comm-feed, .comm-main { display: grid; gap: 16px; align-content: start; min-width: 0; }
.comm-sort { margin: 0; }

.comm-icon {
  --size: 32px;
  width: var(--size); height: var(--size); flex: none;
  display: inline-grid; place-items: center;
  border-radius: 50%;
  background: var(--comm-bg);
  font-size: calc(var(--size) * 0.55);
  vertical-align: middle;
}
.comm-icon--xs { --size: 20px; }
.comm-icon--sm { --size: 36px; }
.comm-icon--md { --size: 56px; border: 3px solid var(--surface); margin-top: -34px; }
.comm-icon--picture { overflow: hidden; background: var(--bg); }
.comm-icon--picture img { width: 100%; height: 100%; object-fit: cover; display: block; }
.comm-icon--lg { --size: 84px; border: 4px solid var(--surface); }

/* Browse cards */
.comm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.comm-card { overflow: hidden; padding: 0; display: grid; grid-template-rows: auto 1fr; }
.comm-card__banner { height: 88px; background: var(--comm-bg); }
.comm-card__body { padding: 0 18px 18px; display: grid; gap: 6px; align-content: start; }
.comm-card__name { margin: 4px 0 0; font-size: 16px; }
.comm-card__name a:hover { color: var(--primary); }
.comm-card .muted { margin: 0; }
.comm-card__desc { margin: 4px 0; font-size: 14px; line-height: 1.5; color: var(--text); }
.comm-card__actions { margin-top: 8px; }

/* One community */
.comm-header { overflow: hidden; padding: 0; }
.comm-header__banner { height: 180px; background: var(--comm-bg); }
.comm-header__main { display: flex; align-items: flex-start; gap: 18px; padding: 0 28px 22px; margin-top: -36px; flex-wrap: wrap; }
.comm-header__info { flex: 1; min-width: 200px; padding-top: 56px; } /* starts ~20px below the banner, clear of the overlapping icon */
.comm-header__name { margin: 0; font-size: 26px; line-height: 1.15; }
.comm-header__info .muted { margin: 4px 0 0; font-size: 14px; }
.comm-header__actions { display: flex; gap: 8px; align-items: center; padding-top: 58px; }
@media (max-width: 640px) { .comm-header__info, .comm-header__actions { padding-top: 0; } .comm-header__info { flex-basis: 100%; } }
.comm-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 20px; align-items: start; }
.comm-side { display: grid; gap: 16px; position: sticky; top: calc(var(--topbar-h) + 18px); }
.comm-about, .comm-rules { padding: 20px; font-size: 14px; line-height: 1.5; }
.comm-about p { margin: 0 0 14px; }
.comm-facts { list-style: none; margin: 0; padding: 14px 0 0; border-top: 1px solid var(--border); display: grid; gap: 8px; color: var(--muted); }
.comm-rules ol { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.comm-compose {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 14px 18px; border: 1px solid var(--border);
  color: var(--muted); font: inherit; text-align: left; cursor: text;
}
.comm-compose span { flex: 1; padding: 11px 16px; border-radius: 999px; background: var(--bg); }
.comm-compose:hover span { box-shadow: inset 0 0 0 1px var(--primary); }
.comm-join-prompt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; font-size: 14px; }
.thread-form { padding: 22px; display: grid; gap: 14px; }
.thread-form__title { margin: 0; font-size: 16px; }
.thread-form__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.thread-form__spacer { flex: 1; }
.thread-form__image { position: relative; justify-self: start; max-width: 100%; }
.thread-form__image img { display: block; max-width: 100%; max-height: 320px; border-radius: 12px; border: 1px solid var(--border); }
.thread-form__remove {
  position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%;
  border: none; background: rgba(0, 0, 0, 0.65); color: #fff; font-size: 14px; cursor: pointer;
}
.thread-form__remove:hover { background: rgba(0, 0, 0, 0.85); }
.thread-form .field__error:empty { display: none; }

/* Threads */
.thread-card { display: flex; gap: 14px; padding: 18px 22px 12px 12px; }
.thread-card.is-pinned { box-shadow: inset 3px 0 0 #2f9e44; }
.thread-card__main { flex: 1; min-width: 0; }
.thread-meta { margin: 0; font-size: 13px; color: var(--muted); display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.thread-meta .name-link { color: var(--text); font-weight: 600; }
.thread-meta__comm { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--text); }
.thread-meta__comm:hover { color: var(--primary); }
.tag--pinned { background: color-mix(in srgb, #2f9e44 15%, var(--surface)); color: #2f9e44; }
.thread-card__title { margin: 8px 0 6px; font-size: 18px; line-height: 1.35; overflow-wrap: anywhere; }
.thread-card__title a:hover { color: var(--primary); }
.thread-card__title--full { font-size: 24px; margin: 10px 0 12px; }
.thread-card__body { margin: 0 0 6px; font-size: 14.5px; line-height: 1.55; color: var(--muted); white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.thread-card__text { margin: 0 0 16px; font-size: 15.5px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.thread-actions { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 0 -8px; }

/* Pictures in posts: shown whole, never cropped */
.thread-media__link { display: block; }
.thread-media {
  position: relative; overflow: hidden; margin: 12px 0 4px;
  border-radius: 14px; background: #111; display: grid; place-items: center;
}
.thread-media::before { /* blurred copy fills the empty sides of tall/narrow pictures */
  content: ""; position: absolute; inset: -20px;
  background: var(--media-src) center / cover no-repeat; filter: blur(24px) brightness(0.6);
}
.thread-media img { position: relative; display: block; max-width: 100%; max-height: 520px; object-fit: contain; }
.thread-media--full img { max-height: 78vh; }
.thread-media--art {
  aspect-ratio: 16 / 9; max-height: 360px; width: 100%;
  background: var(--media-bg); font-size: clamp(56px, 9vw, 96px);
}
.thread-media--art::before { content: none; }
.thread-media--full.thread-media--art { max-height: 440px; }
.thread-media__link:hover .thread-media { filter: brightness(1.04); }
.thread-action {
  border: none; background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600;
  padding: 6px 8px; border-radius: 6px; cursor: pointer;
}
a.thread-action:hover, button.thread-action:hover { background: var(--bg); color: var(--text); }
.thread-action--static { cursor: default; }
.thread-action--danger:hover { color: var(--like); background: var(--danger-soft); }

/* Votes */
.votes { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: none; width: 40px; }
.votes--small { flex-direction: row; width: auto; gap: 4px; }
.votes__btn {
  width: 28px; height: 26px; display: grid; place-items: center;
  border: none; border-radius: 6px; background: none; color: var(--muted); font-size: 13px;
}
.votes__btn:hover { background: var(--bg); }
.votes__btn--up:hover, .votes__btn--up[aria-pressed="true"] { color: #f76707; }
.votes__btn--down:hover, .votes__btn--down[aria-pressed="true"] { color: #5b5bd6; }
.votes__btn[aria-pressed="true"] { background: var(--bg); }
.votes__score { font-weight: 700; font-size: 13px; min-width: 2ch; text-align: center; }
.votes__score.is-up { color: #f76707; }
.votes__score.is-down { color: #5b5bd6; }

/* Comments */
.comments { padding: 22px; }
.comments__title { margin: 0 0 14px; font-size: 17px; }
.comments__empty { margin: 12px 0 0; }
.comment-form { display: grid; gap: 8px; margin-bottom: 18px; }
.comment-form textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); font: inherit; resize: vertical; outline: none;
}
.comment-form textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--tint); }
.comment-form__actions { display: flex; justify-content: flex-end; gap: 6px; }
.comment-form--reply { margin: 6px 0 6px 4px; }
.cmt-list, .cmt__children { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cmt-list { margin-top: 16px; }
.cmt__children { margin: 8px 0 0 11px; padding-left: 18px; border-left: 2px solid var(--border); }
.cmt__children:hover { border-left-color: var(--dash); }
.cmt { padding-top: 4px; }
.cmt__head { display: flex; align-items: center; gap: 6px; font-size: 13px; flex-wrap: wrap; }
.cmt__head .name-link { font-weight: 600; }
.cmt__head .avatar { --size: 22px; font-size: 9px; }
.cmt__toggle { border: none; background: none; color: var(--muted); padding: 0 2px; font-size: 14px; line-height: 1; cursor: pointer; }
.cmt__toggle:hover { color: var(--primary); }
.tag--op { background: var(--tint); color: var(--primary); font-size: 11px; padding: 1px 6px; }
.cmt__body p { margin: 6px 0 4px 26px; font-size: 14.5px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.cmt__actions { display: flex; align-items: center; gap: 2px; margin-left: 20px; }

/* Create / edit dialog */
.icon-options { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-option { position: relative; cursor: pointer; }
.icon-option input { position: absolute; opacity: 0; }
.icon-option span[aria-hidden] { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--bg); font-size: 20px; border: 2px solid transparent; }
.icon-option input:checked + span { border-color: var(--primary); background: var(--tint); }
.icon-option input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
/* Your communities (feed side column) */
.comm-side-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 4px; }
.comm-side-list a { display: flex; align-items: center; gap: 10px; padding: 6px; margin: 0 -6px; border-radius: 10px; }
.comm-side-list a:hover { background: var(--bg); }
.comm-side-list a > span:last-child { display: grid; min-width: 0; }
.comm-side-list strong { font-size: 14px; }
.comm-side-list .muted { font-size: 12.5px; }
.comm-side__more { width: 100%; justify-content: center; }

/* Create / edit preview */
.comm-preview { border-radius: 12px; overflow: hidden; border: 1px solid var(--border); margin-bottom: 4px; }
.comm-preview__banner { height: 96px; background: var(--comm-bg); }
.comm-preview__icon { padding: 0 16px 12px; height: 34px; }
.comm-preview__icon .comm-icon--md { margin-top: -28px; }

.member-options { display: grid; gap: 4px; max-height: 180px; overflow: auto; }
.member-option { display: flex; align-items: center; gap: 8px; padding: 4px; border-radius: 8px; cursor: pointer; }
.member-option:hover { background: var(--bg); }
.member-option input { width: auto; flex: none; }

@media (max-width: 1100px) {
  .comm-layout { grid-template-columns: minmax(0, 1fr); }
  .comm-side { position: static; }
}

/* ---------- Personalization (Discover reasons + Settings) ---------- */
.discover-personal { margin: 0; font-size: 13px; }
.discover-personal a { color: var(--primary); font-weight: 600; }
.dc-why { font-size: 12px; font-weight: 600; color: var(--primary); }
.dc-tile--photo .dc-why, .dc-tile--reel .dc-why {
  position: absolute; top: 10px; left: 10px; max-width: calc(100% - 20px);
  padding: 3px 8px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.5); color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dc-tile--reel .dc-why { top: auto; bottom: 46px; } /* above the name bar, clear of the reel's own title text */
.dc-tile--person .dc-why { text-align: center; }

.signal-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.signal {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer;
}
.signal:hover { background: var(--bg); }
.signal input { width: auto; margin-top: 3px; flex: none; }
.signal__icon { font-size: 18px; line-height: 1.2; }
.signal__text { display: grid; gap: 2px; font-size: 14px; }
.signal__text .muted { font-size: 12.5px; }
.signal.is-locked, fieldset:disabled .signal { opacity: 0.5; cursor: default; }
fieldset:disabled .signal:hover, .signal.is-locked:hover { background: none; }

.learned { display: grid; gap: 10px; }
.learned .settings-legend { margin: 0; }
.interest-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.interest { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--bg); }
.interest__icon { font-size: 22px; }
.interest__text { flex: 1; display: grid; gap: 4px; font-size: 14px; min-width: 0; }
.interest__text .muted { font-size: 12.5px; }
.interest__bar { height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; max-width: 260px; }
.interest__bar span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.learned .chip { margin: 2px; }

.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 0 0 6px; border-bottom: 1px solid var(--border); }
.data-table td { padding: 8px 0; border-bottom: 1px solid var(--border); }
.data-table th:last-child, .data-table td:last-child { text-align: right; white-space: nowrap; }

/* ---------- Who can see a profile section ---------- */
.section__audience { flex: none; font-size: 12px; font-weight: 600; color: var(--muted); padding: 2px 8px; border-radius: 999px; background: var(--bg); white-space: nowrap; }
.section__who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -4px 0 12px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.section__visibility {
  flex: 1 1 150px; min-width: 150px; max-width: 200px; height: 30px; padding: 0 10px;
  display: inline-flex; align-items: center; gap: 6px;
  border: none; border-radius: 999px; background: var(--bg); color: var(--text);
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; text-align: left;
}
.section__visibility:hover, .section__visibility[aria-expanded="true"] { background: var(--tint); }
.section__visibility:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.section__visibility .pi { width: 15px; height: 15px; color: var(--primary); }
.section__visibility-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.section__visibility .section__visibility-caret { width: 14px; height: 14px; color: var(--muted); }

/* ---------- Sign in / create account (login.html) ---------- */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; box-sizing: border-box; }
.auth-page { width: 100%; max-width: 440px; display: grid; gap: 18px; justify-items: center; }
.auth-logo { font-size: 40px; }
.auth-card { width: 100%; box-sizing: border-box; padding: 28px; display: grid; gap: 14px; }
.auth-title { margin: 0; font-size: 24px; }
.auth-card > .muted, .auth-small { margin: 0; font-size: 14px; line-height: 1.5; }
.auth-tabs .chip { border: 1px solid var(--border); }
.auth-tabs .chip[aria-pressed="true"] { background: var(--tint); color: var(--primary); border-color: transparent; font-weight: 600; }
.auth-form { display: grid; gap: 14px; }
.btn--lg { padding: 12px 18px; font-size: 16px; }
.btn--block { width: 100%; justify-content: center; box-sizing: border-box; }
.auth-switch { margin: 0; text-align: center; font-size: 14px; }
.auth-demo { margin: 4px 0 0; text-align: center; font-size: 13px; border-top: 1px solid var(--border); padding-top: 14px; }
.auth-demo a, .auth-problem a { color: var(--primary); font-weight: 600; }
.auth-error { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--danger-soft); color: var(--like); font-size: 14px; }
.auth-problem { margin: 0; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, #f59f00 14%, var(--surface)); font-size: 14px; line-height: 1.5; }
.auth-check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.auth-check input { width: auto; }
a.btn[aria-disabled="true"] { opacity: 0.5; }
.auth-footnote { margin: 0; text-align: center; font-size: 13px; line-height: 1.5; max-width: 380px; }

/* Recovery code box (sign-up and Settings) */
.recovery-code { display: grid; gap: 10px; padding: 16px; border-radius: 12px; border: 2px dashed var(--primary); background: var(--tint); }
.recovery-code h3 { margin: 0; font-size: 16px; }
.recovery-code p { margin: 0; font-size: 13.5px; line-height: 1.5; }
.recovery-code__value {
  display: block; padding: 12px; border-radius: 10px; background: var(--surface); text-align: center;
  font: 700 18px/1.3 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 1px; word-break: break-all; user-select: all;
}
.recovery-code__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Account section in Settings */
.account-who { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.account-who > span:nth-child(2) { flex: 1; min-width: 200px; }
.account-who__avatar {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, #5b5bd6, #d6336c); color: #fff; font-weight: 800;
}
.passkey-list, .device-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.passkey, .device-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--bg); }
.passkey__icon, .device-row__icon { font-size: 20px; }
.passkey__text, .device-row__text { flex: 1; display: grid; gap: 2px; font-size: 14px; min-width: 0; }
.passkey__text .muted, .device-row__text .muted { font-size: 12.5px; }
.settings-section code, .auth-card code { font-family: ui-monospace, Menlo, monospace; font-size: 0.92em; }

/* ---------- "Still a demo" note (pages not on the server yet, when signed in) ---------- */
.demo-banner {
  max-width: 1168px;
  margin: 16px auto 0;
  padding: 10px 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}
.demo-banner strong { color: var(--text); }
@media (max-width: 1200px) { .demo-banner { margin: 16px 16px 0; } }

/* ---------- End-to-end encrypted messages (signed in) ---------- */
.thread-e2ee { font-size: 13px; color: var(--muted); max-width: 420px; margin: 10px auto 0 !important; line-height: 1.45; }
.security-code { display: block; margin-top: 6px; }
.security-code code {
  display: inline-block; padding: 4px 8px; border-radius: 8px; background: var(--bg);
  font-size: 14px; letter-spacing: 0.04em; color: var(--text); margin-bottom: 4px;
}
.msg--locked { font-style: italic; opacity: 0.75; }
.msg--pending { opacity: 0.6; }

/* ---------- Long names and usernames ----------
   They wrap onto a new line (even in the middle of a very long word) instead of pushing
   buttons out of their box. Only text that would otherwise stick out is broken up. */
.name-link, .profile-card__name, .profile-header__name, .person-card__body, .request__body,
.suggestion__info, .post__header > div, .sr-text, .comment__body, .notification__text, .chat-list__name {
  overflow-wrap: anywhere;
}
.post__header > div, .sr-text { min-width: 0; }
.sr-text { flex: 1; }
.profile-header__info { min-width: min(300px, 100%); }

/* Phones: the top bar's buttons fit without the page scrolling sideways */
@media (max-width: 480px) {
  .topbar__inner { gap: 8px; padding: 0 10px; }
  .topbar__actions { gap: 2px; }
  .topbar__actions .icon-btn { width: 36px; height: 36px; }
}

/* ---------- Welcome checklist (new accounts, home page) ---------- */
.welcome { position: relative; display: grid; gap: 6px; }
.welcome__title { margin: 0; font-size: 20px; padding-right: 32px; }
.welcome > .muted { margin: 0 0 4px; }
.welcome__close { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border: none; border-radius: 50%; background: var(--bg); color: var(--muted); cursor: pointer; }
.welcome__close:hover { color: var(--text); }
.welcome__steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.welcome__steps a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; color: var(--text); }
.welcome__steps a:hover { background: var(--bg); }
.welcome__steps a > span:last-child { display: grid; min-width: 0; }
.welcome__steps .muted { font-size: 13px; }
.welcome__icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--bg); font-size: 17px; flex: none; }
.welcome__steps .is-done strong { text-decoration: line-through; color: var(--muted); }
#suggestions-empty { margin: 0; }
.people__empty .btn--link-inline { margin-left: 4px; }

/* ---------- Sign-up: step 2, privacy ---------- */
.auth-step { display: inline-block; margin-bottom: 4px; padding: 2px 10px; border-radius: 999px; background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); font-size: 12px; font-weight: 700; }
.privacy-presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 8px 0 4px; }
.privacy-preset {
  display: grid; gap: 4px; align-content: start; text-align: left;
  padding: 12px; border: 2px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text);
  font: inherit; cursor: pointer;
}
.privacy-preset:hover { border-color: color-mix(in srgb, var(--primary) 50%, var(--border)); }
.privacy-preset[aria-pressed="true"] { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, var(--surface)); }
.privacy-preset__icon { font-size: 22px; }
.privacy-preset .muted { font-size: 12.5px; line-height: 1.35; }
.privacy-preset__note { display: inline-block; margin-left: 2px; padding: 0 6px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 10.5px; font-weight: 700; vertical-align: 2px; }
.privacy-step__group { margin-top: 10px; }
.privacy-custom { margin: 6px 0 14px; }
.privacy-custom__toggle { cursor: pointer; color: var(--primary); font-weight: 600; font-size: 14px; padding: 6px 0; width: fit-content; list-style: none; }
.privacy-custom__toggle::-webkit-details-marker { display: none; }
.privacy-custom__toggle::after { content: " ▸"; }
.privacy-custom[open] .privacy-custom__toggle::after { content: " ▾"; }
@media (max-width: 520px) { .privacy-presets { grid-template-columns: 1fr; } }
.demo-banner--tour { align-items: center; }
.demo-banner--tour .btn { margin-left: auto; flex: none; }

/* About page for visitors without an account */
.is-visitor .sidebar--left, .is-visitor .topbar__actions, .is-visitor .topbar .search { display: none; }
.is-visitor .layout { grid-template-columns: minmax(0, 1fr); max-width: 860px; }
.about-hero__actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 12px 0 0; }
.auth-step { justify-self: start; width: fit-content; }

/* ---------- Blocking and reporting (js/safety.js) ---------- */
.safety-dialog { width: min(460px, calc(100vw - 24px)); }
.safety-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; line-height: 1.45; }
.safety-reasons { display: grid; gap: 2px; margin: 0; padding: 0; border: none; }
.safety-reason { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.safety-reason:hover { background: var(--bg); }
.safety-reason:has(input:checked) { background: var(--accent-soft, var(--bg)); font-weight: 600; }
.safety-check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.4; cursor: pointer; }
.safety-check input { margin-top: 3px; }
.safety-error { margin: 0; color: var(--like); font-weight: 600; font-size: 14px; }
.safety-dialog .btn--danger { background: var(--like); color: #fff; border-color: transparent; }
.safety-dialog .btn--danger:hover { filter: brightness(0.92); background: var(--like); color: #fff; }
.safety-menu {
  position: absolute;
  z-index: 200;
  min-width: 180px;
  padding: 6px;
  display: grid;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.04);
  animation: menu-in 0.12s ease-out;
}
.safety-menu__item { text-align: left; padding: 9px 12px; border: none; border-radius: 8px; background: none; font: inherit; color: inherit; cursor: pointer; }
.safety-menu__item:hover, .safety-menu__item:focus-visible { background: var(--bg); }
.safety-menu__item.is-danger { color: var(--like); }
.blocked-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.blocked-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.blocked-list .muted { overflow-wrap: anywhere; }
.comment__more {
  align-self: center; flex: none; width: 28px; height: 28px; border: none; border-radius: 50%;
  background: none; color: var(--muted); cursor: pointer; opacity: 0; transition: opacity 0.15s, background 0.15s;
}
.comment:hover .comment__more, .comment__more:focus-visible, .comment__more[aria-expanded="true"] { opacity: 1; }
.comment__more:hover { background: var(--bg); }
@media (hover: none) { .comment__more { opacity: 1; } }
.admin-page { display: grid; gap: 12px; align-content: start; min-width: 0; }
.admin-intro h1 { margin: 0 0 6px; font-size: 22px; }
.admin-intro .tabs { margin-top: 12px; }
.admin-report { display: grid; gap: 6px; min-width: 0; }
.admin-report p { margin: 0; overflow-wrap: anywhere; }
.admin-report.is-closed { opacity: 0.7; }
.admin-report__head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin-report__content { margin: 4px 0; padding: 10px 12px; background: var(--bg); border-radius: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-report__actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- What you do + interests (profile) ---------- */
.profile-about { margin: 6px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.profile-about__empty { margin: 6px 0 0; font-size: 14px; }
.interest-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.interest-tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--bg); color: var(--text); text-decoration: none; overflow-wrap: anywhere;
}
.interest-tag:hover { background: var(--border); }
.interest-tag.is-shared { background: var(--tint); color: var(--primary); }
.interest-tag.is-shared::before { content: "★ "; }
.edit-about .field-row { margin: 0; }
.interest-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; align-items: center; }
.interest-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 999px;
  background: var(--tint); color: var(--primary); font-weight: 600; font-size: 13px; max-width: 100%; overflow-wrap: anywhere;
}
.interest-chip button { border: none; background: none; color: inherit; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; flex: none; }
.interest-chip button:hover { background: rgba(0, 0, 0, 0.08); }
.interest-add { display: flex; gap: 8px; }
.interest-add input { flex: 1; min-width: 0; }
.interest-suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.interest-idea { border: 1px dashed var(--border); background: none; color: var(--muted); border-radius: 999px; padding: 3px 10px; font-size: 13px; cursor: pointer; }
.interest-idea:hover { color: var(--text); border-color: var(--muted); }
.check-row { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.4; cursor: pointer; }
.check-row input { margin-top: 3px; }
.suggestion__info .muted { overflow-wrap: anywhere; }
.edit-about select { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font: inherit; background: var(--surface); color: var(--text); }
.edit-about select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--tint); outline: none; }

/* Settings → Account → Email sign-in */
.email-signin-form { display: grid; gap: 10px; max-width: 420px; margin: 6px 0 12px; }
.email-signin { display: inline-flex; gap: 6px; align-items: center; overflow-wrap: anywhere; }

/* Sidebar menu: "More" folds away the pages you use less */
.menu__more { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-radius: 8px; width: 100%; border: 0; background: none;
  font: inherit; font-weight: 500; color: var(--muted); cursor: pointer; text-align: left; }
.menu__more .pill { margin-left: auto; }
.menu__more:hover { color: inherit; background: var(--bg); }
.menu__rest { display: contents; }
.menu__rest[hidden] { display: none; }
.menu__item--divider { border-top: 1px dashed var(--border); border-radius: 0; margin-top: 4px; padding-top: 8px; }
.menu__item--divider .menu__label { font-size: 13px; color: var(--muted); }

/* Sign in: passkey or email, side by side */
.auth-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 6px; }
.auth-methods__label { grid-column: 1 / -1; font-weight: 600; font-size: 14px; }
.auth-method { display: grid; gap: 2px; justify-items: start; text-align: left; padding: 10px 12px; border: 1.5px solid var(--border);
  border-radius: 12px; background: var(--surface); color: inherit; font: inherit; cursor: pointer; }
.auth-method:hover { border-color: color-mix(in srgb, var(--primary) 50%, var(--border)); }
.auth-method[aria-pressed="true"] { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, var(--surface)); }
.auth-method__icon { font-size: 18px; }
.auth-method .muted { font-size: 12.5px; line-height: 1.3; }

/* Sign-up: "✓ Verified student at …" */
.auth-verified { margin: 0; padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, #12b886 14%, var(--surface)); font-size: 14px; }

/* Home: the "+" circles in an empty Friends row, and the empty side cards */
.story--action { cursor: pointer; font: inherit; color: inherit; text-decoration: none; }
.story--action .story__ring { background: none; border: 2px dashed var(--border); padding: 1px; }
.story--action:hover .story__ring { border-color: var(--primary); }
.story__action-icon { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: var(--bg); font-size: 24px; color: var(--primary); }
.suggestions-empty__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
#upcoming-events > .btn--sm { margin-top: 10px; }

/* ---------- Pager's icons (images/icons.svg, via pagerIcon() in js/data.js) ---------- */
.pi { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.28em; overflow: visible; }
.icon-btn .pi { width: 22px; height: 22px; }
.menu__item .pi, .sb-add-option .pi, .menu__label .pi { width: 20px; height: 20px; margin-right: 4px; }
.menu__item:not(.active) .pi { color: var(--muted); }
.menu__item:hover .pi { color: inherit; }
.tb-edit__icon .pi { width: 20px; height: 20px; }
.action { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.action .pi { width: 19px; height: 19px; }
.action.liked .pi, .post__likes .pi, .ig-action.is-liked .pi, .reel-btn.is-on[data-reel-action="like"] .pi,
.heart-burst .pi, .blog-like.is-liked .pi { color: #C8102E; }
:root[data-theme="dark"] :is(.action.liked, .post__likes, .ig-action.is-liked, .reel-btn.is-on[data-reel-action="like"], .heart-burst) .pi { color: #E0354A; }
.post__likes { display: inline-flex; align-items: center; gap: 4px; }
.post__likes .pi { width: 15px; height: 15px; }
.reel-btn__icon .pi { width: 26px; height: 26px; }
.reel-ctrl .pi { width: 20px; height: 20px; }
.ig-action .pi { width: 24px; height: 24px; }
.heart-burst .pi { width: 1em; height: 1em; }
.photo__overlay .pi { width: 1.1em; height: 1.1em; color: #fff; }
.saved-header__title .pi { width: 0.9em; height: 0.9em; vertical-align: -0.1em; }
.story__action-icon .pi { width: 24px; height: 24px; }
.composer__photo { display: inline-flex; align-items: center; gap: 6px; }
.composer__photo .pi { width: 18px; height: 18px; }
.topbar-customize .pi, .sb-customize .pi { width: 16px; height: 16px; }
.welcome__icon .pi { width: 20px; height: 20px; }
.welcome__steps .is-done .welcome__icon .pi { color: #1f9d55; }

/* Icons in friends, edit profile and customize */
.friends-empty__icon .pi { width: 44px; height: 44px; color: var(--muted); stroke-width: 1.6; }
.profile-locked__icon .pi { width: 30px; height: 30px; }
.picker-item__icon .pi { width: 26px; height: 26px; color: var(--primary); }
.ctrl { display: inline-grid; place-items: center; }
.ctrl .pi { width: 15px; height: 15px; }
.sb-controls .ctrl .pi { width: 14px; height: 14px; }
.btn .pi { width: 17px; height: 17px; vertical-align: -0.22em; margin-right: 2px; }
.photo-btn--avatar .pi { margin: 0; }
.profile-about .pi, .section__audience .pi { width: 16px; height: 16px; color: var(--muted); }
.movie-option__poster .pi { width: 20px; height: 20px; color: var(--muted); }

/* Icons in messages, photos, reels and communities */
.thread-empty__icon .pi { width: 48px; height: 48px; color: var(--muted); stroke-width: 1.6; }
.reels-empty__icon .pi { width: 52px; height: 52px; color: var(--muted); stroke-width: 1.6; }
.reel-form__pick-icon .pi { width: 40px; height: 40px; }
.reels-nav__btn .pi { width: 20px; height: 20px; }
.send-btn .pi { width: 18px; height: 18px; vertical-align: middle; }
.msg-react-btn .pi { width: 18px; height: 18px; color: var(--muted); }
.thread-back .pi { width: 22px; height: 22px; vertical-align: middle; }
.thread-action .pi, .tag .pi { width: 15px; height: 15px; vertical-align: -0.2em; }
.chip .pi { width: 15px; height: 15px; vertical-align: -0.2em; }
.comm-hero__title .pi { width: 0.95em; height: 0.95em; vertical-align: -0.12em; color: var(--primary); }
.privacy-option__icon .pi { width: 22px; height: 22px; }
.ig-delete .pi { width: 17px; height: 17px; }
.reel__sound-name .pi { width: 14px; height: 14px; flex: none; }
.thread-e2ee .pi, .msg-post--gone .pi, .msg-reel__badge .pi { width: 14px; height: 14px; vertical-align: -0.15em; }
.back-link .pi { width: 16px; height: 16px; vertical-align: -0.2em; }

/* Icons in calendar, blogs, saved and settings */
.saved-empty__icon .pi { width: 40px; height: 40px; color: var(--muted); stroke-width: 1.6; }
.settings-header__title .pi, .settings-section__title .pi, .cal__heading .pi { width: 0.95em; height: 0.95em; vertical-align: -0.12em; color: var(--primary); }
.passkey__icon .pi, .device-row__icon .pi { width: 20px; height: 20px; }
.signal__icon .pi { width: 18px; height: 18px; }
.data-table .pi, .cal-item .pi, .blog-meta-item .pi, .blog-post-row__stats .pi, .breadcrumb .pi,
.blog-draft-note .pi, .email-signin .pi, .events-hidden-note .pi, .cal-agenda__more .pi, summary .pi, .learned .pi { width: 15px; height: 15px; vertical-align: -0.2em; }
.cal-item .pi { color: var(--kind-color, currentColor); }
.intro__list .pi { width: 17px; height: 17px; color: var(--muted); margin-right: 2px; vertical-align: -0.25em; }
.ranked .pi { width: 16px; height: 16px; color: var(--muted); margin-right: 2px; vertical-align: -0.22em; }

/* Post audience icons */
.audience-icon .pi { width: 14px; height: 14px; vertical-align: -0.18em; color: var(--muted); }
.ig-header .audience-icon .pi { width: 15px; height: 15px; }
.composer__audience .pi { width: 15px; height: 15px; vertical-align: -0.2em; }
.composer__audience .audience-btn__caret { width: 13px; height: 13px; opacity: .7; }
.audience-option__icon .pi { width: 20px; height: 20px; }
.audience-menu__note .pi { width: 14px; height: 14px; vertical-align: -0.18em; }

/* Search icons */
.sr-thumb--icon .pi { width: 20px; height: 20px; }
.sr-thumb .pi { width: 22px; height: 22px; color: #fff; }
.sr-thumb--icon .pi { color: inherit; }
.search-panel__group .pi { width: 14px; height: 14px; vertical-align: -0.18em; margin-right: 2px; }
.search-section__title .pi, .search-header__title .pi { width: 0.95em; height: 0.95em; vertical-align: -0.12em; color: var(--primary); }
.search-recent .pi { width: 14px; height: 14px; vertical-align: -0.18em; }

/* About page icons */
.about-features__icon .pi { width: 26px; height: 26px; color: var(--primary); }
.about-section__title .pi { width: 0.95em; height: 0.95em; vertical-align: -0.12em; color: var(--primary); }

/* Icons in Discover, Events, notifications, sign-in and the rest */
.notif__type .pi { width: 13px; height: 13px; color: var(--primary); }
.notif__type--like .pi { color: #C8102E; }
:root[data-theme="dark"] .notif__type--like .pi { color: #E0354A; }
.interest__icon .pi { width: 22px; height: 22px; color: var(--primary); }
.dc-tile__emoji .pi { width: 56px; height: 56px; color: rgba(255, 255, 255, 0.9); stroke-width: 1.6; }
.dc-tile__badge .pi, .dc-tile__overlay .pi { width: 13px; height: 13px; vertical-align: -0.15em; }
.dc-why .pi, .dc-card__kicker .pi, .discover-personal .pi, .discover-filter .pi { width: 14px; height: 14px; vertical-align: -0.18em; }
.discover-header__title .pi { width: 0.95em; height: 0.95em; vertical-align: -0.12em; color: var(--primary); }
.event-cover__emoji .pi { width: 48px; height: 48px; color: rgba(255, 255, 255, 0.9); stroke-width: 1.6; }
.event-cover--large .event-cover__emoji .pi { width: 72px; height: 72px; }
.event-card__meta .pi, .guest .pi, .invite-banner .pi, .event-detail .pi, .notif__text .pi { width: 15px; height: 15px; vertical-align: -0.2em; }
.share-quick__icon .pi { width: 22px; height: 22px; }
.auth-method__icon .pi { width: 20px; height: 20px; color: var(--primary); }
.privacy-preset__icon .pi { width: 24px; height: 24px; color: var(--primary); }
.auth-problem .pi, .auth-footnote .pi, .recovery-code h3 .pi { width: 16px; height: 16px; vertical-align: -0.2em; }
.demo-banner > .pi { width: 20px; height: 20px; flex: none; color: var(--primary); }
.story__action-icon .pi { width: 24px; height: 24px; }
.add-section .pi, .profile-about__empty .pi { width: 15px; height: 15px; vertical-align: -0.2em; }
.auth-verified .pi { width: 16px; height: 16px; vertical-align: -0.2em; }

/* Picked icons: blogs, communities and group chats */
.emoji-picker__option .pi { width: 18px; height: 18px; }
.icon-option .pi { width: 20px; height: 20px; }
.icon-option input:checked + span .pi, .emoji-picker__option input:checked + span .pi { color: var(--primary); }
.comm-icon .pi { width: calc(var(--size) * 0.5); height: calc(var(--size) * 0.5); color: #fff; vertical-align: 0; }
.chat-avatar--group .pi { width: calc(var(--size, 40px) * 0.5); height: calc(var(--size, 40px) * 0.5); color: var(--primary); vertical-align: 0; }
.blog-cover .pi, .dc-card__cover .pi { width: 1em; height: 1em; color: #fff; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2)); }

/* ---------- Badges (profile section, js/sections.js) ---------- */
.badges { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.badge-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border));
  font-size: 0.875rem; font-weight: 600; color: var(--text); }
.badge-chip__icon { display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%;
  background: var(--primary); color: #fff; }
.badge-chip__icon .pi { width: 16px; height: 16px; }
.badge-picks { display: grid; gap: 6px; }
.badge-pick { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.badge-pick:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
.field .badge-pick input { flex: none; width: 18px; height: 18px; margin: 0; padding: 0; accent-color: var(--primary); }
.badge-pick__text { display: grid; gap: 1px; font-size: 0.875rem; }
.badge-pick__text span { color: var(--muted); font-size: 0.8125rem; }
.badge-pick.is-locked { cursor: default; opacity: 0.6; }
.badge-pick.is-locked .badge-chip__icon { background: var(--border); color: var(--muted); }

/* ---------- Media tab (profile.html?tab=media, js/media.js) ---------- */
.media-tab { padding: 16px; display: grid; gap: 20px; }
.media-tab__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.media-tab__actions { display: flex; align-items: center; gap: 8px; }
.media-tab__actions .btn .pi { width: 16px; height: 16px; }
.media-tab__loading { margin: 0; }
.media-tab__empty .pi, .media-tab > .empty > .pi { width: 32px; height: 32px; color: var(--muted); }
.media-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.media-kind { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); font: inherit; font-size: 0.875rem; font-weight: 600; cursor: pointer; }
.media-kind .pi { width: 16px; height: 16px; }
.media-kind:hover { background: var(--bg); }
.media-kind.is-active { color: var(--primary); border-color: var(--primary); background: var(--tint); }
.media-kind__count { font-size: 0.75rem; font-weight: 700; opacity: 0.8; }
.media-group { display: grid; gap: 10px; }
.media-group__title { margin: 0; font-size: 0.9375rem; }
.media-group__title .muted { font-weight: 500; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 116px)); gap: 14px 12px; }
.media-card { display: grid; gap: 3px; align-content: start; padding: 0; border: none; background: none; color: inherit; font: inherit; text-align: left; min-width: 0; }
button.media-card { cursor: pointer; }
button.media-card:hover .media-cover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18); }
.media-card__title { font-size: 0.8125rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; }
.media-card__meta { font-size: 0.75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-card__stars { display: flex; gap: 1px; color: #f59f00; }
.media-card__stars .pi { width: 12px; height: 12px; }
.media-card__stars .pi:not(.is-on) { color: var(--border); }
.media-cover { position: relative; display: block; aspect-ratio: 2 / 3; border-radius: 6px; overflow: hidden; background: var(--bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); transition: transform 0.15s, box-shadow 0.15s; }
.media-cover.is-square { aspect-ratio: 1; }
.media-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-cover--none { background: var(--poster-bg); display: grid; place-items: center; padding: 6px; }
.media-cover--none span { color: #fff; font-size: 0.75rem; font-weight: 700; text-align: center; line-height: 1.2;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.media-cover--thumb { width: 40px; flex: none; }
.media-cover--small { width: 64px; flex: none; }
.media-cover--thumb.media-cover--none span { font-size: 0; }

/* Add / edit dialog */
.modal.media-dialog { width: min(520px, calc(100vw - 32px)); }
.media-kinds--dialog .media-kind { flex: 1; justify-content: center; }
.media-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.media-result { display: flex; align-items: center; gap: 12px; width: 100%; padding: 6px 8px; border: none; border-radius: 8px;
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.media-result:hover, .media-result:focus-visible { background: var(--bg); }
.media-result > span:last-child, .media-picked > div { display: grid; gap: 2px; min-width: 0; }
.media-result .muted, .media-picked .muted { font-size: 0.8125rem; }
.media-results__note, .media-results__via { padding: 6px 8px; font-size: 0.8125rem; }
.media-results__via { text-align: right; font-size: 0.75rem; }
.media-manual summary { cursor: pointer; color: var(--muted); font-size: 0.875rem; }
.media-manual[open] { display: grid; gap: 12px; }
.media-manual[open] summary { margin-bottom: 4px; }
.media-manual__row { display: grid; grid-template-columns: 1fr 90px; gap: 10px; }
.media-manual .btn { justify-self: start; }
.media-picked { display: flex; align-items: center; gap: 14px; }
.media-status { display: flex; flex-wrap: wrap; gap: 8px; border: none; padding: 0; margin: 0; }
.media-status legend { margin-bottom: 8px; }
.media-status__option { position: relative; }
.field .media-status__option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.media-status__option span { display: inline-block; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); font-size: 0.875rem; font-weight: 600; cursor: pointer; }
.media-status__option input:checked + span { color: var(--primary); border-color: var(--primary); background: var(--tint); }
.media-status__option input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.media-rate { border: none; padding: 0; margin: 0; }
.media-rate legend { margin-bottom: 6px; }
.media-rate__stars { display: flex; align-items: center; gap: 2px; }
.media-rate__star { border: none; background: none; padding: 2px; color: var(--border); cursor: pointer; }
.media-rate__star .pi { width: 28px; height: 28px; }
.media-rate__star.is-on { color: #f59f00; }
.media-rate__stars .btn--link-inline { margin-left: 8px; }
.media-dialog__remove { margin-right: auto; }
.media-dialog__remove .pi { width: 16px; height: 16px; }

/* ---------- Media page (media.html, js/media-page.js) ---------- */
.media-page { display: grid; gap: 16px; align-content: start; min-width: 0; }
.media-page__note { padding: 16px; margin: 0; }
.media-page__back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; text-decoration: none; justify-self: start; }
.media-page__back:hover { color: var(--text); }
.media-page__back .pi { width: 16px; height: 16px; }
.media-hero { padding: 20px; display: grid; gap: 10px; }
.media-hero__title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.5rem; }
.media-hero__title .pi { width: 26px; height: 26px; color: var(--primary); }
.media-hero p { margin: 0; }
.media-hero__search { display: flex; align-items: center; gap: 8px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg); }
.media-hero__search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--tint); }
.media-hero__search .pi { width: 18px; height: 18px; color: var(--muted); flex: none; }
.media-hero__search input { flex: 1; min-width: 0; border: none; background: none; padding: 11px 0; font: inherit; color: var(--text); outline: none; }
a.media-result { text-decoration: none; }
.media-block { padding: 16px; display: grid; gap: 12px; }
.media-block__header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.media-block__header h2 { margin: 0; font-size: 1.0625rem; }
.media-block > p { margin: 0; }
a.media-card { text-decoration: none; }
a.media-card:hover .media-cover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18); }
.media-activity { list-style: none; margin: 0; padding: 0; display: grid; }
.media-activity__item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.media-activity__item:first-child { border-top: none; padding-top: 0; }
.media-activity__text { flex: 1; min-width: 0; display: grid; gap: 3px; }
.media-activity__text p { margin: 0; }
.media-activity__time { font-size: 0.75rem; }
.media-picked__link { font-size: 0.8125rem; font-weight: 600; color: var(--primary); }

/* One film */
.film { overflow: hidden; padding: 0; }
.film__backdrop { height: 200px; position: relative; }
.film__backdrop img { width: 100%; height: 100%; object-fit: cover; display: block; }
.film__backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, var(--surface)); }
.film__main { display: grid; grid-template-columns: 180px 1fr; gap: 24px; padding: 20px; }
.film__backdrop + .film__main { margin-top: -90px; position: relative; }
.film__poster .media-cover { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); }
.film__info { display: grid; gap: 10px; align-content: start; min-width: 0; }
.film__backdrop + .film__main .film__info { padding-top: 90px; }
.film__title { margin: 0; font-size: 1.75rem; line-height: 1.15; }
.film__info p { margin: 0; }
.film__overview { line-height: 1.55; }
.film__cast { font-size: 0.875rem; }
.film__you { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.film__you .btn .pi { width: 16px; height: 16px; }
.film__you-status { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--primary); }
.film__you-status .pi { width: 18px; height: 18px; }
.film__you-stars .pi { width: 16px; height: 16px; }
.film__via { margin: 0; padding: 0 20px 16px; font-size: 0.75rem; }
.film__columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.film__score { display: flex; align-items: baseline; gap: 10px; }
.film__average { font-size: 2rem; color: #f59f00; }
.film__bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: 0.8125rem; }
.film__bars li { display: grid; grid-template-columns: 28px 1fr 24px; align-items: center; gap: 8px; }
.film__bar { height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.film__bar span { display: block; height: 100%; background: #f59f00; border-radius: 999px; }
.film__counts, .film__note { margin: 0; font-size: 0.8125rem; }
.film__note { font-size: 0.75rem; }
.film__people { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.film__people li { display: flex; align-items: center; gap: 10px; }
.film__person { flex: 1; display: grid; min-width: 0; }
.film__person .muted { font-size: 0.8125rem; }
@media (max-width: 720px) {
  .film__main { grid-template-columns: 110px 1fr; gap: 14px; }
  .film__title { font-size: 1.35rem; }
  .film__columns { grid-template-columns: 1fr; }
}

/* Media page: space between the boxes, tabs, and film profiles */
.media-page__body { display: grid; gap: 16px; align-content: start; min-width: 0; }
.media-tabs { padding: 0; margin-top: 2px; }
.media-tabs .tab { text-decoration: none; }
.media-activity__sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 0.75rem; }
.media-activity__films { font-size: 0.75rem; font-weight: 600; color: var(--primary); text-decoration: none; }
.media-activity__films:hover { text-decoration: underline; }
.film-profile { padding: 20px; display: grid; gap: 18px; }
.film-profile__who { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.film-profile__avatar { --size: 56px; }
.film-profile__name { flex: 1; min-width: 160px; display: grid; gap: 2px; }
.film-profile__name h2 { margin: 0; font-size: 1.25rem; }
.film-profile__name a { font-size: 0.8125rem; text-decoration: none; }
.film-profile__name a:hover { text-decoration: underline; }
.film-profile__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.film-profile__actions .btn .pi { width: 16px; height: 16px; }
.film-profile__stats { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 28px; padding-top: 16px; border-top: 1px solid var(--border); }
.film-profile__stat { display: grid; gap: 2px; }
.film-profile__stat strong { font-size: 1.5rem; line-height: 1; }
.film-profile__stat span { font-size: 0.8125rem; }
.film-profile__bars { list-style: none; margin: 0 0 0 auto; padding: 0; display: flex; align-items: flex-end; gap: 3px; height: 40px; }
.film-profile__bars li { width: 12px; height: 100%; display: flex; align-items: flex-end; background: var(--bg); border-radius: 3px; }
.film-profile__bars li span { display: block; width: 100%; background: #f59f00; border-radius: 3px; }

/* Watch it together, taste match and recommendations (js/media-page.js) */
.watch-together { display: flex; align-items: center; gap: 14px; padding: 14px 16px; flex-wrap: wrap;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border)); background: color-mix(in srgb, var(--primary) 6%, var(--surface)); }
.watch-together__faces { display: flex; }
.watch-together__faces .avatar { margin-left: -8px; box-shadow: 0 0 0 2px var(--surface); }
.watch-together__faces .avatar:first-child { margin-left: 0; }
.watch-together__text { flex: 1; min-width: 180px; display: grid; gap: 2px; }
.watch-together__text .muted { font-size: 0.8125rem; }
.watch-together .btn .pi, .taste__plan .pi { width: 16px; height: 16px; }
.media-block__header h2 { display: flex; align-items: center; gap: 8px; }
.media-block__header h2 .pi { width: 18px; height: 18px; color: var(--primary); }
.media-block__hint { margin: -4px 0 0; font-size: 0.8125rem; }
.media-card__why { font-size: 0.75rem; color: var(--primary); font-weight: 600; line-height: 1.3; }
.taste { gap: 14px; }
.taste__score { display: flex; align-items: center; gap: 14px; }
.taste__score strong { font-size: 2.25rem; line-height: 1; color: var(--primary); }
.taste__score span { font-weight: 600; }
.taste__basis { margin: 0; font-size: 0.875rem; }
.taste__want h3 { margin: 0 0 8px; font-size: 0.9375rem; }
.taste__want ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.taste__want li { display: flex; align-items: center; gap: 12px; }
.taste__film { flex: 1; min-width: 0; }
.taste__plan { padding: 6px 12px; font-size: 0.8125rem; }
.media-match { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 0.8125rem; font-weight: 700;
  color: var(--primary); background: var(--tint); text-decoration: none; }
.media-match .pi { width: 14px; height: 14px; }

/* Where to watch, on a film's page (js/media-page.js) */
.watch { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; }
.watch__title { margin: 0; font-size: 0.9375rem; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.watch__more { font-size: 0.8125rem; font-weight: 600; color: var(--primary); text-decoration: none; }
.watch__row { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 8px; }
.watch__label { font-size: 0.8125rem; }
.watch__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.watch__list li { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; background: var(--bg); font-size: 0.8125rem; font-weight: 600; }
.watch__list img { width: 24px; height: 24px; border-radius: 6px; display: block; }
.watch__list li:not(:has(img)) { padding-left: 10px; }

/* Half stars: the rating picker (js/media.js) and the film page chart */
.media-rate__star { position: relative; display: inline-block; padding: 2px; color: var(--border); }
.media-rate__star.is-on { color: #f59f00; }
.media-rate__star .pi { width: 30px; height: 30px; display: block; }
.media-rate__half { position: absolute; top: 0; bottom: 0; width: 50%; padding: 0; border: none; background: none; cursor: pointer; }
.media-rate__half--left { left: 0; }
.media-rate__half--right { right: 0; }
.media-rate__half:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; border-radius: 4px; }
.media-rate__value { min-width: 34px; margin-left: 8px; font-weight: 700; color: #f59f00; }
.media-rate .field__hint { display: block; margin-top: 4px; }
.film__histogram { display: flex; align-items: flex-end; gap: 8px; font-size: 0.75rem; }
.film__histogram .film__bars { flex: 1; display: flex; align-items: flex-end; gap: 3px; height: 56px; }
.film__histogram .film__bars li { flex: 1; height: 100%; display: flex; align-items: flex-end; background: var(--bg); border-radius: 3px; }
.film__histogram .film__bars li span { display: block; width: 100%; background: #f59f00; border-radius: 3px; }

/* Top 4 films picked from search link to their film page */
.top4__link { display: block; color: inherit; text-decoration: none; }
.top4__link:hover figcaption { text-decoration: underline; }

/* Media page: the Films / Books / Music / Games switch, and album track lists */
.media-hero__kinds .media-kind { text-decoration: none; }
.film__tracks { font-size: 0.875rem; border-top: 1px solid var(--border); padding-top: 8px; }
.film__tracks summary { cursor: pointer; font-weight: 600; color: var(--primary); }
.film__tracks ol { margin: 8px 0 0; padding-left: 1.6em; display: grid; gap: 3px; max-height: 320px; overflow: auto; }
.film__tracks li span:first-child { margin-right: 8px; }

/* Polls: in the composer, and on posts */
.composer__poll-toggle { display: inline-flex; align-items: center; gap: 6px; }
.composer__poll-toggle .pi { width: 18px; height: 18px; }
.composer__poll-toggle.is-active { color: var(--primary); border-color: var(--primary); background: var(--tint); }
.composer__poll { display: grid; gap: 8px; margin: 4px 0 10px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; }
.composer__poll-options { display: grid; gap: 6px; }
.composer__poll-option { display: flex; gap: 6px; align-items: center; }
.composer__poll-option input { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; }
.composer__poll-option input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--tint); }
.composer__poll-remove { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border: none; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.composer__poll-remove:hover { background: var(--bg); color: var(--text); }
.composer__poll-remove .pi { width: 16px; height: 16px; }
.composer__poll-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.composer__poll-add[hidden] { display: none; }
.composer__poll-length { display: inline-flex; align-items: center; gap: 6px; font-size: 0.875rem; color: var(--muted); }
.composer__poll-length select { padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.composer__poll-note { margin: 0; font-size: 0.8125rem; display: flex; align-items: center; gap: 6px; }
.composer__poll-note .pi { width: 14px; height: 14px; }

.post__text--question { font-weight: 600; }
.poll { display: grid; gap: 6px; padding: 0 16px 12px; }
.poll__option { padding: 10px 14px; border: 1.5px solid var(--primary); border-radius: 999px; background: none; color: var(--primary);
  font: inherit; font-weight: 600; text-align: center; cursor: pointer; }
.poll__option:hover { background: var(--tint); }
.poll__result { position: relative; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; text-align: left; overflow: hidden; }
button.poll__result { cursor: pointer; }
button.poll__result:hover { border-color: var(--primary); }
.poll__bar { position: absolute; inset: 0 auto 0 0; background: var(--bg); transition: width 0.3s ease; }
.poll__result.is-mine .poll__bar, .poll__result.is-top .poll__bar { background: var(--tint); }
.poll__result.is-mine { border-color: var(--primary); }
.poll__label, .poll__pct { position: relative; }
.poll__label { flex: 1; display: inline-flex; align-items: center; gap: 6px; }
.poll__result.is-top .poll__label, .poll__result.is-mine .poll__label { font-weight: 600; }
.poll__pct { font-weight: 600; font-variant-numeric: tabular-nums; }
.poll__check { width: 16px; height: 16px; color: var(--primary); }
.poll__meta { margin: 2px 0 0; font-size: 0.8125rem; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.poll__anon { display: inline-flex; align-items: center; gap: 4px; }
.poll__anon .pi { width: 13px; height: 13px; }
@media (prefers-reduced-motion: reduce) { .poll__bar { transition: none; } }

/* Polls in group chats */
.chat-poll-btn { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border: none; border-radius: 50%;
  background: var(--bg); color: var(--muted); cursor: pointer; }
.chat-poll-btn:hover { color: var(--primary); background: var(--tint); }
.chat-poll-btn .pi { width: 20px; height: 20px; }
.msg-poll { display: grid; gap: 6px; width: 290px; max-width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.msg-poll__q { margin: 0 0 2px; font-weight: 600; display: flex; gap: 6px; align-items: flex-start; }
.msg-poll__q .pi { flex: none; width: 18px; height: 18px; color: var(--primary); margin-top: 2px; }
.msg-poll__option { padding: 8px 12px; font-size: 0.9375rem; }
.msg-poll__who { position: relative; display: inline-flex; }
.msg-poll__who .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }
.msg-poll__meta { margin: 2px 0 0; font-size: 0.8125rem; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.msg-poll__plan { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--primary); text-decoration: none; }
.msg-poll__plan .pi { width: 14px; height: 14px; }
.chat-poll-dialog__answers { display: grid; gap: 6px; border: none; padding: 0; margin: 0; }
.chat-poll-dialog__note { margin: 0; font-size: 0.8125rem; display: flex; gap: 6px; align-items: center; }
.chat-poll-dialog__note .pi { width: 14px; height: 14px; flex: none; }

/* Trending artists, authors, people in film and studios (Media page, Discover) */
.trend-row + .trend-row, .trend-row + #trending-world { margin-top: 14px; }
.trend-row__label { margin: 0 0 8px; font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.trend-row__list { list-style: none; margin: 0; padding: 0 0 4px; display: grid; grid-auto-flow: column; grid-auto-columns: 96px; gap: 12px; overflow-x: auto; }
.trend { display: grid; justify-items: center; gap: 4px; text-align: center; text-decoration: none; color: var(--text); }
.trend__img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; background: var(--bg); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); }
.trend__img--none { display: grid; place-items: center; background: var(--poster-bg, var(--primary)); color: #fff; font-weight: 700; font-size: 1.25rem; }
.trend:hover .trend__name { color: var(--primary); }
.trend__name { font-size: 0.875rem; font-weight: 600; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.trend__sub { font-size: 0.75rem; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#trending-world .muted { margin: 0; }
.media-page__body > *, .trend-row { min-width: 0; }

/* Reviews: writing one (in the add/edit dialog) */
.media-review { display: grid; gap: 6px; }
.media-review textarea { width: 100%; min-height: 96px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg);
  color: var(--text); font: inherit; line-height: 1.45; resize: vertical; }
.media-review textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--tint); }
.media-review__spoiler { display: flex; gap: 8px; align-items: flex-start; font-size: 0.875rem; }
.field .media-review__spoiler input { width: 16px; height: 16px; margin-top: 2px; flex: none; }

/* Reviews: reading them (Media page) */
.reviews { display: grid; gap: 0; }
.review { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--border); }
.reviews > .review:first-child { border-top: none; padding-top: 4px; }
.review__cover { flex: none; }
.review__body { flex: 1; min-width: 0; display: grid; gap: 6px; }
.review__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.875rem; }
.review__head .name-link { font-weight: 600; }
.review__when { font-size: 0.8125rem; }
.review__item { margin: 0; font-size: 0.9375rem; }
.review__text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.review__text.is-clamped { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.review__more { justify-self: start; }
.review__spoiler { justify-self: start; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px dashed var(--border);
  border-radius: 10px; background: var(--bg); color: var(--muted); font: inherit; font-size: 0.875rem; cursor: pointer; }
.review__spoiler:hover { color: var(--text); border-color: var(--primary); }
.review__spoiler .pi { width: 16px; height: 16px; }
.review__foot { display: flex; align-items: center; gap: 14px; font-size: 0.8125rem; }
.review__like { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; margin-left: -8px; border: none; border-radius: 999px;
  background: none; color: var(--muted); font: inherit; cursor: pointer; }
.review__like:hover { background: var(--bg); color: var(--text); }
.review__like.is-liked { color: #e0245e; }
.review__like .pi, .review__likes .pi, .review__foot .btn--link-inline .pi { width: 15px; height: 15px; vertical-align: -0.2em; }
.review__likes { display: inline-flex; align-items: center; gap: 4px; }
.review__report { color: var(--muted); }
.review-sorts { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.reviews__next { margin-top: 14px; }
.media-card__reviewed { width: 13px; height: 13px; margin-left: 4px; color: var(--muted); }

/* ---------- Importing from Letterboxd, IMDb, Goodreads and StoryGraph (js/media-import.js) ---------- */
.media-import { width: min(500px, calc(100vw - 32px)); }
.media-import .modal__body > p:first-child { margin-top: 0; }
.media-import__sources { list-style: none; padding: 0; margin: 12px 0 16px; display: grid; gap: 10px; font-size: 0.875rem; line-height: 1.4; }
.media-import__pick { cursor: pointer; }
.media-import__privacy { display: flex; gap: 6px; align-items: flex-start; font-size: 0.8125rem; margin: 14px 0 0; }
.media-import__privacy .pi { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.media-import__options { display: grid; gap: 8px; margin: 10px 0 14px; }
.media-import__option { display: flex; gap: 10px; align-items: center; cursor: pointer; }
.media-import__note { font-size: 0.8125rem; margin: 6px 0 0; }
.media-import__group { margin: 14px 0 4px; }
.ig-import__audience { border: 1px solid var(--border, rgba(0,0,0,0.12)); border-radius: 12px; padding: 10px 14px 12px; margin: 14px 0 0; display: grid; gap: 6px; }
.ig-import__audience legend { font-weight: 600; padding: 0 4px; }
.ig-import__audience-option { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.875rem; }
.ig-import__audience-option svg { width: 16px; height: 16px; flex: none; }
.media-import__group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.media-import__group-head h3 { font-size: 0.9375rem; margin: 0; }
.media-import__picks { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; max-height: 260px; overflow-y: auto; }
.media-import__picks .media-import__option { align-items: flex-start; font-size: 0.875rem; }
.media-import__picks input { margin-top: 3px; flex: none; }
.media-import__progress { width: 100%; height: 8px; }
.media-import__done { text-align: center; padding: 8px 0; }
.media-import__done p { margin: 6px 0; }
.media-import__done > .pi { width: 36px; height: 36px; }
.film-profile__importing { display: flex; gap: 6px; align-items: center; font-size: 0.8125rem; margin: 12px 0 0; }
.film-profile__importing .pi { width: 14px; height: 14px; flex: none; }
.media-import__done > .pi { color: var(--primary); }

/* ---------- Importing posts from Instagram (js/instagram-import.js) ---------- */
.profile-import { margin: -4px 0 12px; text-align: right; font-size: 0.8125rem; }
.link-btn { background: none; border: none; padding: 0; color: var(--primary); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.ig-import { width: min(640px, calc(100vw - 32px)); }
.ig-import .modal__body > p:first-child { margin-top: 0; }
.ig-import__steps { padding-left: 20px; margin: 10px 0 6px; display: grid; gap: 6px; font-size: 0.875rem; line-height: 1.45; }
.ig-import__small { font-size: 0.8125rem; margin: 6px 0 14px; }
.ig-import__pick { cursor: pointer; }
.ig-import__promises { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; font-size: 0.8125rem; }
.ig-import__promises li { display: flex; gap: 8px; align-items: flex-start; }
.ig-import__promises .pi { width: 14px; height: 14px; flex: none; margin-top: 2px; color: var(--muted); }
.ig-import__bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.ig-import__bar p { margin: 0; }
.ig-import__bulk { display: flex; gap: 6px; }
.ig-import__grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.ig-post { position: relative; display: block; border-radius: 8px; overflow: hidden; cursor: pointer; background: var(--tint); }
.ig-post input { position: absolute; top: 6px; left: 6px; width: 18px; height: 18px; z-index: 1; accent-color: var(--primary); }
.ig-post__img { display: grid; place-items: center; aspect-ratio: 1; color: var(--muted); }
.ig-post__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ig-post:has(input:not(:checked)) .ig-post__img { opacity: 0.45; }
.ig-post.is-disabled { cursor: not-allowed; }
.ig-post__date { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 4px; font-size: 0.6875rem; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, 0.6)); }
.ig-post__more { position: absolute; top: 6px; right: 6px; font-size: 0.6875rem; font-weight: 600; color: #fff; background: rgba(0, 0, 0, 0.55); border-radius: 999px; padding: 1px 6px; }
.ig-import__notes { font-size: 0.8125rem; margin-top: 12px; }
.ig-import__notes p { margin: 4px 0; }

/* ---------- The apps you can import from (js/import-apps.js: Settings and signing up) ---------- */
.import-apps { list-style: none; padding: 0; margin: 12px 0 16px; display: grid; gap: 8px; }
.import-app { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; color: inherit; text-decoration: none; background: var(--surface); transition: border-color 0.15s, background 0.15s; }
.import-app:hover, .import-app:focus-visible { border-color: var(--primary); background: var(--tint); }
.import-app__icon { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; background: var(--tint); color: var(--primary); flex: none; }
.import-app__icon .pi { width: 18px; height: 18px; }
.import-app__text { display: grid; gap: 1px; flex: 1; min-width: 0; text-align: left; }
.import-app__text .muted { font-size: 0.8125rem; }
.import-app__go { color: var(--muted); font-size: 1.1rem; }
.ig-post__img--text { place-items: stretch; padding: 8px 8px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; font-size: 0.75rem; line-height: 1.3; color: var(--text); text-align: left; overflow: hidden; }
.ig-post__img--text span { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; padding-left: 20px; }
.ig-post:has(.ig-post__img--text) .ig-post__date { color: var(--muted); background: none; }

/* After importing: share them all from your profile, undo from Settings */
.imported-note { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 12px; font-size: 0.875rem; }
.imported-note__text { display: flex; gap: 8px; align-items: flex-start; }
.imported-note__text .pi { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--muted); }
.imported-note__actions { display: flex; gap: 12px; align-items: center; }
.imports-done { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.imports-done li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; }
.imports-done .btn .pi { width: 14px; height: 14px; }


/* ---------- Pager on your phone (js/pwa.js) ---------- */
.app-steps { margin: 6px 0 10px; padding-left: 22px; display: grid; gap: 4px; font-size: 0.875rem; }
.app-steps__share svg { width: 16px; height: 16px; vertical-align: -3px; }
.push-kinds { display: grid; gap: 10px; margin: 8px 0 10px; }
.push-kind { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.push-kind input { margin-top: 3px; flex: none; }
.push-kind span { display: grid; }
.push-kind .muted { font-size: 0.8125rem; }
.app-tip {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 900;
  padding: 14px 40px 14px 16px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2); font-size: 0.9rem;
}
.app-tip p { margin: 0 0 8px; }
.app-tip__close { position: absolute; top: 8px; right: 8px; border: 0; background: none; color: inherit; font-size: 1rem; padding: 6px; cursor: pointer; }
/* Installed as an app: room for the phone's status bar and home bar */
@media (display-mode: standalone) {
  body { padding-bottom: env(safe-area-inset-bottom); }
}
