/*
 * Styles for individual app pages: profiles, friends, notifications, search, settings, the
 * admin page, the test-account bar, verification, the profile layout editor and the pickers for
 * pinned posts and featured photos. Each section names its page or component. Loaded on every
 * page by index.html.
 */

/* ---------- Profile ---------- */

.profile__header {
  overflow: hidden;
}

.profile__cover {
  height: 200px;
  background:
    radial-gradient(circle at 20% 30%, hsl(var(--hue) 70% 70% / 0.9), transparent 60%),
    radial-gradient(circle at 85% 70%, hsl(calc(var(--hue) + 40) 70% 65% / 0.9), transparent 60%),
    hsl(var(--hue) 40% 82%);
}

.profile__cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile__info {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 0 24px 22px;
}

.profile__avatar {
  margin-top: -60px;
}

.profile__avatar .avatar {
  box-shadow: var(--shadow);
}

.profile__actions {
  position: absolute;
  top: 16px;
  right: 24px;
}

.profile__name {
  margin-top: 8px;
  font-family: var(--font-serif);
  font-size: 1.9rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.profile__username {
  color: var(--ink-faint);
}

.profile__bio {
  max-width: 480px;
  margin-top: 8px;
  font-size: 1.02rem;
}

.profile__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.profile__facts li {
  display: flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 560px) {
  .profile__cover {
    height: 140px;
  }
  .profile__info {
    padding: 0 16px 18px;
  }
  .profile__avatar .avatar {
    --size: 96px;
  }
  .profile__actions {
    position: static;
    order: 10;
    margin-top: 12px;
  }
}

/* Editing the header in place (components/profile-header-editor.js, ?edit=profile) */

.profile-edit {
  display: grid;
  gap: 12px;
}

.profile-edit__bar {
  position: sticky;
  top: calc(var(--topbar-height) + 8px);
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.profile-edit__title {
  display: grid;
  gap: 2px;
}

.profile-edit__more {
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.profile-edit__buttons {
  display: flex;
  gap: 8px;
}

.profile-edit__cover {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  cursor: pointer;
}

.profile-edit__badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.profile-edit__avatar {
  position: relative;
  justify-self: start;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}

.profile-edit__avatar-img {
  display: block;
}

.profile-edit__avatar-badge {
  position: absolute;
  right: 4px;
  bottom: 4px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
}

.profile-edit__cover:focus-visible,
.profile-edit__avatar:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.profile-edit__cover.is-drop-target,
.profile-edit__avatar.is-drop-target {
  outline: 3px dashed var(--accent);
  outline-offset: -3px;
}

.profile-edit__fields {
  display: grid;
  gap: 12px;
  max-width: 520px;
  margin-top: 12px;
}

@media (max-width: 820px) {
  .profile-edit__buttons {
    flex: 1;
    justify-content: flex-end;
  }
  .profile-edit__fields {
    max-width: none;
  }
}

/* ---------- Friends ---------- */

.list-section {
  padding: 8px 16px;
}

.list-section + .list-section {
  border-top: 1px solid var(--line);
}

.list-section__title {
  padding: 10px 0 2px;
  color: var(--ink-faint);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- Notifications ---------- */

.notifications {
  overflow: hidden;
}

/* One notification row; unread ones are highlighted. */
.notification {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  transition: background 0.15s;
}

.notification + .notification {
  border-top: 1px solid var(--line);
}

.notification:hover {
  background: var(--surface-muted);
}

.notification.is-unread {
  background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface));
}

.notification__text {
  flex: 1;
}

.notification__text time {
  color: var(--ink-faint);
  font-size: 0.82rem;
}

.notification__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Search ---------- */

.search-page {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-faint);
}

.search-page:focus-within {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

.search-page__input {
  height: 48px;
  padding: 0;
  border: 0;
  background: none;
}

.search-page__input:focus {
  box-shadow: none;
}

.page .card > .user-row {
  padding: 10px 16px;
}

.page .card > .user-row + .user-row {
  border-top: 1px solid var(--line);
}

/* ---------- Settings ---------- */

.settings__card {
  display: grid;
  gap: 14px;
  padding: 22px 24px;
}

.settings__title {
  font-size: 1.1rem;
}

.settings__description {
  margin-top: -8px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.settings__photos {
  position: relative;
  display: grid;
}

.settings__cover {
  height: 140px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, hsl(var(--hue) 65% 72%), hsl(calc(var(--hue) + 40) 65% 68%));
}

.settings__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.settings__avatar {
  margin: -48px 0 0 20px;
}

.settings__avatar .avatar {
  --size: 96px;
  border: 4px solid var(--surface);
}

.settings__photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.settings__facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 24px;
}

.settings__facts dt {
  color: var(--ink-faint);
}

.settings__facts a {
  color: var(--accent-text);
  font-weight: 600;
}

.settings .btn--danger-ghost {
  justify-self: start;
}

/* Settings sections: a menu on the left, one section at a time on the right. */
.settings__layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  align-items: start;
  gap: 20px;
}

