/* =========================================================
   Accord — home feed (home.html)
   ========================================================= */

/* ---------- Top bar ---------- */
.appbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.appbar__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding-top: 12px; padding-bottom: 12px; }
.appbar__search {
  flex: 999 1 320px; display: flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 18px; background: #F5F5F4; border-radius: 999px;
}
.appbar__search:focus-within { outline: 3px solid var(--primary); outline-offset: 1px; background: #FFFFFF; }
.appbar__search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 15px; font-weight: 500; }
.appbar__search input::placeholder { color: #78716C; }
.appbar__actions { display: flex; gap: 10px; align-items: center; }
.appbar__actions .btn { font-size: 14px; }
/* Messages button: a teal circle like the account picture beside it */
.appbar__actions .msgs-link { gap: 8px; padding: 0 16px 0 5px; min-height: 46px; }
.msgs-link__icon {
  width: 36px; height: 36px; border-radius: 999px; flex: none;
  display: grid; place-items: center; background: var(--primary); color: #FFFFFF;
}
.msgs-link:hover .msgs-link__icon { background: #0B5A54; }

/* ---------- Welcome strip ---------- */
.welcome { background: var(--ink); color: #FFFFFF; }
.welcome__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding-top: 14px; padding-bottom: 14px; }
.welcome__title { font-family: var(--font-display); font-size: 15px; color: var(--coral); }
.welcome__text { flex: 999 1 400px; font-size: 15px; line-height: 1.5; color: #E7E5E4; }
.welcome__btn { min-height: 40px; font-size: 14px; }
.welcome__link { color: #FFFFFF; font-weight: 600; font-size: 14px; text-decoration: underline; }
.welcome__link:hover { color: #FFFFFF; }
.welcome__close {
  width: 40px; height: 40px; border: 0; border-radius: 999px; background: var(--ink-2); color: #FFFFFF;
  display: grid; place-items: center; cursor: pointer;
}

/* ---------- Category bubbles ---------- */
.cats { background: var(--surface); border-bottom: 1px solid var(--line); }
.cats__inner { display: flex; gap: 18px; padding-top: 16px; padding-bottom: 12px; overflow-x: auto; overscroll-behavior-x: contain; }
.cat {
  display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 76px;
  background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink);
}
.cat__ring {
  width: 64px; height: 64px; border-radius: 999px; display: grid; place-items: center;
  border: 3px solid var(--primary); background: #EEF6F5;
  transition: transform .15s ease;
}
.cat--coral .cat__ring { border-color: var(--coral); background: var(--coral-soft); }
.cat--grey .cat__ring  { border-color: var(--line-2); background: #F5F5F4; }
.cat__label { font-size: 13px; font-weight: 600; }
.cat:hover .cat__ring { transform: scale(1.05); }
.cat[aria-pressed="true"] .cat__ring { background: var(--ink); border-color: var(--ink); }
.cat[aria-pressed="true"] .cat__ring svg { stroke: #FFFFFF; }
.cat[aria-pressed="true"] .cat__label { font-weight: 800; }

/* ---------- Layout ---------- */
.layout { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; padding-top: 24px; padding-bottom: 40px; }
.sidebar { flex: 1 1 220px; max-width: 250px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 96px; }
.feed { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.rightbar { flex: 1 1 280px; max-width: 320px; display: flex; flex-direction: column; gap: 18px; }

/* ---------- Panels ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 12px;
}
.panel p { font-size: 14px; line-height: 1.6; color: var(--body); }
.panel__label { margin: 2px 4px 2px; font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.panel__h { font-family: var(--font-display); font-size: 17px; }
.panel__head { display: flex; align-items: center; gap: 10px; }
.panel__head h2 { font-family: var(--font-display); font-size: 18px; }
.panel__link { align-self: flex-start; background: none; border: 0; padding: 0; color: var(--primary); font-weight: 700; font-size: 14px; cursor: pointer; }
.panel__link:hover { color: var(--primary-dark); }
.panel--types { padding: 14px; gap: 4px; }
.panel--dark { background: var(--ink); border-color: var(--ink); color: #FFFFFF; padding: 22px; }
.panel--dark p { color: #D6D3D1; }
.panel__link-light { color: #F9A47F; font-weight: 700; font-size: 14px; }
.panel__link-light:hover { color: #FFFFFF; }
.panel--coral { background: var(--coral-soft); border-color: var(--coral-line); }

.panel select {
  min-height: 44px; border: 1px solid var(--line-2); border-radius: 12px; padding: 0 10px;
  font-size: 15px; font-weight: 500; background: #FFFFFF;
}

/* ---------- "Show me" type filters ---------- */
.types { display: flex; flex-direction: column; gap: 4px; }
.type-btn {
  display: flex; justify-content: space-between; align-items: center;
  text-align: left; min-height: 44px; padding: 0 14px; border: 0; border-radius: 12px;
  background: transparent; font-size: 15px; font-weight: 500; cursor: pointer;
}
.type-btn:hover { background: #F5F5F4; }
.type-btn[aria-pressed="true"] { background: var(--primary-soft); color: var(--primary-text); font-weight: 700; }
.type-count {
  min-width: 26px; padding: 2px 8px; border-radius: 999px; background: #F2F0EC; color: #57534E;
  font-size: 12px; font-weight: 800; text-align: center;
}
.type-count:empty { display: none; }
.type-btn[aria-pressed="true"] .type-count { background: var(--primary); color: #FFFFFF; }

/* ---------- Live indicator and "Right now" numbers ---------- */
.panel__labelrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-right: 4px; }
.live-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px;
  background: #FFF1EA; color: #9A3412; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}
.live-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--coral); animation: live-pulse 1.6s ease-in-out infinite; }
@keyframes live-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(242, 107, 58, .55); } 60% { box-shadow: 0 0 0 6px rgba(242, 107, 58, 0); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.panel--stats { padding: 14px 16px; gap: 2px; }
.stat-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 4px; border-top: 1px solid #F0EEEA; }
.stat-row:first-of-type { border-top: 0; }
.stat-row__label { font-size: 14px; color: var(--body); }
.stat-row strong { font-family: var(--font-display); font-size: 18px; }
.stat-row strong.is-bump { color: var(--primary); }

/* ---------- "New posts" button above the feed ---------- */
.new-posts {
  align-self: center; display: inline-flex; align-items: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border: 0; border-radius: 999px;
  background: var(--ink); color: #FFFFFF; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  box-shadow: 0 10px 24px rgba(20, 32, 30, 0.22); position: sticky; top: 84px; z-index: 5;
}
.new-posts:hover { background: var(--primary); }

/* ---------- Composer ---------- */
.composer { padding: 20px; gap: 14px; }
.composer__title { font-family: var(--font-display); font-weight: 700; font-size: 19px; }
.composer input {
  min-height: 52px; border: 1.5px solid var(--line-2); border-radius: 14px; padding: 0 16px;
  font-size: 15px; font-weight: 500;
}
.composer input:focus { outline: none; border-color: var(--primary); }
.composer__row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.composer__types { display: flex; flex-wrap: wrap; gap: 8px; }
.composer__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.composer__actions .btn { min-height: 44px; font-size: 14px; }
.chip {
  min-height: 40px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px;
  background: #FFFFFF; font-size: 14px; font-weight: 600; cursor: pointer;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }
.composer__note {
  font-size: 14px; line-height: 1.5; padding: 12px 14px; border-radius: 12px;
  background: var(--coral-soft); border: 1px solid var(--coral-line); color: var(--ink);
}
.composer__note a { font-weight: 700; color: var(--coral-text); text-decoration: underline; }

/* ---------- Feed ---------- */
.demo-note {
  font-size: 14px; padding: 10px 14px; border-radius: 12px;
  background: var(--primary-soft); color: var(--primary-text);
}
.demo-note code { font-size: 13px; }
.feed__list { display: flex; flex-direction: column; gap: 16px; }
.feed__loading { color: var(--muted); padding: 24px; text-align: center; }

/* ---------- Sort and filter bar ---------- */
.feedbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  padding: 10px 12px; background: var(--surface); border: 1px solid #E8E5E0; border-radius: 16px;
}
.feedbar__count { font-size: 14px; font-weight: 800; color: var(--ink); margin-right: auto; padding-left: 4px; white-space: nowrap; }
.feedbar__item {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 4px 0 12px;
  border: 1px solid var(--line-2); border-radius: 999px; background: #FFFFFF; cursor: pointer;
}
.feedbar__item:focus-within { border-color: var(--primary); }
.feedbar__label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.feedbar__item select {
  border: 0; background: transparent; font: inherit; font-size: 14px; font-weight: 700; color: var(--ink);
  min-height: 38px; padding: 0 6px 0 2px; cursor: pointer; outline: none; max-width: 190px;
}
.feedbar__item.is-set { border-color: var(--primary); background: var(--primary-soft); }
.feedbar__check {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: 999px; background: #FFFFFF; font-size: 14px; font-weight: 700; cursor: pointer;
}
.feedbar__check input { width: 17px; height: 17px; accent-color: var(--primary); }
.feedbar__check:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.feedbar__reset {
  min-height: 40px; padding: 0 12px; border: 0; background: transparent; color: #B42318;
  font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; border-radius: 999px;
}
.feedbar__reset:hover { background: #FEF3F2; }
@media (max-width: 860px) {
  /* Phones: a tidy 2-by-2 grid */
  .feedbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; gap: 8px; border-radius: 14px; }
  .feedbar__count { grid-column: 1 / -1; display: flex; justify-content: space-between; padding: 0 2px; }
  .feedbar__item, .feedbar__check { min-height: 40px; min-width: 0; }
  .feedbar__item { padding-left: 10px; }
  .feedbar__label { font-size: 10px; }
  .feedbar__item select { flex: 1; min-width: 0; max-width: none; font-size: 13px; }
  .feedbar__check { font-size: 13px; padding: 0 10px; justify-content: center; }
  .feedbar__reset { grid-column: 1 / -1; min-height: 36px; }
}
.feed__empty {
  background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius);
  padding: 32px 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
}
.feed__empty span { color: var(--muted); }
.feed__empty .btn { margin-top: 8px; }
.post--highlight { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* ---------- Teams panel ---------- */
.teams { display: flex; flex-direction: column; gap: 14px; }
.team { display: flex; flex-direction: column; gap: 4px; }
.team strong { font-size: 15px; line-height: 1.4; }
.team span { font-size: 14px; color: var(--muted); }

/* ---------- Account (signed in) ---------- */
.account { position: relative; }
.account__btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 14px 0 5px;
  border: 1px solid var(--line-2); border-radius: 999px; background: #FFFFFF; cursor: pointer;
  font-weight: 700; font-size: 14px;
}
.account__btn:hover { border-color: var(--ink); }
.account__avatar {
  width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center;
  background: var(--primary); color: #FFFFFF; font-weight: 800; font-size: 13px;
}
.account__menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: 260px;
  background: #FFFFFF; border: 1px solid var(--line); border-radius: 16px; padding: 16px;
  box-shadow: 0 16px 40px rgba(20, 32, 30, 0.16);
  display: flex; flex-direction: column; gap: 4px;
}
.account__menu strong { font-size: 15px; }
.account__email { font-size: 13px; color: var(--muted); word-break: break-all; }
.account__note { font-size: 12px; color: var(--primary-text); margin: 6px 0 10px; }
.account__menu .btn { min-height: 42px; font-size: 14px; }

/* ---------- Post card extras ---------- */
.post__own { align-self: center; font-size: 13px; font-weight: 700; color: var(--primary-text); padding: 0 6px; }
.btn-danger { color: #B42318; border-color: #F3C3BD; }
.btn-danger:hover { color: #FFFFFF; background: #B42318; border-color: #B42318; }
.btn:disabled { opacity: .6; cursor: wait; }

/* ---------- Windows (sign-in, new post) ---------- */
.modal {
  overscroll-behavior: contain;
  border: 0; padding: 0; border-radius: 22px; width: min(440px, calc(100% - 32px));
  max-height: calc(100vh - 32px); color: var(--ink); background: #FFFFFF;
  box-shadow: 0 30px 80px rgba(20, 32, 30, 0.35);
}
.modal--wide { width: min(600px, calc(100% - 32px)); }
.modal::backdrop { background: rgba(20, 32, 30, 0.55); }
.modal__body { position: relative; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.modal__body--center { align-items: center; text-align: center; padding-top: 36px; }
.modal__close {
  position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 999px;
  border: 0; background: #F5F5F4; color: var(--ink); display: grid; place-items: center; cursor: pointer;
}
.modal__close:hover { background: var(--line); }
.modal__title { font-family: var(--font-display); font-size: 24px; letter-spacing: -0.5px; }
.modal__text { font-size: 15px; color: var(--body); max-width: 320px; }
.modal__fine { font-size: 13px; color: var(--muted); max-width: 320px; }
.modal__error {
  width: 100%; font-size: 14px; line-height: 1.5; padding: 10px 12px; border-radius: 12px;
  background: #FEF3F2; border: 1px solid #FECDCA; color: #B42318; text-align: left;
}
.modal__actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding-top: 4px; }

.btn-google {
  width: 100%; max-width: 320px; min-height: 52px; gap: 12px;
  background: #FFFFFF; color: #1F2937; border: 1px solid var(--line-2); font-weight: 700;
}
.btn-google:hover { border-color: var(--ink); color: #1F2937; }

/* ---------- Post form ---------- */
.post-form { gap: 16px; }
.money {
  display: flex; align-items: center; min-height: 48px; border: 1.5px solid var(--line-2); border-radius: 12px; background: #FFFFFF;
}
.money:focus-within { border-color: var(--primary); }
.money__sign { padding: 0 2px 0 14px; font-weight: 800; color: var(--ink); }
.field .money input {
  flex: 1; min-width: 0; min-height: 44px; border: 0; padding: 0 8px; border-radius: 0; background: transparent;
  font-size: 16px; font-weight: 700; outline: none; -moz-appearance: textfield;
}
.money input::-webkit-outer-spin-button, .money input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field .money select {
  width: auto; min-height: 36px; margin-right: 6px; padding: 0 8px; border: 0; border-radius: 8px;
  background: #F2F0EC; font-size: 13px; font-weight: 700;
}
.field .money select[hidden] { display: none; }
.post-form .modal__title { padding-right: 48px; }
.ai-strip {
  display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px;
  background: #FFF6F1; border: 1px dashed #F5B89E;
}
.ai-strip__label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--ink); }
.ai-strip__row { display: flex; gap: 8px; }
.ai-strip__row input { flex: 1; min-width: 0; background: #FFFFFF; }
.ai-strip__row .btn { flex: none; min-height: 0; padding: 0 16px; }
.ai-strip__note { font-size: 13px; color: var(--muted); }
.ai-strip__note.is-error { color: #B42318; }
.is-ai-filled { animation: aiFill 1.6s ease; }
@keyframes aiFill { 0%, 40% { box-shadow: 0 0 0 3px rgba(242, 107, 58, .35); } 100% { box-shadow: 0 0 0 0 rgba(242, 107, 58, 0); } }
#aiBtn.is-busy, #aiWrite.is-busy { opacity: .7; cursor: progress; }
@media (max-width: 480px) {
  .ai-strip__row { flex-direction: column; }
  .ai-strip__row .btn { min-height: 42px; }
}
.field { display: flex; flex-direction: column; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field__label { font-size: 14px; font-weight: 700; padding: 0; }
.field__opt { font-weight: 500; color: var(--muted); }
.field__hint { font-size: 12px; color: var(--muted); align-self: flex-end; }
.field input, .field select, .field textarea, .ai-strip__row input {
  width: 100%; min-height: 48px; padding: 10px 14px; border: 1.5px solid var(--line-2); border-radius: 12px;
  font-size: 15px; background: #FFFFFF;
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus, .ai-strip__row input:focus { outline: none; border-color: var(--primary); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }

.seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.seg__opt { position: relative; }
.seg__opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg__opt span {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 46px; padding: 0 8px; border: 1.5px solid var(--line-2); border-radius: 12px;
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.seg__opt span:hover { border-color: var(--ink); }
.seg__opt input:checked + span { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }
.seg__opt input:focus-visible + span { outline: 3px solid var(--coral); outline-offset: 2px; }

/* ---------- Bottom bar (phones only) ---------- */
.bottom-nav { display: none; }

/* =========================================================
   Tablets and phones
   ========================================================= */
@media (max-width: 1080px) {
  .rightbar { max-width: none; flex-basis: 100%; flex-direction: row; flex-wrap: wrap; }
  .rightbar .panel { flex: 1 1 260px; }
}

@media (max-width: 860px) {
  body.home { padding-bottom: 76px; }

  .appbar__post, .account__name { display: none; }
  .appbar__actions .btn { min-height: 42px; padding: 0 14px; }
  .account__btn { padding: 0 3px; min-height: 44px; }
  /* Phones: logo and account on top, full-width search underneath */
  .appbar__inner { gap: 10px 12px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 12px; }
  .appbar .logo { order: 1; }
  .appbar__actions { order: 2; margin-left: auto; }
  .appbar__search { order: 3; flex: 1 1 100%; min-width: 0; min-height: 46px; padding: 0 16px; }
  .appbar__search input { font-size: 16px; } /* 16px stops iPhones zooming in when you tap it */
  .appbar .logo__word { font-size: 22px; }
  .appbar .logo svg { width: 34px; height: 29px; }

  /* Welcome strip: title + close on top, text, then buttons */
  .welcome__title { order: 0; }
  .welcome__close { order: 1; margin-left: auto; }
  .welcome__text { order: 2; flex-basis: 100%; }
  .welcome__btn { order: 3; }
  .welcome__link { order: 4; }

  .layout { padding-top: 16px; gap: 16px; }

  /* Filters become a scrolling row of chips above the feed */
  .sidebar { max-width: none; flex-basis: 100%; position: static; flex-direction: row; gap: 10px; overflow-x: auto; }
  /* Room between the chips and the scroll line under them */
  /* Note: setting scrollbar-width here would make Chrome drop the slim style below
     and fall back to the grey Windows bar with arrows, so only Firefox gets it (further down). */
  .sidebar { padding: 2px 2px 14px; }
  .sidebar::-webkit-scrollbar { height: 5px; }
  .sidebar::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
  .sidebar::-webkit-scrollbar-track { margin: 0 4px; background: rgba(20, 32, 30, 0.06); border-radius: 999px; }
  .sidebar::-webkit-scrollbar-thumb { background-color: rgba(15, 118, 110, 0.45); border: 0; border-radius: 999px; }
  .sidebar::-webkit-scrollbar-thumb:hover { background-color: rgba(15, 118, 110, 0.75); }
  .sidebar .panel { border: 0; background: none; padding: 0; }
  .panel--types .panel__label, .panel--where .panel__label, .panel__labelrow { display: none; }
  .types { flex-direction: row; gap: 8px; }
  .type-btn {
    flex: none; min-height: 40px; border: 1px solid var(--line-2); border-radius: 999px;
    background: #FFFFFF; font-size: 14px; white-space: nowrap;
  }
  .type-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }
  .type-btn { gap: 6px; }
  .panel--stats, .panel__labelrow .live-pill { display: none; }
  .type-btn .type-count { padding: 1px 6px; min-width: 20px; font-size: 11px; }
  .panel--where { flex: none; }
  .panel--where select { min-height: 40px; border-radius: 999px; font-size: 14px; }

  .post { padding: 16px; }
  .post__title { font-size: 18px; }
  .post__actions { width: 100%; }
  .post__actions .btn { flex: 1 1 auto; }

  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around; align-items: center;
  }
  .bottom-nav__item {
    flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
    min-height: 52px; justify-content: center;
    background: none; border: 0; padding: 0; cursor: pointer;
    color: var(--muted); font-size: 11px; font-weight: 600;
  }
  .bottom-nav__item:hover { color: var(--ink); }
  .bottom-nav__icon { position: relative; display: inline-flex; }
  .bottom-nav__icon .msgs-link__dot { top: -3px; right: -5px; }
  .msgs-link { display: none; }
  .bottom-nav__item--active { color: var(--primary); }
  .bottom-nav__plus {
    width: 48px; height: 48px; border-radius: 999px; background: var(--primary); color: #FFFFFF;
    display: grid; place-items: center; font-size: 28px; font-weight: 500; line-height: 1;
  }

  .toast { bottom: 92px; }

  .modal__body { padding: 22px; }
  .seg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* =========================================================
   Safety (reports, flags, blocked members) — also used by Messages
   ========================================================= */
.post__report {
  width: 40px; height: 40px; border-radius: 999px; border: 0; background: transparent; color: var(--muted);
  display: grid; place-items: center; cursor: pointer; flex: none;
}
.post__report:hover { background: #FEF3F2; color: #B42318; }
.post__official {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  background: var(--ink); color: #FFFFFF; font-size: 11px; font-weight: 800; letter-spacing: .3px;
}
.safety-note { font-size: 14px; line-height: 1.5; padding: 12px 14px; border-radius: 12px; }
.safety-note--bad { background: #FEF3F2; border: 1px solid #FECDCA; color: #912018; }
.post-form__safety { font-size: 13px; line-height: 1.5; color: var(--muted); background: #F5F5F4; border-radius: 12px; padding: 10px 12px; }
.account__admin { min-height: 42px; font-size: 14px; margin-bottom: 6px; }

.btn-danger-solid { background: #B42318; color: #FFFFFF; }
.btn-danger-solid:hover { background: #912018; color: #FFFFFF; }

.report-form .modal__title { padding-right: 48px; }
.report-reasons { display: flex; flex-direction: column; gap: 6px; }
.report-reason {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px;
  border: 1.5px solid var(--line-2); border-radius: 12px; cursor: pointer; font-size: 14px; font-weight: 600;
}
.report-reason:hover { border-color: var(--ink); }
.report-reason input { width: 18px; height: 18px; accent-color: #B42318; flex: none; }
.report-reason:has(input:checked) { border-color: #B42318; background: #FEF3F2; }
.report-form textarea {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--line-2); border-radius: 12px; font-size: 15px; resize: vertical;
}

/* ---------- Profile links ---------- */
a.post__who { color: var(--ink); }
a.post__who:hover { color: var(--primary); text-decoration: underline; }
.account__profile { min-height: 42px; font-size: 14px; margin-bottom: 6px; }

/* ---------- Get matched (alerts) ---------- */
.alerts-form .modal__title { padding-right: 48px; }
.checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.check {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px;
  border: 1.5px solid var(--line-2); border-radius: 12px; cursor: pointer; font-size: 14px; font-weight: 600;
}
.check:hover { border-color: var(--ink); }
.check input { width: 18px; height: 18px; accent-color: var(--primary); flex: none; }
.check:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.alerts-form__to { font-size: 13px; color: var(--muted); }
.deliver { display: grid; gap: 8px; }
.deliver__row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface, #fff);
}
.deliver__row--check { cursor: pointer; }
.deliver__row--check input { width: 18px; height: 18px; accent-color: var(--primary); flex: none; }
.deliver__row.is-on { border-color: var(--primary); }
.deliver__icon {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: var(--line, #EEF2F1); color: var(--ink);
}
.deliver__icon--tg { background: #229ED9; color: #FFFFFF; }
.deliver__text { flex: 1; min-width: 0; display: grid; gap: 2px; font-size: 13px; color: var(--muted); }
.deliver__text strong { font-size: 14px; color: var(--ink); }
.deliver__text span { overflow-wrap: anywhere; }
.deliver__btn { flex: none; padding: 8px 14px; font-size: 13px; min-height: 0; }
@media (max-width: 480px) {
  .deliver__row { flex-wrap: wrap; }
  .deliver__row:not(.deliver__row--check) .deliver__btn { width: 100%; justify-content: center; }
}
.panel--coral.is-on { background: var(--primary-soft); border-color: #BFE0DB; }

/* Firefox only: slim teal scroll line under the phone filter chips */
@supports not selector(::-webkit-scrollbar) {
  .sidebar { scrollbar-width: thin; scrollbar-color: rgba(15, 118, 110, 0.45) transparent; }
}

/* AI highlight on the dollar box (not the bare number field inside it) */
.money input.is-ai-filled { animation: none; }
.money:has(.is-ai-filled) { animation: aiFill 1.6s ease; }

/* Unread dot sits on the teal circle */
.appbar__actions .msgs-link .msgs-link__dot { top: 4px; left: 32px; right: auto; }

/* =========================================================
   Windows with a fixed header and footer ("sheets"): New post, Get matched.
   Computers: a card in the middle of the screen. Phones: slides up from the bottom.
   The middle scrolls; the title and the buttons always stay in view.
   ========================================================= */
.sheet {
  width: min(640px, calc(100% - 32px));
  max-height: min(860px, calc(100dvh - 40px));
  border-radius: 24px;
  overflow: hidden;
  animation: sheet-pop .22s ease-out;
}
.sheet[open] { display: flex; }
.sheet::backdrop { background: rgba(20, 32, 30, 0.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
@keyframes sheet-pop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }

.sheet__form { display: flex; flex-direction: column; width: 100%; min-height: 0; max-height: inherit; }
.sheet__head {
  flex: none; display: flex; align-items: flex-start; gap: 14px;
  padding: 22px 22px 16px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #FFFFFF, #FBFAF7);
}
.sheet__icon {
  flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
}
.sheet__icon--coral { background: var(--coral-soft); color: var(--coral); }
.sheet__titles { flex: 1; min-width: 0; }
.sheet .modal__title { margin: 0; font-size: 22px; line-height: 1.2; padding: 0; }
.sheet__sub { margin: 4px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.sheet__close {
  flex: none; width: 38px; height: 38px; margin: -4px -4px 0 0; border: 0; border-radius: 999px; cursor: pointer;
  display: grid; place-items: center; background: #F2F0EC; color: var(--ink);
}
.sheet__close:hover { background: var(--line); }

.sheet__body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 18px;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.sheet__sec { display: flex; flex-direction: column; gap: 12px; border: 0; margin: 0; padding: 0; min-width: 0; }
.sheet__sec + .sheet__sec { padding-top: 18px; border-top: 1px dashed var(--line); }
.sheet__sec-title { float: left; width: 100%; display: flex; align-items: center; gap: 9px; padding: 0; margin: 0 0 2px; font-size: 15px; font-weight: 800; color: var(--ink); }
.sheet__sec-title i {
  flex: none; width: 24px; height: 24px; border-radius: 999px; display: grid; place-items: center;
  background: var(--ink); color: #FFFFFF; font-style: normal; font-size: 12px; font-weight: 800;
}

.sheet__foot {
  flex: none; display: flex; flex-direction: column; gap: 10px; padding: 14px 22px 18px;
  border-top: 1px solid var(--line); background: #FFFFFF;
  box-shadow: 0 -10px 24px -18px rgba(20, 32, 30, .35);
}
.sheet__foot .modal__error { margin: 0; }
.sheet__actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.sheet__actions .btn { min-height: 48px; padding: 0 22px; }
.sheet__actions .btn-primary { min-width: 160px; justify-content: center; }
.btn-link-danger { margin-right: auto; background: transparent; border: 0; color: #B42318; font-weight: 700; padding: 0 6px !important; }
.btn-link-danger:hover { text-decoration: underline; }
.field__hint--left { align-self: flex-start; }

/* ---- New post ---- */
.sheet .ai-strip {
  gap: 10px; padding: 14px; border-radius: 16px; border: 1px solid var(--coral-line);
  background: linear-gradient(135deg, #FFF6F1 0%, #FFFFFF 70%);
}
.sheet .ai-strip__label { align-items: flex-start; gap: 10px; font-weight: 500; }
.sheet .ai-strip__label b { display: block; font-size: 15px; font-weight: 800; color: var(--ink); }
.sheet .ai-strip__label small { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.ai-strip__spark { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--coral); color: #FFFFFF; }
.sheet .ai-strip__row .btn { min-height: 48px; padding: 0 18px; font-weight: 800; }

.seg--cards { gap: 10px; }
.seg--cards .seg__opt span { flex-direction: column; gap: 2px; min-height: 64px; padding: 10px 8px; border-radius: 14px; background: #FFFFFF; transition: border-color .15s, background .15s, transform .15s; }
.seg--cards .seg__opt b { font-size: 14px; font-weight: 800; }
.seg--cards .seg__opt small { font-size: 12px; font-weight: 500; color: var(--muted); }
.seg--cards .seg__opt input:checked + span { background: var(--ink); border-color: var(--ink); color: #FFFFFF; transform: translateY(-1px); }
.seg--cards .seg__opt input:checked + span small { color: #C9D2CF; }

.sheet .post-form__safety { display: flex; gap: 10px; align-items: flex-start; margin: 0; background: var(--primary-soft); color: #134E48; }
.sheet .post-form__safety svg { flex: none; margin-top: 2px; color: var(--primary); }

/* ---- Get matched ---- */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { position: relative; cursor: pointer; }
.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pill span {
  display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 16px; border-radius: 999px;
  border: 1.5px solid var(--line-2); background: #FFFFFF; font-size: 14px; font-weight: 700; color: var(--ink);
  transition: border-color .15s, background .15s;
}
.pill span small { font-weight: 500; color: var(--muted); }
.pill span::after {
  content: ""; width: 0; height: 18px; overflow: hidden; transition: width .15s;
  background: no-repeat center / 14px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E"), var(--primary);
  border-radius: 999px;
}
.pill:hover span { border-color: var(--ink); }
.pill input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: #134E48; }
.pill input:checked + span::after { width: 18px; }
.pill input:focus-visible + span { outline: 3px solid var(--coral); outline-offset: 2px; }

.sheet .deliver { gap: 10px; }
.sheet .deliver__row { gap: 12px; padding: 14px; border-radius: 16px; border: 1.5px solid var(--line-2); background: #FFFFFF; }
.sheet .deliver__row.is-on { border-color: var(--primary); background: var(--primary-soft); }
.sheet .deliver__icon { width: 40px; height: 40px; }
.sheet .deliver__text { font-size: 13px; }
.sheet .deliver__text strong { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.deliver__badge { font-style: normal; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--primary); color: #FFFFFF; }
.deliver__badge[hidden] { display: none; }
.sheet .deliver__btn { min-height: 40px; padding: 0 16px; font-size: 14px; }
.deliver__wait { display: flex; align-items: center; gap: 10px; margin: -2px 0 0; padding: 10px 12px; border-radius: 12px; background: #EAF6FD; color: #0B4F71; font-size: 13px; line-height: 1.45; }
.deliver__wait[hidden] { display: none; }
.deliver__wait .spinner { width: 16px; height: 16px; border-width: 2px; flex: none; }

/* An on/off switch for "Email" */
.sheet input.switch {
  appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 46px; height: 28px; margin: 0;
  border-radius: 999px; background: var(--line-2); cursor: pointer; transition: background .15s;
}
.sheet input.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #FFFFFF; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s;
}
.sheet input.switch:checked { background: var(--primary); }
.sheet input.switch:checked::after { transform: translateX(18px); }
.sheet input.switch:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }

/* ---- Phones: a sheet that slides up from the bottom ---- */
@media (max-width: 640px) {
  .sheet {
    width: 100%; max-width: 100%; margin: auto 0 0; max-height: 94dvh;
    border-radius: 22px 22px 0 0; animation: sheet-up .25s ease-out;
  }
  .sheet__head { padding: 18px 16px 14px; gap: 12px; position: relative; }
  .sheet__head::before { content: ""; position: absolute; top: 7px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--line-2); }
  .sheet__icon { width: 40px; height: 40px; border-radius: 12px; }
  .sheet .modal__title { font-size: 20px; }
  .sheet__sub { font-size: 13px; }
  .sheet__body { padding: 16px 16px 20px; gap: 16px; }
  .sheet__foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .sheet__actions .btn { flex: 1; padding: 0 12px; }
  .sheet__actions .btn-primary { min-width: 0; }
  .sheet__actions .btn-link-danger { flex: none; }
  .seg--cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sheet .deliver__row { flex-wrap: wrap; }
  .sheet .deliver__row:not(.deliver__row--check) .deliver__btn { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }