/* Matchmaker v3 — match-social screens: search, interests, shortlists, activity, notifications, messages
   (see docs/MATCHMAKING.md §3). Product tokens only; builds on css/match.css (mm-* primitives + chat classes).
   Device classes: phone ≤767 · tablet 768–1024 · desktop ≥1025. */

/* ── shared ─────────────────────────────────────────────────────────────────────────── */
/* `.mm-app a { color: inherit }` outranks `.mm-btn`: primary buttons that are links keep their light label */
:is(.mm-sx-page, .mm-ib-page, .mm-sl-page, .mm-ac-page, .mm-nt-page, .mm-ch-page) a.mm-btn:not(.ghost):not(.soft):not(.danger) { color: var(--card); }
.mm-card.is-leaving { opacity: 0; transform: scale(.96); transition: opacity .22s, transform .22s; }
.mm-sx-prem { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; vertical-align: 1px;
  background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold-d); font: 700 11px/1.4 var(--font-body);
  letter-spacing: .02em; text-transform: none; white-space: nowrap; }
.mm-tab .mm-sx-prem { padding: 1px 6px; }

/* ── search ─────────────────────────────────────────────────────────────────────────── */
.mm-sx-head { align-items: flex-end; }
.mm-sx-id { display: grid; gap: 6px; min-width: 280px; }
.mm-sx-idlabel { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.mm-sx-idrow { display: flex; gap: 8px; }
.mm-sx-idrow .mm-input { text-transform: uppercase; letter-spacing: .06em; min-width: 0; }
.mm-sx-idrow .mm-input::placeholder { text-transform: none; letter-spacing: 0; }
.mm-sx { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 28px; align-items: start; }
.mm-sx-panel { position: sticky; top: 132px; max-height: calc(100vh - 148px); overflow: auto; overscroll-behavior: contain;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px 0; scrollbar-width: thin; }
.mm-sx-panelhead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-bottom: 6px; }
.mm-app .mm-sx-panelhead h2 { font-size: 22px; }
.mm-sx-group { padding: 14px 0; border-bottom: 1px solid var(--line); }
.mm-sx-label { margin-bottom: 10px; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 8px; }
.mm-sx-group .mm-chips { gap: 6px; }
.mm-sx-group .mm-chip { min-height: 36px; padding: 0 12px; font-size: 14px; }
.mm-sx-clamp .mm-chip:nth-child(n+11) { display: none; }
.mm-sx-group > .mm-link { margin-top: 8px; display: inline-block; }
.mm-sx-sw { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 15px; color: var(--brown); }
.mm-sx-sw > span { display: inline-flex; align-items: center; gap: 6px; }
.mm-sx-advhead { display: flex; align-items: center; gap: 10px; padding: 18px 0 4px; }
.mm-app .mm-sx-advhead h3 { font-size: 19px; }
.mm-sx-advnote { margin: 4px 0 2px; line-height: 1.45; }
.mm-sx-group.adv .mm-sx-label { color: var(--brown); }
.mm-sx-more { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 4px; padding: 14px 16px; border-radius: 14px;
  border: 1.5px dashed var(--border); background: color-mix(in srgb, var(--gold) 5%, var(--card)); text-decoration: none; color: var(--deep); }
.mm-sx-more > span:first-child { display: grid; gap: 3px; }
.mm-sx-more:hover { border-color: var(--gold); }
.mm-sx-go { position: sticky; bottom: 0; display: flex; gap: 10px; margin: 0 -18px; padding: 14px 18px 16px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--card) 0%, transparent), var(--card) 26%); }
.mm-sx-go .mm-btn:last-child { flex: 1; }
.mm-sx-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: var(--tap); padding: 5px 6px; border: 1.5px solid var(--line);
  border-radius: 12px; background: var(--card); }
.mm-sx-tags:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 14%, transparent); }
.mm-sx-tagset { display: contents; }
.mm-app .mm-sx-taginput, .mm-sx-taginput { flex: 1; min-width: 110px; min-height: 32px; padding: 4px 6px; border: 0; box-shadow: none; background: transparent; }
.mm-app .mm-sx-taginput:focus { box-shadow: none; }
.mm-sx-tag { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px; border-radius: 15px; border: 0; cursor: pointer;
  background: var(--deep); color: var(--ivory); font: 500 13.5px var(--font-body); }