.settings__menu {
  position: sticky;
  top: calc(var(--topbar-height) + 24px);
  display: grid;
  gap: 2px;
}

.settings__menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--ink-soft);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.settings__menu-item:hover {
  background: var(--surface-sunken);
  color: var(--ink);
}

.settings__menu-item[aria-current="page"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.settings__heading {
  font-family: var(--font-serif);
  font-size: 1.35rem;
}

.settings__title--space {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings__badge {
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-sunken);
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 600;
}

@media (max-width: 960px) {
  .settings__layout {
    grid-template-columns: minmax(0, 1fr);
  }
  /* A row of section buttons that scrolls sideways. */
  .settings__menu {
    position: static;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .settings__menu-item {
    flex: none;
    padding: 8px 12px;
  }
}

/* ---------- Admin page (pages/admin.js) ---------- */

.admin__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin__checks {
  display: grid;
  gap: 2px;
  padding: 0;
  list-style: none;
}

.admin__check {
  display: grid;
  grid-template-columns: 12px 120px 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

.admin__light {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.admin__check--slow .admin__light {
  background: #e0a030;
  box-shadow: 0 0 8px #e0a030;
}

.admin__check--failing .admin__light {
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
}

.admin__status {
  font-weight: 600;
}

.admin__check--failing .admin__status {
  color: var(--danger);
}

.admin__note,
.admin__ms,
.admin__when {
  color: var(--ink-faint);
}

.admin__note {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin__numbers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.admin__number {
  display: grid;
  gap: 2px;
  padding: 16px;
}

.admin__number strong {
  font-size: 1.6rem;
}

.admin__number span {
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.admin__number--alert {
  border-color: var(--danger);
}

.admin__number--alert strong {
  color: var(--danger);
}

.admin__error {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
}

.admin__error.is-resolved {
  opacity: 0.65;
}

.admin__error-kind {
  margin-right: auto;
}

.admin__count {
  font-weight: 700;
}

.admin__error-message {
  font-weight: 500;
  overflow-wrap: anywhere;
}

.admin__where {
  color: var(--ink-soft);
  font-family: ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.admin__stack summary {
  cursor: pointer;
  font-weight: 600;
}

.admin__stack pre {
  max-height: 320px;
  margin-top: 8px;
  padding: 12px;
  overflow: auto;
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  font-size: 0.78rem;
  white-space: pre-wrap;
}

.admin__accounts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.admin__account {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.admin__account-name {
  display: grid;
  flex: 1;
  min-width: 0;
}

.admin__account-name span {
  color: var(--ink-faint);
  font-size: 0.85rem;
}

.admin__roles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  list-style: none;
}

.admin__roles li {
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-sunken);
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.admin__log {
  display: grid;
  padding: 6px 18px;
  list-style: none;
}

.admin__log li {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.admin__when {
  margin-left: auto;
}

.admin__tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.admin__tool {
  display: flex;
  gap: 12px;
  padding: 16px;
}

.admin__tool:hover {
  border-color: var(--line-strong);
}

@media (max-width: 560px) {
  .admin__check {
    grid-template-columns: 12px 1fr auto;
  }
  .admin__note,
  .admin__ms {
    grid-column: 2 / -1;
  }
}

/* ---------- Testing as a test account (components/shell.js) ---------- */

.testing-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 8px 16px;
  background: #e0a030;
  color: #1c1300;
  font-size: 0.9rem;
}

.testing-bar__back {
  padding: 4px 12px;
  border: 0;
  border-radius: var(--radius-pill);
  background: #1c1300;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* ---------- Settings → Verified account ---------- */

.verify__done {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--success);
  font-weight: 600;
}

.verify__secret {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  word-break: break-all;
  user-select: all;
}

.verify__codes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.verify__codes code {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--accent-soft);
  text-align: center;
}

.verify__about {
  margin: 0;
  padding-left: 1.2em;
  color: var(--ink-soft);
  line-height: 1.6;
}

.verify__photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
}

.verify__photos:empty {
  display: none;
}

.verify__photos img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.verify__consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.5;
}

.verify__consent input {
  margin-top: 4px;
  flex-shrink: 0;
}

/* Mirrored like a mirror, which is what people expect; the frames sent are not. */
.verify__webcam {
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius-sm);
  background: #000;
  transform: scaleX(-1);
}

.verify__prompt {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

/* ---------- Identities (Settings) ---------- */

.identity__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* ---------- Profile layout and background (pages/profile.js) ---------- */

.profile {
  container-type: inline-size;
}

/* A background from the points shop fills everything under the feed bar while
   the profile is open, in the light or dark look that suits its colours. */
.shell.shell--profile {
  min-height: calc(100vh - var(--topbar-height));
  background: var(--profile-background) fixed;
  color: var(--ink);
}

/* The left menu and the footer sit on the background, so they get a panel. */
.shell--profile .side-nav,
.shell--profile .rail__footer {
  padding: 8px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(6px);
}

/* Tabs sit on the background, so they get a surface of their own. */
.shell--profile .tabs {
  margin: 0;
  padding: 0 8px;
  border-radius: var(--radius);
  background: var(--surface);
}

/* A profile gets the whole screen under the top bar: the app's own left menu
   and right column step aside, and the profile's left and right columns take
   their place (the top bar and the phone's tab bar still get you around).
   Matched by what's on screen, not set by the page, so it holds on a fresh
   load too (the page is built before the frame around it exists). */
.shell:has(.profile__body) {
  grid-template-columns: minmax(0, 1fr);
}

.shell:has(.profile__body) > .shell__left,
.shell:has(.profile__body) > .shell__right {
  display: none;
}

/* The three columns. A phone stacks them with the side modules first, so
   nothing is stuck under an endless feed; a mid-size screen puts both side
   columns in one beside the middle; a wide one shows all three. */
.profile__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "head" "left" "right" "main";
  gap: 16px;
  align-items: start;
}

.profile__head { grid-area: head; min-width: 0; }
.profile__col--left { grid-area: left; }
.profile__col--main { grid-area: main; }
.profile__col--right { grid-area: right; }

/* Mid-size: the header across the top, both side columns sharing one. */
@container (min-width: 760px) {
  .profile__body.has-left,
  .profile__body.has-right {
    grid-template-columns: 270px minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    grid-template-areas: "head head" "left main" "right main";
  }
}

/* Wide: three columns from the top of the page, the header heading the middle one. */
@container (min-width: 1100px) {
  .profile__body.has-left.has-right {
    grid-template-columns: 280px minmax(0, 1fr) 280px;
    grid-template-rows: auto 1fr;
    grid-template-areas: "left head right" "left main right";
  }

  .profile__body.has-right:not(.has-left) {
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-template-rows: auto 1fr;
    grid-template-areas: "head right" "main right";
  }
}

/* A module card on a profile page. */
.profile-card {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
}

.profile-card__title {
  margin: 0;
  font-size: 1rem;
}

.profile-card__about {
  display: grid;
  gap: 8px;
}

.profile-card__about .profile__facts {
  margin: 0;
}

.profile-card .user-row {
  padding: 6px 0;
}

.profile-card__photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.profile-card__photos img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
}

/* ---------- Profile modules (components/profile-modules.js) ---------- */

.profile__col {
  min-width: 0;
}

.profile-group {
  display: grid;
  gap: 8px;
}

.profile-group__title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0 4px;
  font-size: 1rem;
}

/* Tabs on the page background, like the feeds' own tabs. */
.profile-group--tabs > .tabs {
  margin: 0;
}

/* In a tab group the tab already names the card. */
.profile-group--tabs .profile-card__title {
  display: none;
}

.shell--profile .profile-group__title {
  justify-self: start;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface);
}

.profile-pinned {
  display: grid;
  gap: 8px;
}

.profile-card__pick {
  justify-self: start;
}

.profile-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.profile-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-sunken);
  font-size: 0.9rem;
}

.profile-chip--link:hover {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.profile-rewards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.profile-reward {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  font-size: 0.85rem;
}

.profile-reward > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-reward__swatch {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

/* ---------- Live layout editor (components/profile-editor.js) ---------- */

.profile-editor {
  display: grid;
  gap: 16px;
}

.profile-editor__toolbar {
  position: sticky;
  top: calc(var(--topbar-height) + 8px);
  z-index: 5;
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.profile-editor__title {
  display: grid;
  gap: 2px;
}

.profile-editor__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.profile-editor__label {
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 600;
}

.profile-editor__check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
}

.profile-editor__spacer {
  flex: 1;
}

.profile-editor__drawer {
  max-height: 40vh;
  overflow-y: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.profile-editor__spare {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Modules not on the page yet, waiting in the editor's list to be added. */
.spare-module {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
}

.spare-module__name {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 8px;
  flex: 1;
  min-width: 0;
}

.spare-module__name .pref-note {
  grid-column: 2;
}

.profile-column {
  display: grid;
  min-height: 80px;
  border-radius: var(--radius);
}

.profile-column.is-empty {
  align-content: start;
  border: 2px dashed var(--line-strong);
}

.profile-column__empty {
  margin: 0;
  padding: 16px;
  color: var(--ink-faint);
  font-size: 0.9rem;
  text-align: center;
}

.edit-group {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  transition: box-shadow 120ms, border-color 120ms;
}

.edit-group__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.edit-group__chips {
  display: flex;
  flex: 1 1 180px;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.edit-group__buttons {
  display: flex;
  flex: none;
  gap: 2px;
  margin-left: auto;
}

.edit-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 2px 2px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 0.85rem;
  font-weight: 600;
}

.edit-chip__name {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.edit-chip .btn--icon {
  width: 26px;
  height: 26px;
}

.edit-group__grip {
  display: inline-flex;
  padding: 4px;
  border-radius: var(--radius-xs);
  color: var(--ink-faint);
}

.drag-handle {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.drag-handle:hover {
  color: var(--ink);
}

/* The preview is the real page, but only for looking: links and buttons
   inside don't fire, except tabs and the Choose buttons. */
.edit-group__preview {
  pointer-events: none;
}

.edit-group__preview .tabs,
.edit-group__preview .profile-card__pick {
  pointer-events: auto;
}

.edit-group__preview.is-feed {
  max-height: 420px;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, #000 70%, transparent);
}

/* Gaps between groups: thin until you drag, then wide enough to aim at. */
.edit-gap {
  height: 10px;
  border-radius: var(--radius-sm);
  transition: height 120ms, background 120ms;
}

.profile-editor.is-dragging .edit-gap {
  height: 28px;
  margin: 2px 0;
  border: 2px dashed var(--line);
}

.profile-editor.is-dragging .edit-gap.is-over {
  height: 56px;
  border-color: var(--accent);
  background: var(--accent-soft);
}

.profile-editor.is-dragging .edit-group.is-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.profile-editor.is-dragging {
  cursor: grabbing;
  user-select: none;
}

/* The see-through copy that follows the pointer while you drag a module. */
.drag-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
}

/* ---------- Pickers for Pinned post and Featured photos ---------- */

.dialog--wide {
  width: min(640px, calc(100vw - 32px));
}

.picker__content {
  max-height: 60vh;
  overflow-y: auto;
}

.picker__posts {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.picker__post {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.picker__post:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.picker__post img {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
}

.picker__post-text {
  display: grid;
  flex: 1;
  min-width: 0;
}

.picker__photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.picker__photo {
  position: relative;
  padding: 0;
  border: 3px solid transparent;
  border-radius: 8px;
  overflow: hidden;
}

.picker__photo img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.picker__photo.is-picked {
  border-color: var(--accent);
}

.picker__number {
  position: absolute;
  top: 6px;
  left: 6px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.8rem;
  font-weight: 700;
}

/* With a whole screen to fill, the side columns get roomier: a quarter each,
   between 330px and 480px. */
@container (min-width: 1400px) {
  .profile__body.has-left.has-right {
    grid-template-columns: clamp(330px, 24%, 480px) minmax(0, 1fr) clamp(330px, 24%, 480px);
  }
}

/* Profiles on computers: 5% of breathing room on each side of the page. */
@media (min-width: 821px) {
  .shell:has(.profile__body) {
    padding-inline: 5%;
  }
}

/* Photos in a profile's posts fill the card's full width with no empty bands beside them.
   The height follows the photo, but a very tall one (like a 9:16 phone shot) stops at a 4:5
   shape and is trimmed top and bottom; tapping it still opens the whole photo. */
.profile .post .slideshow {
  container-type: inline-size;
}

.profile .post .slideshow__slide img {
  height: auto;
  max-height: 125cqi;
  object-fit: cover;
}

/* Settings: the line between the four pages and Account, and the "How it works" panels. */
.settings__menu-divider {
  margin: 8px 14px;
  border: 0;
  border-top: 1px solid var(--line);
}

.settings__how {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.settings__how summary {
  color: var(--accent-text);
  font-weight: 600;
  cursor: pointer;
}

.settings__how .explainer__rules {
  margin-top: 8px;
}

/* A small heading inside a settings card, e.g. the two Blocked people lists. */
.settings__subhead {
  margin: 12px 0 4px;
  color: var(--ink-faint);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Work's Updates / Jobs / People / Companies live in the Work menu (left column on computers,
   the gear's slide-in panel on phones), so the page shows no tabs. */
.work-tabs {
  display: none;
}

/* "Top threads" on a public Forums profile (pages/public-identity.js). */
.profile-top {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}

.profile-top li {
  display: grid;
  gap: 2px;
}

.profile-top a {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.profile-top .muted {
  font-size: 0.85rem;
}
