/* ==========================================================================
   POPBOX APP SURFACE
   Components for the signed-in app (feed, cards, threads, dialogs).
   The marketing site keeps main.css; this file only styles .pop-* and the
   app nav rail, so the two never fight.
   ========================================================================== */

:root {
  --pop-surface: #2d2142;
  --pop-surface-raised: #3a2c55;
  --pop-ink: #ffffff;
  --pop-ink-muted: #cbbde4;
  --pop-line: rgba(255, 255, 255, 0.14);
  --pop-accent: var(--color__blue, #00a8e2);
  --pop-brand: var(--color__purple, #764fcc);
  --pop-danger: #ff6f61;
  --pop-radius: 14px;
  --pop-gap: 1rem;
}

/* ==========================================================================
   SEMANTIC-ELEMENT RESET
   main.css styles BARE elements for the marketing site — `header` gets a
   blue→purple gradient, `main` gets the dotted background, `footer` goes #222,
   `nav` is display:none. App components use semantic HTML, so every one of them
   inherits that unless its own class declares the property. Class selectors win
   on specificity, so the fix is simply to be explicit; nothing here is a hack.
   Anything new that renders a bare header/main/footer/nav needs a line here.
   ========================================================================== */
.feed,
.feed__intro,
.pop-thread__head {
  background: none;
}

/* The marketing body colour is near-black, which is invisible on the app's dark ground.
   Set it once at the app-surface root so anything added later inherits correctly. */
.feed-page,
.feed {
  color: var(--pop-ink);
}

.pop-card__foot {
  background: var(--pop-surface);
  color: inherit;
}

/* ==========================================================================
   APP NAV RAIL — the mobile app's five tabs
   ========================================================================== */
.site-nav__app {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-left: 2rem;
}

.site-nav__app-link {
  font-family: var(--font-headline);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 1.05rem;
  color: var(--pop-ink);
  text-decoration: none;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.site-nav__app-link:hover,
.site-nav__app-link:focus-visible {
  color: var(--pop-accent);
}

.site-nav__app-link--active {
  color: var(--pop-accent);
  border-bottom-color: var(--pop-accent);
}

.site-nav__action--compose {
  background: var(--pop-accent);
  color: #06121c;
  border-radius: 999px;
  padding: 0.4rem 1rem;
  font-weight: 600;
}

.site-nav__action--bell svg {
  width: 22px;
  height: 22px;
  display: block;
}

/* The rail collapses into the existing drawer on small screens. */
@media (max-width: 900px) {
  .site-nav__app {
    display: none;
  }
}

/* ==========================================================================
   CARD
   ========================================================================== */
.pop-card {
  background: var(--pop-surface);
  color: var(--pop-ink);
  border-radius: var(--pop-radius);
  overflow: hidden;
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.pop-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--pop-gap);
  padding: 0.75rem 1rem;
  background: var(--pop-surface-raised);
}

.pop-card__media {
  display: block;
  line-height: 0;
}

.pop-card__media img {
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: cover;
}

.pop-card__body {
  padding: 1rem;
}

.pop-card__title {
  font-family: var(--font-headline);
  text-transform: uppercase;
  font-size: 1.3rem;
  margin: 0 0 0.35rem;
}

.pop-card__title a {
  color: var(--pop-ink);
  text-decoration: none;
}

.pop-card__title a:hover,
.pop-card__title a:focus-visible {
  text-decoration: underline;
}

.pop-card__subtitle {
  margin: 0 0 0.5rem;
  color: var(--pop-ink-muted);
  font-size: 0.95rem;
}

.pop-card__text {
  margin: 0;
  line-height: 1.5;
}

.pop-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}

.pop-card__tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--pop-line);
  border-radius: 999px;
  color: var(--pop-ink-muted);
}

.pop-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--pop-gap);
  padding: 0.6rem 1rem 0.9rem;
  flex-wrap: wrap;
}

.pop-card__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pop-ink-muted);
}

.pop-card__why {
  border-top: 1px solid var(--pop-line);
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  color: var(--pop-ink-muted);
}

.pop-card__why summary {
  cursor: pointer;
}

.pop-card__why ul {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
}

/* ==========================================================================
   AVATAR CHIP
   ========================================================================== */
.pop-avatar-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.pop-avatar-chip__link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.pop-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--pop-brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pop-avatar-chip--compact .pop-avatar {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
}

.pop-avatar__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pop-avatar__initials {
  font-family: var(--font-headline);
  font-size: 0.95rem;
  color: #fff;
}

.pop-avatar-chip__name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pop-avatar-chip__secondary {
  font-size: 0.8rem;
  color: var(--pop-ink-muted);
  white-space: nowrap;
}

/* ==========================================================================
   FOLLOW PILL
   ========================================================================== */
.pop-follow {
  font-family: var(--font-headline);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: transparent;
  color: var(--pop-ink);
  border: 2px solid var(--pop-ink);
  border-radius: 6px;
  padding: 0.25rem 0.8rem;
  cursor: pointer;
  white-space: nowrap;
}

.pop-follow--small {
  font-size: 0.8rem;
  padding: 0.15rem 0.6rem;
}

.pop-follow--following {
  background: var(--pop-ink);
  color: var(--pop-surface);
}

.pop-follow:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ==========================================================================
   ACTION BAR
   ========================================================================== */
.pop-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  position: relative;
}

.pop-actions__btn {
  background: transparent;
  border: 0;
  padding: 0.35rem;
  color: var(--pop-ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  text-decoration: none;
  border-radius: 6px;
}

.pop-actions__btn svg {
  width: 22px;
  height: 22px;
  display: block;
}

.pop-actions__btn:hover:not(:disabled),
.pop-actions__btn:focus-visible {
  color: var(--pop-accent);
}

.pop-actions__btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.pop-actions__btn--on {
  color: var(--pop-accent);
}

.pop-actions__count {
  font-size: 0.85rem;
}

.pop-actions__overflow {
  position: relative;
}

.pop-actions__toast {
  margin: 0.4rem 1rem 0.8rem;
  font-size: 0.85rem;
  color: var(--pop-accent);
}

.pop-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  min-width: 200px;
  background: var(--pop-surface-raised);
  border: 1px solid var(--pop-line);
  border-radius: 10px;
  padding: 0.35rem;
  z-index: 40;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.pop-menu__item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--pop-ink);
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

.pop-menu__item:hover,
.pop-menu__item:focus-visible {
  background: rgba(255, 255, 255, 0.08);
}

.pop-menu__item--danger {
  color: var(--pop-danger);
}

/* ==========================================================================
   BUTTONS & FIELDS
   ========================================================================== */
.pop-btn {
  font-family: var(--font-headline);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  border: 2px solid transparent;
  cursor: pointer;
}

.pop-btn--primary {
  background: var(--pop-accent);
  color: #06121c;
}

.pop-btn--ghost {
  background: transparent;
  border-color: var(--pop-line);
  color: var(--pop-ink);
}

.pop-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.pop-link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--pop-ink-muted);
  cursor: pointer;
  font-size: 0.8rem;
  text-decoration: underline;
}

.pop-field {
  display: block;
  margin: 1rem 0;
}

.pop-field__label {
  display: block;
  font-size: 0.85rem;
  color: var(--pop-ink-muted);
  margin-bottom: 0.35rem;
}

.pop-field__input {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--pop-line);
  border-radius: 8px;
  color: var(--pop-ink);
  padding: 0.6rem 0.7rem;
  font: inherit;
  resize: vertical;
}

.pop-field__hint {
  display: block;
  font-size: 0.75rem;
  color: var(--pop-ink-muted);
  margin-top: 0.25rem;
}

.pop-radio {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  cursor: pointer;
}

/* ==========================================================================
   MODAL
   ========================================================================== */
.pop-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.pop-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 16, 32, 0.7);
}

.pop-modal__panel {
  position: relative;
  background: var(--pop-surface);
  color: var(--pop-ink);
  border-radius: var(--pop-radius);
  padding: 1.5rem;
  width: min(520px, 100%);
  max-height: 85vh;
  overflow-y: auto;
}