.mm-sx-sugg { margin-top: 6px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: var(--shadow); display: grid; gap: 2px; }
.mm-sx-main { min-width: 0; }
.mm-sx-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.mm-sx-ftoggle { display: none; }
.mm-sx-fn:not(:empty) { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--deep);
  color: var(--ivory); font-size: 12px; font-weight: 700; }
.mm-sx-count { flex: 1; min-width: 150px; color: var(--muted); font-size: 15px; }
.mm-sx-count b { color: var(--deep); font-size: 19px; font-weight: 700; }
.mm-select.mm-sx-sort { width: auto; min-height: 36px; padding: 0 38px 0 14px; font-size: 14px; border-radius: 10px; }
.mm-sx-active { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 14px; }
.mm-sx-active:empty { display: none; }
.mm-sx-achip { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 10px 0 12px; border-radius: 16px; cursor: pointer;
  border: 1px solid var(--border); background: color-mix(in srgb, var(--gold) 8%, var(--card)); color: var(--brown); font: 500 13.5px var(--font-body); }
.mm-sx-achip:hover { border-color: var(--gold); }
.mm-sx-achip > span:last-child { color: var(--muted); font-size: 16px; line-height: 1; }
.mm-sx-moreb { justify-content: center; margin-top: 22px; }
.mm-sx-recent { margin: 0 0 16px; display: grid; gap: 8px; }
.mm-sx-recentrow { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.mm-sx-recentrow::-webkit-scrollbar { display: none; }
.mm-sx-rchip { flex: none; display: grid; gap: 2px; max-width: 280px; padding: 9px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card);
  color: var(--brown); font: 500 14px var(--font-body); text-align: left; cursor: pointer; box-shadow: var(--shadow); }
.mm-sx-rchip:hover { border-color: var(--gold); }
.mm-sx-rchip > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-sx-rchip .mm-muted { font-size: 12px; }
.mm-sx-chiprow { display: flex; flex-wrap: wrap; gap: 6px; }
.mm-sx-idcard { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 28px; align-items: start; max-width: 860px; }
.mm-sx-idcard .mm-grid.single { grid-template-columns: 1fr; }
.mm-sx-idside { display: grid; gap: 10px; align-content: start; padding-top: 6px; }
.mm-sx-idside p { margin: 0; }
.mm-sx-savedhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.mm-sx-savedhead p { margin: 0; }
.mm-sx-scard { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 12px; padding: 18px 20px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); animation: mm-rise .3s both; }
.mm-sx-scardmain { display: grid; gap: 8px; min-width: 0; }
.mm-sx-scardmain p { margin: 0; }
.mm-sx-scardact { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; align-items: center; flex: none; max-width: 52%; }
.mm-select.mm-sx-alertbtn { width: auto; min-height: 36px; padding: 0 36px 0 12px; font-size: 14px; border-radius: 10px; }

/* ── interests ──────────────────────────────────────────────────────────────────────── */
.mm-ib-list { display: grid; gap: 12px; }
.mm-ib-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 14px 16px 14px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); animation: mm-rise .3s both;
  transition: opacity .26s, transform .26s; }
.mm-ib-row.is-new { border-color: color-mix(in srgb, var(--gold) 45%, transparent);
  background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 8%, var(--card)), var(--card) 45%); }
.mm-ib-row.is-leaving { opacity: 0; transform: translateX(18px); }
.mm-ib-photo { position: relative; display: grid; place-items: center; width: 96px; aspect-ratio: 4 / 5; border-radius: 14px; overflow: hidden;
  background: linear-gradient(160deg, var(--cream), var(--sand)); text-decoration: none; }
.mm-ib-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mm-ib-photo img.blurred { filter: blur(3px); transform: scale(1.06); }
.mm-ib-noph { font: 600 32px var(--font-serif); color: color-mix(in srgb, var(--brown) 40%, transparent); }
.mm-ib-body { display: grid; gap: 5px; min-width: 0; }
.mm-ib-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mm-ib-name { display: inline-flex; align-items: center; gap: 6px; font: 600 21px/1.2 var(--font-serif); color: var(--deep); text-decoration: none; }
.mm-ib-name:hover { color: var(--gold-d); }
.mm-ib-name .vf { color: var(--blue); flex: none; }
.mm-ib-meta { color: var(--muted); font-size: 14px; }
.mm-ib-signal { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.mm-ib-reason { font-size: 13px; color: var(--brown); }
.mm-ib-note { margin: 4px 0 0; padding: 10px 14px; border-left: 3px solid var(--gold); border-radius: 4px 14px 14px 4px; background: var(--cream);
  color: var(--brown); font: italic 15px/1.45 var(--font-body); }
.mm-ib-status { font-size: 13px; color: var(--muted); line-height: 1.4; }
.mm-ib-new { color: var(--rose); font-weight: 700; }
.mm-ib-ok { color: var(--green); }
.mm-ib-acts { display: flex; flex-direction: column; gap: 8px; min-width: 150px; }
.mm-ib-acts .mm-btn { width: 100%; }
.mm-ib-morebox { justify-content: center; margin-top: 18px; }

/* ── shortlists ─────────────────────────────────────────────────────────────────────── */
.mm-sl-side .mm-sl-sname { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.mm-sl-side .mm-sl-sname > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-sl-shared { color: var(--gold-d); flex: none; }
.mm-sl-divider { margin: 12px 14px 4px; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.mm-side .mm-sl-add { color: var(--gold-d); font-weight: 600; margin-top: 6px; border: 1.5px dashed var(--border); justify-content: center; }
.mm-sl-main { min-width: 0; }
.mm-sl-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 18px; flex-wrap: wrap; margin-bottom: 16px; }
.mm-sl-head:empty { display: none; }
.mm-sl-title p { margin: 4px 0 0; }
.mm-sl-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mm-sl-share { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; color: var(--brown); padding-right: 6px; }
.mm-sl-saved { display: grid; gap: 3px; margin: 0 14px 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12.5px; color: var(--muted); }
.mm-sl-in { color: var(--gold-d); font-weight: 600; }
.mm-sl-note { font-style: italic; color: var(--brown); }
.mm-sl-saved .mm-link { justify-self: start; font-size: 13px; margin-top: 2px; }
.mm-sl-morebox { justify-content: center; margin-top: 20px; }
.mm-sl-sharerow { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--cream); }
.mm-sl-sharerow p { margin: 2px 0 0; }

/* ── activity ───────────────────────────────────────────────────────────────────────── */
.mm-ac-lock { display: grid; gap: 18px; padding: 26px; grid-template-areas: "head" "blurs" "acts" "help"; border-radius: 22px; color: var(--ivory); box-shadow: var(--shadow-lg);
  background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--gold) 26%, transparent), transparent 60%), linear-gradient(135deg, var(--deep), var(--brown)); }
.mm-ac-lockhead { grid-area: head; display: flex; gap: 20px; align-items: center; }
.mm-ac-lockacts { grid-area: acts; }
.mm-ac-lockhelp { grid-area: help; }
.mm-ac-lock .mm-ac-blurs { grid-area: blurs; }
@media (min-width: 1025px) {
  .mm-ac-lock { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "head blurs" "acts blurs" "help blurs"; align-items: center; gap: 14px 40px; padding: 32px 36px; }
  .mm-ac-lock .mm-ac-blurs { grid-template-columns: repeat(3, 150px); }
}
.mm-ac-big { font: 700 64px/1 var(--font-serif); color: var(--gold-l); }
.mm-app .mm-ac-lock h2 { color: var(--ivory); font-size: 26px; }
.mm-ac-lock .mm-muted { margin: 6px 0 0; color: color-mix(in srgb, var(--ivory) 72%, transparent); }
.mm-ac-lock .mm-help { margin: 0; color: color-mix(in srgb, var(--ivory) 58%, transparent); }
.mm-ac-lock .mm-btn.ghost { color: var(--ivory); border-color: color-mix(in srgb, var(--gold-l) 45%, transparent); }
.mm-ac-blurs { display: grid; grid-template-columns: repeat(3, minmax(0, 170px)); gap: 12px; }
.mm-ac-blur { position: relative; display: grid; grid-template-rows: 1fr auto; aspect-ratio: 4 / 5; border-radius: 16px; overflow: hidden;
  background: color-mix(in srgb, var(--ivory) 8%, transparent); border: 1px solid color-mix(in srgb, var(--gold-l) 28%, transparent); }
.mm-ac-blur .ph { filter: blur(7px);
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--gold-l) 60%, transparent) 0 17%, transparent 18%),
    radial-gradient(ellipse at 50% 104%, color-mix(in srgb, var(--gold-l) 45%, transparent) 0 40%, transparent 41%),
    linear-gradient(160deg, color-mix(in srgb, var(--sand) 30%, transparent), color-mix(in srgb, var(--rose) 30%, transparent)); }
.mm-ac-blur .t { display: grid; gap: 6px; padding: 10px 12px 12px; filter: blur(2.5px); }
.mm-ac-blur .t i { display: block; width: 70%; height: 12px; border-radius: 6px; background: color-mix(in srgb, var(--ivory) 45%, transparent); }
.mm-ac-blur .t i.s { width: 48%; height: 9px; opacity: .7; }
.mm-ac-blur .lk { position: absolute; inset: 0; display: grid; place-items: center; font-size: 26px; }
.mm-ac-blur.more { display: grid; place-items: center; align-content: center; gap: 2px; grid-template-rows: none; }
.mm-ac-blur.more b { font: 700 34px var(--font-serif); color: var(--gold-l); }
.mm-ac-blur.more span { font-size: 13px; color: color-mix(in srgb, var(--ivory) 70%, transparent); }
.mm-ac-total { margin: 0 0 12px; }
.mm-ac-when { margin: 0 14px 10px; font-size: 12.5px; font-weight: 600; color: var(--gold-d); }
.mm-ac-morebox { justify-content: center; margin-top: 20px; }
.mm-ac-hist { display: grid; gap: 10px; }
.mm-ac-hrow { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow); text-decoration: none; color: var(--deep); animation: mm-rise .3s both; }
.mm-ac-hrow:hover { border-color: var(--gold); }
.mm-ac-hrow .ic { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--cream); color: var(--gold-d); }
.mm-ac-hrow .t { flex: 1; min-width: 0; display: grid; gap: 2px; }
.mm-ac-hrow .t b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-ac-hrow .go { flex: none; color: var(--gold-d); font-weight: 600; font-size: 14px; white-space: nowrap; }
.mm-ac-histfoot { margin-top: 16px; }
.mm-ac-shortcuts { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); }
.mm-ac-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.mm-ac-link { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 14px; border-radius: 14px; background: var(--card);
  border: 1px solid var(--line); text-decoration: none; color: var(--deep); font-weight: 600; font-size: 15px; }
.mm-ac-link:hover { border-color: var(--gold); }
.mm-ac-link .ic { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--cream); color: var(--gold-d); font-size: 15px; }
.mm-ac-link .go { margin-left: auto; color: var(--muted); }

/* ── notifications ──────────────────────────────────────────────────────────────────── */
.mm-nt-page { max-width: 820px; }
.mm-nt-list { display: grid; gap: 6px; }
.mm-nt-day { margin: 16px 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.mm-nt-day:first-child { margin-top: 0; }
.mm-nt-item { position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 14px; background: var(--card);
  border: 1px solid var(--line); text-decoration: none; color: var(--deep); animation: mm-rise .28s both; }
.mm-nt-item:hover { border-color: var(--gold); }
.mm-nt-item.unread { border-color: color-mix(in srgb, var(--gold) 42%, transparent);
  background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 10%, var(--card)), var(--card) 60%); box-shadow: var(--shadow); }
.mm-nt-item.unread .mm-nt-title { font-weight: 600; }
.mm-nt-ic { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 50%; background: var(--cream); color: var(--brown); font-size: 18px; }
.mm-nt-ic.rose { background: color-mix(in srgb, var(--rose) 13%, var(--card)); color: var(--rose); }
.mm-nt-ic.gold { background: color-mix(in srgb, var(--gold) 16%, var(--card)); color: var(--gold-d); }
.mm-nt-ic.green { background: color-mix(in srgb, var(--green) 12%, var(--card)); color: var(--green); }
.mm-nt-t { flex: 1; min-width: 0; display: grid; gap: 2px; }
.mm-nt-title { font-size: 15px; line-height: 1.35; }
.mm-nt-when { font-size: 12.5px; color: var(--muted); }
.mm-nt-dot { width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--rose); }
.mm-nt-morebox { justify-content: center; margin-top: 18px; }

/* ── messages ───────────────────────────────────────────────────────────────────────── */
.mm-ch-screen .mm-app { padding-bottom: 16px; }
.mm-ch-pagehead { margin-bottom: 14px; }
.mm-app .mm-ch-pagehead h1 { font-size: 30px; }
.mm-ch-page .mm-chat { background: var(--card); }
.mm-ch-list { display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: var(--card); }
.mm-ch-tools { display: grid; gap: 10px; padding: 12px; border-bottom: 1px solid var(--line); }
.mm-ch-search { position: relative; display: block; }
.mm-ch-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.mm-app .mm-ch-search .mm-input { min-height: 40px; padding-left: 38px; border-radius: 20px; background: var(--ivory); }
.mm-ch-tools .mm-chips { gap: 6px; flex-wrap: nowrap; }
.mm-ch-tools .mm-chip { min-height: 32px; padding: 0 12px; font-size: 13.5px; }
.mm-ch-items { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.mm-ch-items .mm-state { margin: 14px; padding: 30px 16px; }
.mm-chat-item.mm-ch-item { position: relative; gap: 12px; padding: 12px 14px; }
.mm-ch-item.on { background: color-mix(in srgb, var(--gold) 11%, var(--card)); box-shadow: inset 3px 0 0 var(--gold); }
.mm-ch-av { position: relative; display: block; flex: none; width: 48px; height: 48px; }
.mm-ch-av.sm { width: 42px; height: 42px; }
.mm-ch-av.lg { width: 76px; height: 76px; }
.mm-chat-item .mm-ch-av img, .mm-ch-av img, .mm-ch-av .mm-ch-noph { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
  background: linear-gradient(160deg, var(--cream), var(--sand)); color: var(--brown); font: 600 18px var(--font-serif); }
.mm-ch-av.lg .mm-ch-noph { font-size: 28px; }
.mm-ch-av img.blurred { filter: blur(2px); }
.mm-ch-av .mm-online { position: absolute; right: 0; bottom: 1px; width: 12px; height: 12px; border: 2px solid var(--card); }
.mm-chat-item span.mm-ch-it { flex: 1; min-width: 0; display: grid; gap: 3px; white-space: normal; overflow: visible; }
.mm-chat-item span.mm-ch-row1, .mm-chat-item span.mm-ch-row2 { display: flex; align-items: center; gap: 6px; overflow: visible; white-space: normal; color: inherit; font-size: inherit; }
.mm-chat-item span.mm-ch-nm { display: block; min-width: 0; font-size: 15px; font-weight: 600; color: var(--deep); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-ch-row1 .vf { color: var(--blue); flex: none; width: 15px; height: 15px; }
.mm-ch-row1 small { margin-left: auto; flex: none; font-size: 12px; color: var(--muted); }
.mm-chat-item span.mm-ch-pv { flex: 1; min-width: 0; display: block; font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-chat-item .mm-ch-pv span { display: inline; }
.mm-ch-u { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--rose); color: var(--card); font: 700 11.5px/20px var(--font-body);
  font-style: normal; text-align: center; }
.mm-ch-item.unread .mm-ch-nm { font-weight: 700; }
.mm-ch-item.unread .mm-ch-pv { color: var(--deep); font-weight: 500; }
.mm-ch-item.unread .mm-ch-row1 small { color: var(--rose); font-weight: 600; }
.mm-ch-typingtxt { color: var(--green); font-style: italic; }
.mm-ch-you .mm-tick { color: var(--muted); }
.mm-ch-you .mm-tick.read { color: var(--gold-d); }
.mm-ch-skel { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.mm-ch-skel .av { width: 48px; height: 48px; flex: none; border-radius: 50%; }
.mm-ch-skel .l1 { width: 120px; height: 14px; margin-bottom: 8px; }
.mm-ch-skel .l2 { width: 180px; height: 12px; }
.mm-ch-thread { position: relative; background: var(--card); }
.mm-ch-thread > .mm-state { grid-row: 1 / -1; align-self: center; margin: 24px; border: 0; background: transparent; }
.mm-ch-thread .mm-thread-head { position: relative; z-index: 3; gap: 10px; min-height: 64px; padding: 10px 14px; background: var(--card); }
.mm-ch-back { display: none; border: 0; background: none; width: 40px; height: 40px; flex: none; }
.mm-ch-who { display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.mm-ch-who .who { display: grid; min-width: 0; }
.mm-ch-who .who b, .mm-thread-head .who b { display: flex; align-items: center; gap: 6px; font: 600 19px/1.2 var(--font-serif); color: var(--deep); white-space: nowrap; overflow: hidden; }
.mm-ch-who .who b span, .mm-thread-head .who b span { overflow: hidden; text-overflow: ellipsis; font-size: inherit; color: inherit; }
.mm-ch-who .who b .vf { color: var(--blue); flex: none; }
.mm-ch-status { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-ch-on { color: var(--green); font-weight: 600; }
.mm-ch-badges { display: flex; gap: 6px; flex: none; }
.mm-ch-hacts { display: flex; gap: 6px; align-items: center; flex: none; }
.mm-ch-hacts .mm-iconbtn { width: 40px; height: 40px; }
.mm-ch-menuwrap { position: relative; }
.mm-ch-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; display: grid; gap: 2px; min-width: 236px; padding: 6px; border-radius: 14px;
  background: var(--glass); backdrop-filter: blur(12px); border: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: mm-rise .16s both; }
.mm-ch-menu > * { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: none; cursor: pointer;
  color: var(--deep); font: 500 15px var(--font-body); text-decoration: none; text-align: left; }
.mm-ch-menu > *:hover, .mm-ch-menu > *:focus-visible { background: color-mix(in srgb, var(--gold) 11%, transparent); outline: none; }
.mm-ch-menu .danger { color: var(--error); }
.mm-ch-thread .mm-msgs { gap: 2px; padding: 18px 20px 12px; overscroll-behavior: contain; scrollbar-width: thin;
  background: linear-gradient(180deg, var(--ivory), color-mix(in srgb, var(--cream) 55%, var(--ivory))); }
.mm-ch-line { display: flex; align-items: flex-end; gap: 4px; max-width: 82%; margin-top: 8px; }
.mm-ch-line.cont { margin-top: 2px; }
.mm-ch-line.me { align-self: flex-end; flex-direction: row-reverse; }
.mm-ch-line.them { align-self: flex-start; }
.mm-ch-line .mm-bub { max-width: 100%; white-space: normal; box-shadow: 0 1px 1.5px color-mix(in srgb, var(--deep) 8%, transparent); }
.mm-ch-line .mm-bub > span { white-space: pre-wrap; overflow-wrap: anywhere; }
.mm-ch-line.them .mm-bub { border-radius: 4px 16px 16px 16px; }
.mm-ch-line.me .mm-bub { border-radius: 16px 4px 16px 16px; }
.mm-ch-line.them.cont .mm-bub { border-radius: 6px 16px 16px 6px; }
.mm-ch-line.me.cont .mm-bub { border-radius: 16px 6px 6px 16px; }
.mm-ch-line .mm-bub small { float: right; display: inline-flex; align-items: center; gap: 4px; margin: 7px 0 -3px 12px; font-size: 11px; opacity: .72; }
.mm-tick { font-size: 11px; letter-spacing: -2.5px; padding-right: 2px; }
.mm-tick.sent { opacity: .55; }
.mm-tick.pend { letter-spacing: 0; }
.mm-bub.me .mm-tick.read { color: var(--gold-l); opacity: 1; }
.mm-ch-fam { font-style: italic; }
.mm-ch-bmore { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--muted);
  cursor: pointer; opacity: 0; transition: opacity .15s; }
.mm-ch-bmore svg { width: 16px; height: 16px; }
.mm-ch-line:hover .mm-ch-bmore, .mm-ch-bmore:focus-visible { opacity: 1; }
.mm-ch-line.failed { flex-direction: column; align-items: flex-end; }
.mm-ch-line.failed .mm-bub { opacity: .65; }
.mm-ch-line.failed .mm-link { color: var(--error); }
.mm-ch-sys { align-self: center; display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 86%; margin: 12px 0; text-align: center; }
.mm-ch-sys > span { padding: 6px 13px; border-radius: 10px; border: 1px solid var(--border); background: color-mix(in srgb, var(--gold) 9%, var(--card));
  color: var(--muted); font-size: 13px; line-height: 1.4; }
.mm-ch-sys.contact > span { color: var(--brown); }
.mm-ch-hello { align-self: center; display: grid; justify-items: center; gap: 6px; max-width: 360px; margin: 16px 0 6px; text-align: center; }
.mm-ch-hello b { font: 600 21px var(--font-serif); }
.mm-ch-older { align-self: center; margin-bottom: 8px; }
.mm-ch-loading { padding: 8px; }
.mm-ch-gate { overflow: auto; padding: 24px; }
.mm-ch-foot { border-top: 1px solid var(--line); background: var(--card); }
.mm-ch-foot .mm-typing { display: block; min-height: 22px; padding: 6px 18px 0; color: var(--green); font-size: 12.5px; }
.mm-ch-foot .mm-typing:empty { min-height: 8px; padding-top: 0; }
.mm-ch-dots { display: inline-flex; gap: 2px; margin-left: 3px; }
.mm-ch-dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; animation: mm-ch-blink 1.2s infinite; }
.mm-ch-dots i:nth-child(2) { animation-delay: .2s; }
.mm-ch-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes mm-ch-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.mm-ch-foot .mm-starters { padding: 6px 12px 0; }
.mm-ch-foot .mm-starters[hidden] { display: none; }
.mm-starters .mm-label { width: 100%; font-size: 11px; }
.mm-starters .mm-chip { height: auto; min-height: 38px; padding: 8px 13px; border-radius: 14px; line-height: 1.35; white-space: normal; text-align: left; font-size: 14px; }
.mm-ch-foot .mm-compose { gap: 8px; padding: 8px 12px 6px; border-top: 0; background: transparent; }
.mm-app .mm-ch-foot .mm-textarea { min-height: 44px; max-height: 140px; padding: 11px 16px; border-radius: 22px; resize: none; background: var(--ivory); line-height: 1.4; }
.mm-ch-send { flex: none; width: 44px; min-width: 44px; padding: 0; border-radius: 50%; }
.mm-ch-safety { margin: 0; padding: 0 16px 8px; font-size: 11.5px; color: var(--muted); text-align: center; }

/* ── tablet 768–1024 ────────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .mm-sx { grid-template-columns: 1fr; gap: 12px; }
  .mm-sx-panel { display: none; position: static; max-height: none; overflow: visible; }
  .mm-sx.filters-open .mm-sx-panel { display: block; animation: mm-rise .2s both; }
  .mm-sx-ftoggle { display: inline-flex; }
  .mm-sx-go { position: sticky; bottom: 0; }
  .mm-sx-group .mm-chip { font-size: 15px; }
  .mm-ac-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mm-ch-badges { display: none; }
  .mm-sl-divider { display: none; }
  .mm-side .mm-sl-add { margin-top: 0; }
}

/* ── single-pane chat (phones + narrow tablets <820) ─────────────────────────────────── */
@media (max-width: 819px) {
  .mm-ch-back { display: grid; }
  .mm-ch-page.thread-open .mm-ch-pagehead { display: none; }
  .mm-ch-list, .mm-ch-items { overflow: visible; }
  .mm-ch-page:not(.thread-open) .mm-ch-thread { display: none; }
  .mm-ch-thread { min-height: 0; }
  .mm-ch-prof { display: none; }
}

/* ── phone ≤767 ─────────────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  :is(.mm-sx-page, .mm-ib-page, .mm-ac-page) .mm-tab { padding: 0 10px; }
  .mm-sx-tl { display: none; }
  .mm-sx-head > div:first-child { display: none; }
  .mm-ib-actlink { display: none; }
  .mm-sx-head { align-items: stretch; }
  .mm-sx-id { min-width: 0; width: 100%; }
  .mm-sx-bar { gap: 8px; }
  .mm-sx-count { order: -1; flex-basis: 100%; }
  .mm-sx-bar .mm-btn.ghost { margin-left: auto; }
  .mm-sx-panel { padding: 14px 14px 0; }
  .mm-sx-go { margin: 0 -14px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); bottom: calc(64px + var(--vivah-consent-h, 0px)); }
  .mm-sx-idcard { grid-template-columns: 1fr; gap: 14px; }
  .mm-sx-idcard .mm-grid.single { max-width: 320px; }
  .mm-sx-scard { flex-direction: column; align-items: stretch; padding: 16px; }
  .mm-sx-scardact { max-width: none; justify-content: flex-start; }
  .mm-ib-row { grid-template-columns: 76px minmax(0, 1fr); gap: 12px 14px; padding: 12px; align-items: start; }
  .mm-ib-photo { width: 76px; border-radius: 12px; }
  .mm-ib-name { font-size: 19px; }
  .mm-ib-acts { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; min-width: 0; }
  .mm-ib-acts .mm-btn { flex: 1 1 0; width: auto; min-width: 0; }
  .mm-sl-head { align-items: flex-start; }
  .mm-sl-saved { margin: 0 12px 8px; }
  .mm-ac-lock { padding: 20px 18px; }
  .mm-ac-big { font-size: 50px; }
  .mm-app .mm-ac-lock h2 { font-size: 22px; }
  .mm-ac-blurs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .mm-ac-links { grid-template-columns: 1fr 1fr; gap: 8px; }
  .mm-ac-link { font-size: 14px; padding: 10px 12px; }
  .mm-ac-link .go { display: none; }
  .mm-ac-hrow .go { font-size: 0; }
  .mm-ac-hrow .go::after { content: '→'; font-size: 18px; }
  .mm-nt-item { padding: 12px; gap: 12px; }
  .mm-ch-page .mm-chat { border-radius: 16px; }
  .mm-ch-page.thread-open .mm-chat { margin: -12px -14px 0; border: 0; border-radius: 0; box-shadow: none; }
  body.mm-ch-full .mm-appbar { display: none; }
  body.mm-ch-full .mm-app { padding-bottom: 0; }
  .mm-ch-thread .mm-thread-head { min-height: 58px; padding: 8px 10px 8px 4px; gap: 6px; }
  .mm-ch-thread .mm-msgs { padding: 14px 12px 10px; }
  .mm-ch-line { max-width: 88%; }
  .mm-ch-bmore { width: 26px; height: 26px; opacity: .5; }
  .mm-ch-safety { display: none; }
  .mm-ch-foot .mm-compose { padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
  .mm-ch-tools .mm-chip { font-size: 15px; }
  .mm-ch-foot .mm-starters { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 2px; }
  .mm-ch-foot .mm-starters::-webkit-scrollbar { display: none; }
  .mm-ch-foot .mm-starters .mm-label { display: none; }
  .mm-ch-foot .mm-starters .mm-chip { flex: 0 0 80%; scroll-snap-align: start; font-size: 14px; }
}
@media (hover: none) { .mm-ch-bmore { opacity: .5; } }