.pop-modal__title {
  font-family: var(--font-headline);
  text-transform: uppercase;
  margin: 0 0 0.5rem;
}

.pop-modal__lede {
  margin: 0 0 1rem;
  color: var(--pop-ink-muted);
  font-size: 0.9rem;
}

.pop-modal__reasons {
  border: 0;
  padding: 0;
  margin: 0;
}

.pop-modal__error {
  color: var(--pop-danger);
  font-size: 0.9rem;
}

.pop-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1rem;
}

/* ==========================================================================
   THREAD
   ========================================================================== */
.pop-thread {
  background: var(--pop-surface);
  color: var(--pop-ink);
  border-radius: var(--pop-radius);
  padding: 1.25rem;
}

.pop-thread__head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.pop-thread__title {
  font-family: var(--font-headline);
  text-transform: uppercase;
  margin: 0;
}

.pop-thread__count {
  color: var(--pop-ink-muted);
}

.pop-thread__composer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.6rem;
}

.pop-thread__error {
  color: var(--pop-danger);
  font-size: 0.85rem;
}

.pop-thread__empty {
  color: var(--pop-ink-muted);
}

.pop-thread__list {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
}

.pop-comment {
  border-top: 1px solid var(--pop-line);
  padding: 0.9rem 0;
}

.pop-comment__title {
  margin: 0.5rem 0 0.15rem;
  font-weight: 600;
}

.pop-comment__text {
  margin: 0.4rem 0 0.5rem;
  line-height: 1.5;
}

/* ==========================================================================
   INFINITE SCROLL
   ========================================================================== */
.pop-infinite {
  display: flex;
  justify-content: center;
  padding: 1.25rem 0;
}

.pop-infinite__status {
  color: var(--pop-ink-muted);
  font-size: 0.9rem;
}

/* Screen-reader-only text, in case a page using app.css loads without main.css. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   FEED PAGE
   ========================================================================== */
.feed-page {
  background: #0b1020;
  min-height: 100vh;
  padding: 2rem 1rem 4rem;
}

.feed {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
}

.feed__intro {
  margin-bottom: 1.5rem;
  color: var(--pop-ink);
}

.feed__intro h1 {
  font-family: var(--font-headline);
  text-transform: uppercase;
  margin: 0 0 0.35rem;
}

.feed__lede {
  margin: 0;
  color: var(--pop-ink-muted);
}

.feed__state {
  background: var(--pop-surface);
  color: var(--pop-ink);
  border-radius: var(--pop-radius);
  padding: 2rem 1.5rem;
  text-align: center;
}

.feed__state--error {
  border: 1px solid var(--pop-danger);
}

.feed__muted {
  color: var(--pop-ink-muted);
  font-size: 0.9rem;
}

.feed__muted a {
  color: var(--pop-accent);
}

/* ==========================================================================
   COMPOSER
   ========================================================================== */
.composer {
  background: var(--pop-surface);
  color: var(--pop-ink);
  border-radius: var(--pop-radius);
  padding: 1.5rem;
}

.composer__modes {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.composer__mode {
  font-family: var(--font-headline);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: transparent;
  color: var(--pop-ink-muted);
  border: 1px solid var(--pop-line);
  border-radius: 999px;
  padding: 0.35rem 1rem;
  cursor: pointer;
}

.composer__mode--active {
  background: var(--pop-accent);
  border-color: var(--pop-accent);
  color: #06121c;
}

.composer__link-row {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}

.composer__link-row .pop-field__input {
  flex: 1 1 auto;
}

.composer__preview {
  display: flex;
  gap: 1rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--pop-line);
  border-radius: 10px;
  padding: 0.9rem;
  margin-bottom: 1rem;
}

.composer__preview img {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 6px;
  flex: 0 0 auto;
}

.composer__preview-site {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pop-ink-muted);
}

.composer__preview-title {
  margin: 0.2rem 0;
  font-weight: 600;
}

.composer__preview-summary {
  margin: 0;
  font-size: 0.9rem;
  color: var(--pop-ink-muted);
}

.composer__actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

/* ==========================================================================
   MEDIA UPLOADER
   ========================================================================== */
.uploader__drop {
  display: block;
  position: relative;
  border: 2px dashed var(--pop-line);
  border-radius: 10px;
  padding: 1.75rem 1rem;
  text-align: center;
  cursor: pointer;
}

.uploader__drop:hover,
.uploader__drop:focus-within {
  border-color: var(--pop-accent);
}

.uploader__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.uploader__prompt {
  display: block;
  pointer-events: none;
}

.uploader__hint {
  display: block;
  font-size: 0.85rem;
  color: var(--pop-ink-muted);
  margin-top: 0.3rem;
}

.uploader__errors {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  color: var(--pop-danger);
  font-size: 0.85rem;
}

.uploader__previews {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
}

.uploader__preview {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 8px;
  overflow: hidden;
}

.uploader__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.uploader__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(11, 16, 32, 0.85);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

/* ==========================================================================
   POST DETAIL — link source block
   ========================================================================== */
.post-source {
  background: var(--pop-surface);
  color: var(--pop-ink);
  border-radius: var(--pop-radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.post-source__site {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pop-ink-muted);
}

.post-source__summary {
  margin: 0.4rem 0 0.6rem;
  line-height: 1.5;
}

.post-source__link {
  color: var(--pop-accent);
}

/* ==========================================================================
   PHASE 2 — COMMUNITY
   Note the semantic-element reset above: any bare header/main/footer/nav in
   these components needs a line there or main.css claims it.
   ========================================================================== */
.feed--wide {
  max-width: 900px;
}

.site-nav__action--bell {
  position: relative;
}

.site-nav__badge {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--pop-danger);
  color: #fff;
  font-size: 0.7rem;
  line-height: 18px;
  text-align: center;
}

/* --- Profile --------------------------------------------------------------- */
.profile {
  background: var(--pop-surface);
  border-radius: var(--pop-radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.profile__banner {
  height: 180px;
  background: linear-gradient(120deg, var(--pop-brand), var(--pop-accent));
}

.profile__banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile__identity {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  padding: 0 1.25rem;
  margin-top: -40px;
}

.profile__avatar {
  width: 88px;
  height: 88px;
  flex: 0 0 88px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--pop-surface);
  background: var(--pop-brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile__initials {
  font-family: var(--font-headline);
  font-size: 2rem;
  color: #fff;
}

.profile__name-block {
  flex: 1 1 auto;
  min-width: 0;
  padding-bottom: 0.4rem;
}

.profile__name {
  font-family: var(--font-headline);
  text-transform: uppercase;
  margin: 0;
  font-size: 1.6rem;
}

.profile__verified {
  color: var(--pop-accent);
  font-size: 1rem;
}

.profile__title {
  margin: 0;
  color: var(--pop-ink-muted);
  font-size: 0.9rem;
}

.profile__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0 1.25rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pop-ink-muted);
}

.profile__stats a {
  color: inherit;
  text-decoration: none;
}

.profile__stats a:hover {
  color: var(--pop-accent);
}

.profile__stats strong {
  color: var(--pop-accent);
  font-size: 1rem;
  margin-right: 0.3rem;
}

.profile__bio {
  margin: 1.25rem;
  padding: 1rem;
  background: var(--pop-brand);
  border-radius: 10px;
  line-height: 1.5;
}

.profile__section {
  padding: 0 1.25rem 1.25rem;
}

.profile__section h2 {
  font-family: var(--font-headline);
  text-transform: uppercase;
  font-size: 1.2rem;
  margin: 1.25rem 0 0.75rem;
}

.profile__fandoms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.profile__fandoms a {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--pop-line);
  border-radius: 999px;
  color: var(--pop-ink);
  text-decoration: none;
  font-size: 0.85rem;
}

.profile__fandoms a:hover {
  border-color: var(--pop-accent);
  color: var(--pop-accent);
}

/* --- People lists ---------------------------------------------------------- */
.people {
  list-style: none;
  margin: 0;
  padding: 0;
}

.people__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--pop-surface);
  border-radius: 10px;
  margin-bottom: 0.5rem;
  color: var(--pop-ink);
}

/* --- Fandoms --------------------------------------------------------------- */
.fandoms__search {
  margin-bottom: 1.25rem;
}

.fandoms {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.fandom-card {
  background: var(--pop-surface);
  border-radius: 10px;
  padding: 1rem;
  color: var(--pop-ink);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
}

.fandom-card__name {
  font-family: var(--font-headline);
  text-transform: uppercase;
  color: var(--pop-ink);
  text-decoration: none;
  font-size: 1.05rem;
}

.fandom-card__desc {
  margin: 0;
  font-size: 0.85rem;
  color: var(--pop-ink-muted);
}

.fandom-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

/* --- Search ---------------------------------------------------------------- */
.search__form {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.search__form .pop-field__input {
  flex: 1 1 auto;
}

.search__group {
  margin-bottom: 2rem;
}

.search__group h2 {
  font-family: var(--font-headline);
  text-transform: uppercase;
  font-size: 1.1rem;
  color: var(--pop-ink);
  margin: 0 0 0.75rem;
}

.search__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.search__chips a {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--pop-line);
  border-radius: 999px;
  color: var(--pop-ink);
  text-decoration: none;
  font-size: 0.85rem;
}

/* --- Notifications --------------------------------------------------------- */
.notifications__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.notifications__filters {
  display: flex;
  gap: 0.5rem;
}

.notifications {
  list-style: none;
  margin: 0;
  padding: 0;
}

.notification {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  background: var(--pop-surface);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.5rem;
  color: var(--pop-ink);
}

.notification--unread {
  border-left: 3px solid var(--pop-accent);
}

.notification__body {
  min-width: 0;
}

.notification__title {
  margin: 0.4rem 0 0.15rem;
  font-weight: 600;
}

.notification__text {
  margin: 0;
  color: var(--pop-ink-muted);
  font-size: 0.9rem;
}

.notification__link {
  display: inline-block;
  margin-top: 0.4rem;
  color: var(--pop-accent);
}

.notification__actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 0 0 auto;
}

/* --- Messages -------------------------------------------------------------- */
.messages {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: 1rem;
  align-items: start;
}

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

.messages__threads,
.messages__panel {
  background: var(--pop-surface);
  border-radius: var(--pop-radius);
  padding: 1rem;
  color: var(--pop-ink);
}

.messages__threads ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.messages__thread {
  display: block;
  position: relative;
  padding: 0.6rem 0.65rem;
  border-radius: 8px;
  color: var(--pop-ink);
  text-decoration: none;
}

.messages__thread:hover,
.messages__thread--active {
  background: var(--pop-surface-raised);
}

.messages__thread-name {
  display: block;
  font-weight: 600;
}

.messages__thread-preview {
  display: block;
  font-size: 0.82rem;
  color: var(--pop-ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.messages__badge {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--pop-accent);
  color: #06121c;
  font-size: 0.7rem;
  line-height: 18px;
  text-align: center;
}

.messages__list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  max-height: 55vh;
  overflow-y: auto;
}

.message {
  margin-bottom: 0.8rem;
  max-width: 80%;
}

.message--own {
  margin-left: auto;
  text-align: right;
}

.message__body {
  margin: 0.25rem 0;
  padding: 0.55rem 0.75rem;
  background: var(--pop-surface-raised);
  border-radius: 10px;
  display: inline-block;
  text-align: left;
  line-height: 1.45;
}

.message--own .message__body {
  background: var(--pop-brand);
}

.message__attachment {
  display: block;
  font-size: 0.85rem;
  color: var(--pop-accent);
}

.message__time {
  display: block;
  font-size: 0.72rem;
  color: var(--pop-ink-muted);
}

.messages__composer {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}

.messages__composer .pop-field__input {
  flex: 1 1 auto;
}
