/* Shubh Muhrat Matchmaker v3 — the design system for /matrimonial-matchmaking/* (one app shell, frontend/match.html).
   Product tokens only (css/vivah.css :root); everything is scoped to the Matchmaker's own classes (mm-*) so the
   shared header (#vivah-site-header) is untouched. Device classes: phone ≤767 · tablet 768–1024 · desktop ≥1025. */
:root {
  --ivory: #FAF8F3; --cream: #F4EFE4; --sand: #E6D9C0; --gold: #C9943C; --gold-l: #E8B85A; --gold-d: #8C6320;
  --rose: #B85C4A; --rose-l: #D4846F; --deep: #160F04; --brown: #3A2210; --muted: #7A6A54; --green: #2D7A4F;
  --blue: #1A4A7A; --error: #C2413A; --border: rgba(201,148,60,.22); --radius: 16px;
  --font-serif: 'Cormorant Garamond', Georgia, serif; --font-body: 'Outfit', system-ui, sans-serif;
  --card: #fff; --line: rgba(58,34,16,.09); --shadow: 0 1px 2px rgba(22,15,4,.05), 0 8px 24px rgba(22,15,4,.07);
  --shadow-lg: 0 24px 64px rgba(22,15,4,.18); --glass: linear-gradient(160deg, rgba(255,253,248,.97), rgba(250,244,232,.95));
  --grad: linear-gradient(135deg, var(--gold), var(--rose)); --ok: #2D7A4F; --mm-max: 1240px; --tap: 44px;
}
.mm-body { margin: 0; background: var(--ivory); color: var(--deep); font-family: var(--font-body); -webkit-font-smoothing: antialiased; }
.mm-body * { box-sizing: border-box; }
.mm-app { max-width: var(--mm-max); margin: 0 auto; padding: 20px 24px 64px; min-height: 60vh; }
.mm-app a { color: inherit; }
.mm-app h1, .mm-app h2, .mm-app h3 { font-family: var(--font-serif); font-weight: 600; color: var(--deep); margin: 0; letter-spacing: -.005em; }
.mm-app h1 { font-size: 34px; line-height: 1.1; }
.mm-app h2 { font-size: 26px; line-height: 1.15; }
.mm-app h3 { font-size: 20px; }
.mm-muted { color: var(--muted); }
.mm-small { font-size: 13px; }
.mm-hidden, [hidden] { display: none !important; }
.mm-boot { display: grid; place-items: center; gap: 12px; padding: 18vh 0; color: var(--muted); }
.mm-spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--sand); border-top-color: var(--gold); animation: mm-spin 1s linear infinite; }
@keyframes mm-spin { to { transform: rotate(360deg); } }
@keyframes mm-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes mm-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .mm-body *, .mm-body *::before, .mm-body *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ── header integration ─────────────────────────────────────────────────────────────── */
#vh-custom-nav a .mm-nbadge:empty { display: none; }
.mm-nbadge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px;
  background: var(--rose); color: #fff; font-size: 11px; font-weight: 700; vertical-align: 1px; }
.mm-bell { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border);
  background: rgba(255,255,255,.06); color: var(--vh-ivory, #F3E9D8); cursor: pointer; }   /* lives in the dark shared header */
.mm-bell:hover { background: rgba(201,148,60,.14); }
.mm-bell-dot { position: absolute; top: 7px; right: 8px; min-width: 9px; height: 9px; border-radius: 5px; background: var(--rose); box-shadow: 0 0 0 2px #1a0f08; }
.mm-appbar { display: none; }
.mm-bottomnav { display: none; }
.mm-family-banner { max-width: var(--mm-max); margin: 12px auto 0; padding: 10px 16px; border-radius: 12px; background: #fff7e6;
  border: 1px solid var(--border); color: var(--brown); font-size: 14px; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.mm-family-banner b { color: var(--gold-d); }

/* ── buttons & fields ─────────────────────────────────────────────────────────────── */
.mm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 20px; border-radius: 12px;
  border: 0; background: var(--grad); color: #fff; font: 600 15px/1 var(--font-body); cursor: pointer; text-decoration: none; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(184,92,74,.22); transition: transform .12s, box-shadow .15s, opacity .15s; }
.mm-btn:hover { box-shadow: 0 8px 24px rgba(184,92,74,.3); }
.mm-btn:active { transform: translateY(1px); }
.mm-btn[disabled], .mm-btn.is-busy { opacity: .55; cursor: not-allowed; box-shadow: none; }
.mm-btn.ghost { background: transparent; color: var(--brown); border: 1.5px solid var(--border); box-shadow: none; }
.mm-btn.ghost:hover { border-color: var(--gold); background: rgba(201,148,60,.06); }
.mm-btn.soft { background: #fff; color: var(--brown); border: 1px solid var(--line); box-shadow: none; }
.mm-btn.dark { background: var(--deep); box-shadow: none; }
.mm-btn.danger { background: #fff; color: var(--error); border: 1.5px solid rgba(194,65,58,.35); box-shadow: none; }
.mm-btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.mm-btn.block { width: 100%; }
.mm-iconbtn { display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); border-radius: 50%; border: 1px solid var(--line); background: #fff;
  color: var(--brown); cursor: pointer; }
.mm-iconbtn:hover { border-color: var(--gold); color: var(--gold-d); }
.mm-iconbtn.on { color: var(--rose); border-color: rgba(184,92,74,.4); background: #fff5f2; }
.mm-link { color: var(--gold-d); font-weight: 600; text-decoration: none; cursor: pointer; background: none; border: 0; font: inherit; padding: 0; }
.mm-link:hover { text-decoration: underline; }
.mm-field { display: grid; gap: 6px; margin-bottom: 14px; }
.mm-field > label, .mm-label { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.mm-input, .mm-textarea { width: 100%; min-height: var(--tap); padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff;
  color: var(--deep); font: 15px/1.4 var(--font-body); outline: none; transition: border-color .15s, box-shadow .15s; }
.mm-textarea { min-height: 96px; resize: vertical; }
.mm-input:focus, .mm-textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,148,60,.14); }
.mm-input.is-bad, .mm-textarea.is-bad { border-color: var(--error); box-shadow: 0 0 0 3px rgba(194,65,58,.12); }
.mm-err { color: var(--error); font-size: 13px; }
.mm-help { color: var(--muted); font-size: 13px; }
.mm-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mm-row.end { justify-content: flex-end; }
.mm-row.between { justify-content: space-between; }
.mm-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
/* styled select (never a native <select>): a button that opens a listbox sheet */
.mm-select { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: var(--tap);
  padding: 0 40px 0 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; color: var(--deep); font: 15px var(--font-body);
  cursor: pointer; text-align: left; }
.mm-select::after { content: ''; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; margin-top: -6px; border-right: 2px solid var(--gold-d);
  border-bottom: 2px solid var(--gold-d); transform: rotate(45deg); }
.mm-select .ph { color: var(--muted); }
.mm-opts { display: grid; gap: 4px; max-height: 50vh; overflow: auto; }
.mm-opt { display: flex; align-items: center; justify-content: space-between; min-height: var(--tap); padding: 0 14px; border-radius: 10px; border: 0;
  background: transparent; font: 15px var(--font-body); color: var(--deep); cursor: pointer; text-align: left; }
.mm-opt:hover { background: rgba(201,148,60,.08); }
.mm-opt.on { background: rgba(201,148,60,.14); font-weight: 600; }
.mm-opt.on::after { content: '✓'; color: var(--gold-d); }
/* chips */
.mm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mm-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 19px; border: 1.5px solid var(--line);
  background: #fff; color: var(--brown); font: 500 14px var(--font-body); cursor: pointer; white-space: nowrap; }
.mm-chip:hover { border-color: var(--gold); }
.mm-chip.on { background: var(--deep); border-color: var(--deep); color: #fff; }
.mm-chip .n { font-size: 12px; opacity: .7; }
.mm-chip.lock::after { content: '★'; font-size: 11px; color: var(--gold); }
/* segmented control (Must have | Preferred | Open to) */
.mm-seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--cream); border: 1px solid var(--line); gap: 2px; }
.mm-seg button { min-height: 34px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--brown); font: 500 13px var(--font-body); cursor: pointer; }
.mm-seg button.on { background: #fff; color: var(--deep); font-weight: 600; box-shadow: 0 1px 4px rgba(22,15,4,.12); }
.mm-seg button[data-level="must"].on { background: var(--deep); color: #fff; }
.mm-seg button:disabled { opacity: .35; cursor: not-allowed; }
/* dual range */
.mm-range { position: relative; height: 34px; }
.mm-range input[type=range] { position: absolute; left: 0; right: 0; top: 10px; width: 100%; margin: 0; pointer-events: none; background: none; -webkit-appearance: none; appearance: none; }
.mm-range input[type=range]::-webkit-slider-thumb { pointer-events: auto; -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 2px solid var(--gold); box-shadow: 0 1px 4px rgba(0,0,0,.2); cursor: pointer; }
.mm-range input[type=range]::-moz-range-thumb { pointer-events: auto; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid var(--gold); cursor: pointer; }
.mm-range .track { position: absolute; left: 0; right: 0; top: 19px; height: 4px; border-radius: 2px; background: var(--sand); }
.mm-range .fill { position: absolute; top: 19px; height: 4px; border-radius: 2px; background: var(--gold); }
.mm-range-val { font-weight: 600; color: var(--brown); font-size: 14px; }
.mm-switch { position: relative; width: 46px; height: 26px; flex: none; border-radius: 13px; background: var(--sand); border: 0; cursor: pointer; transition: background .15s; }
.mm-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.mm-switch.on { background: var(--green); }
.mm-switch.on::after { transform: translateX(20px); }
.mm-check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; cursor: pointer; line-height: 1.4; }
.mm-check input { width: 20px; height: 20px; flex: none; accent-color: var(--gold-d); margin-top: 1px; }

/* ── surfaces ─────────────────────────────────────────────────────────────────────── */
.mm-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.mm-panel + .mm-panel { margin-top: 16px; }
.mm-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 6px 0 18px; flex-wrap: wrap; }
.mm-page-head p { margin: 6px 0 0; color: var(--muted); }
.mm-section { margin: 28px 0 0; }
.mm-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.mm-section-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.mm-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.mm-tabs::-webkit-scrollbar { display: none; }
.mm-tab { position: relative; min-height: var(--tap); padding: 0 14px; border: 0; background: none; color: var(--muted); font: 500 15px var(--font-body); cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.mm-tab.on { color: var(--deep); font-weight: 600; }
.mm-tab.on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2.5px; border-radius: 2px; background: var(--gold); }
.mm-tab .n { font-size: 12px; padding: 1px 7px; border-radius: 9px; background: var(--cream); color: var(--brown); }
.mm-split { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 28px; align-items: start; }
.mm-side { position: sticky; top: 132px; display: grid; gap: 4px; }
.mm-side a, .mm-side button { display: flex; align-items: center; justify-content: space-between; min-height: 42px; padding: 0 14px; border-radius: 10px; border: 0; background: none;
  color: var(--brown); font: 500 15px var(--font-body); text-decoration: none; cursor: pointer; text-align: left; }
.mm-side a:hover, .mm-side button:hover { background: rgba(201,148,60,.08); }
.mm-side a.on, .mm-side button.on { background: #fff; color: var(--deep); font-weight: 600; box-shadow: var(--shadow); }
.mm-side .n { font-size: 12px; color: var(--muted); }
.mm-state { display: grid; justify-items: center; gap: 10px; padding: 48px 20px; text-align: center; border: 1.5px dashed var(--border); border-radius: var(--radius); background: rgba(255,255,255,.6); }
.mm-state .ic { font-size: 30px; }
.mm-state h3 { font-size: 22px; }
.mm-state p { margin: 0; max-width: 460px; color: var(--muted); }
.mm-skel { background: linear-gradient(90deg, #efe7d8 25%, #f7f1e5 50%, #efe7d8 75%); background-size: 200% 100%; animation: mm-shimmer 1.3s infinite; border-radius: 12px; }
@keyframes mm-shimmer { 0% { background-position: 200% 0; } to { background-position: -200% 0; } }
.mm-note { padding: 12px 14px; border-radius: 12px; background: #fff8ea; border: 1px solid var(--border); color: var(--brown); font-size: 14px; line-height: 1.45; }
.mm-note.ok { background: #eef7f1; border-color: rgba(45,122,79,.25); color: #1f5a39; }
.mm-note.warn { background: #fff4f1; border-color: rgba(184,92,74,.28); color: #7a3527; }
.mm-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--cream); color: var(--brown); }
.mm-pill.gold { background: rgba(201,148,60,.14); color: var(--gold-d); }
.mm-pill.green { background: #e7f4ec; color: var(--green); }
.mm-pill.rose { background: #fbe9e4; color: var(--rose); }
.mm-pill.demo { background: #efe9ff; color: #5a3fb0; }
.mm-progress { height: 6px; border-radius: 3px; background: var(--sand); overflow: hidden; }
.mm-progress > i { display: block; height: 100%; border-radius: 3px; background: var(--grad); transition: width .4s; }

/* ── profile card (PM §30.2) ─────────────────────────────────────────────────────── */
.mm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.mm-rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 250px); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px 2px 12px; scrollbar-width: thin; }
.mm-rail > * { scroll-snap-align: start; }
.mm-card { position: relative; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; animation: mm-rise .35s both; }
.mm-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(22,15,4,.05), 0 14px 34px rgba(22,15,4,.1); }
.mm-card-photo { position: relative; display: block; aspect-ratio: 4 / 5; background: linear-gradient(160deg, #efe4cf, #e2cfae); overflow: hidden; }
.mm-card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mm-card-photo.blurred img { filter: blur(2px) saturate(.9); transform: scale(1.06); }
.mm-card-photo .noph { position: absolute; inset: 0; display: grid; place-items: center; font: 600 54px var(--font-serif); color: rgba(58,34,16,.35); }
.mm-card-top { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; gap: 6px; }
.mm-card-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.mm-card-save { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); color: var(--brown); display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.mm-card-save.on { color: var(--rose); }
.mm-card-body { display: grid; gap: 6px; padding: 12px 14px 14px; flex: 1; }
.mm-card-name { display: flex; align-items: center; gap: 6px; font: 600 19px/1.2 var(--font-serif); color: var(--deep); text-decoration: none; }
.mm-card-name .vf { color: var(--blue); flex: none; }
.mm-card-meta { font-size: 14px; color: var(--muted); line-height: 1.35; }
.mm-card-signal { display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 4px 10px; border-radius: 999px; background: rgba(201,148,60,.12);
  color: var(--gold-d); font-size: 13px; font-weight: 700; border: 0; cursor: pointer; }
.mm-card-signal.limited { background: var(--cream); color: var(--muted); font-weight: 600; }
.mm-card-reasons { display: grid; gap: 3px; margin: 2px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--brown); }
.mm-card-reasons li::before { content: '✓ '; color: var(--green); font-weight: 700; }
.mm-card-outside { font-size: 12px; color: var(--rose); }
.mm-card-actions { display: flex; gap: 8px; padding: 0 14px 14px; }
.mm-card-actions .mm-btn { flex: 1; min-height: 40px; font-size: 14px; }
.mm-card-state { flex: 1; display: inline-flex; align-items: center; justify-content: center; min-height: 40px; border-radius: 12px; background: var(--cream); color: var(--brown);
  font-size: 14px; font-weight: 600; }
.mm-card.compact .mm-card-reasons { display: none; }

/* ── why drawer / sheets / modals ────────────────────────────────────────────────── */
.mm-scrim { position: fixed; inset: 0; z-index: 1200; background: rgba(22,15,4,.46); animation: mm-fade .18s both; display: flex; }
.mm-sheet { margin: auto; width: min(560px, calc(100vw - 32px)); max-height: min(86vh, 900px); overflow: auto; background: var(--glass); backdrop-filter: blur(12px);
  border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 22px 22px 20px; animation: mm-rise .24s both; }
.mm-sheet.wide { width: min(760px, calc(100vw - 32px)); }
.mm-sheet.drawer { margin: 0 0 0 auto; height: 100%; max-height: none; width: min(460px, 100vw); border-radius: 22px 0 0 22px; animation: mm-slidein .24s both; }
@keyframes mm-slidein { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.mm-sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.mm-sheet-head h2 { font: 600 24px/1.15 var(--font-serif); margin: 0; }
.mm-sheet-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.mm-x { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(58,34,16,.07); color: var(--brown); font-size: 22px; line-height: 1; cursor: pointer; }
.mm-sheet-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.mm-measures { display: grid; gap: 10px; margin: 6px 0 16px; }
.mm-measure { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; }
.mm-measure b { font-size: 15px; }
.mm-measure span { font: 700 18px var(--font-body); color: var(--gold-d); }
.mm-measure .mm-progress { grid-column: 1 / -1; }
.mm-dim { display: grid; grid-template-columns: 130px 1fr 40px; gap: 10px; align-items: center; font-size: 14px; margin: 6px 0; }
.mm-dim .mm-progress { height: 5px; }
.mm-disclaimer { margin-top: 14px; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.mm-list-check { display: grid; gap: 6px; }

/* ── profile page ────────────────────────────────────────────────────────────────── */
.mm-pp { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 32px; align-items: start; }
.mm-gallery { position: sticky; top: 132px; display: grid; gap: 10px; }
.mm-gallery-main { position: relative; aspect-ratio: 4 / 5; border-radius: 20px; overflow: hidden; background: linear-gradient(160deg, #efe4cf, #e2cfae); box-shadow: var(--shadow); }
.mm-gallery-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mm-gallery-main.blurred img { filter: blur(3px); transform: scale(1.05); }
.mm-thumbs { display: flex; gap: 8px; overflow-x: auto; }
.mm-thumbs button { width: 64px; height: 80px; flex: none; border-radius: 10px; overflow: hidden; border: 2px solid transparent; padding: 0; cursor: pointer; background: var(--sand); }
.mm-thumbs button.on { border-color: var(--gold); }
.mm-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.mm-pp-hero { display: grid; gap: 10px; }
.mm-pp-name { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mm-pp-facts { color: var(--muted); font-size: 16px; }
.mm-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.mm-actions-bar { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 4px; }
.mm-kv { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 8px 16px; font-size: 15px; }
.mm-kv dt { color: var(--muted); }
.mm-kv dd { margin: 0; color: var(--deep); }
.mm-pp-section { padding: 18px 0; border-top: 1px solid var(--line); }
.mm-pp-section h3 { margin-bottom: 10px; }
.mm-prompt { padding: 12px 14px; border-radius: 12px; background: var(--cream); margin-top: 8px; }
.mm-prompt b { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 3px; }
.mm-locked { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; background: #fbf7ef; border: 1px dashed var(--border); color: var(--muted); font-size: 14px; }

/* ── dashboard ───────────────────────────────────────────────────────────────────── */
.mm-hello { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 22px 24px; border-radius: 20px;
  background: linear-gradient(135deg, #1f1408, #3a2210); color: #f7ecd6; box-shadow: var(--shadow); }
.mm-hello h1 { color: #fff; font-size: 30px; }
.mm-hello p { margin: 6px 0 0; color: rgba(247,236,214,.8); }
.mm-hello .mm-progress { background: rgba(255,255,255,.14); margin-top: 12px; max-width: 420px; }
.mm-hello .mm-btn.ghost { color: #f7ecd6; border-color: rgba(232,184,90,.45); }
.mm-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.mm-tile { display: grid; gap: 2px; padding: 14px 16px; border-radius: 16px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); text-decoration: none; color: var(--deep); }
.mm-tile b { font: 700 26px var(--font-body); }
.mm-tile span { color: var(--muted); font-size: 14px; }
.mm-tile:hover { border-color: var(--gold); }
.mm-dash { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
/* grid children never widen their track (a horizontal rail / long unbroken text scrolls or wraps inside) */
.mm-dash > *, .mm-split > *, .mm-wizard > *, .mm-chat > * { min-width: 0; }
.mm-aside { position: sticky; top: 132px; display: grid; gap: 16px; }
.mm-mini { display: flex; gap: 10px; align-items: center; padding: 8px 0; text-decoration: none; color: inherit; border-bottom: 1px solid var(--line); }
.mm-mini:last-child { border-bottom: 0; }
.mm-mini img, .mm-mini .ph { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; background: var(--sand); }
.mm-mini b { display: block; font-size: 15px; }
.mm-mini span { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }

/* ── messages ────────────────────────────────────────────────────────────────────── */
.mm-chat { display: grid; grid-template-columns: 320px minmax(0, 1fr); height: calc(100vh - 170px); min-height: 480px; background: #fff; border: 1px solid var(--line);
  border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); }
.mm-chat-list { border-right: 1px solid var(--line); overflow: auto; }
.mm-chat-item { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; cursor: pointer; }
.mm-chat-item.on, .mm-chat-item:hover { background: #fbf6ec; }
.mm-chat-item img, .mm-chat-item .ph { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex: none; background: var(--sand); }
.mm-chat-item .t { flex: 1; min-width: 0; }
.mm-chat-item b { display: flex; justify-content: space-between; gap: 6px; font-size: 15px; }
.mm-chat-item b small { color: var(--muted); font-weight: 400; font-size: 12px; }
.mm-chat-item span { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-chat-item .u { min-width: 20px; height: 20px; border-radius: 10px; background: var(--rose); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.mm-online { width: 9px; height: 9px; border-radius: 50%; background: #3fbf6f; display: inline-block; }
.mm-thread { display: grid; grid-template-rows: auto 1fr auto; min-width: 0; min-height: 0; }
.mm-thread-head { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.mm-thread-head .who { flex: 1; min-width: 0; }
.mm-thread-head .who b { display: block; font-size: 16px; }
.mm-thread-head .who span { color: var(--muted); font-size: 13px; }
.mm-msgs { overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; background: #fdfaf4; }
.mm-day { align-self: center; margin: 10px 0; font-size: 12px; color: var(--muted); padding: 3px 10px; border-radius: 9px; background: #fff; border: 1px solid var(--line); }
.mm-bub { max-width: min(78%, 520px); padding: 9px 13px; border-radius: 16px; background: #fff; border: 1px solid var(--line); font-size: 15px; line-height: 1.4; word-wrap: break-word; white-space: pre-wrap; }
.mm-bub.me { align-self: flex-end; background: #3a2210; color: #fff5e3; border-color: #3a2210; }
.mm-bub small { display: block; margin-top: 3px; font-size: 11px; opacity: .65; text-align: right; }
.mm-bub.sys { align-self: center; background: none; border: 0; color: var(--muted); font-size: 13px; }
.mm-typing { font-size: 12px; color: var(--muted); padding: 0 16px 4px; min-height: 16px; }
.mm-compose { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--line); background: #fff; }
.mm-compose .mm-textarea { min-height: 44px; max-height: 140px; }
.mm-starters { display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 16px; }
.mm-starters button { text-align: left; white-space: normal; min-height: 38px; }

/* ── forms / wizard ─────────────────────────────────────────────────────────────── */
.mm-wizard { display: grid; grid-template-columns: 240px minmax(0, 680px); gap: 32px; justify-content: center; align-items: start; }
.mm-steps { position: sticky; top: 132px; display: grid; gap: 2px; }
.mm-steps a { display: flex; gap: 10px; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: 15px; }
.mm-steps a i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 12px; background: var(--cream); color: var(--brown); flex: none; }
.mm-steps a.done i { background: var(--green); color: #fff; }
.mm-steps a.on { background: #fff; color: var(--deep); font-weight: 600; box-shadow: var(--shadow); }
.mm-steps a.on i { background: var(--gold); color: #fff; }
.mm-form-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.mm-crit { display: grid; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.mm-crit-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.mm-crit-head b { font-size: 16px; }
.mm-src { font-size: 12px; color: var(--gold-d); }

/* ── toast ──────────────────────────────────────────────────────────────────────── */
.mm-toast { position: fixed; left: 50%; bottom: calc(24px + var(--vivah-consent-h, 0px)); z-index: 1400; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: min(92vw, 520px); padding: 12px 18px; border-radius: 14px; background: #1f1408; color: #fff5e3; font-size: 15px; box-shadow: var(--shadow-lg); transition: opacity .2s, transform .2s; }
.mm-toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.mm-toast.err { background: #6b1f1a; }

/* ── tablet 768–1024 ─────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .mm-app { padding: 16px 20px 72px; }
  .vh-subheader-bar a { font-size: 14px !important; min-height: 44px; display: inline-flex; align-items: center; }
  .mm-split { grid-template-columns: minmax(0, 1fr); gap: 12px; }   /* minmax(0,…): a rail never widens the page */
  .mm-side { position: static; display: flex; overflow-x: auto; gap: 6px; scrollbar-width: none; }
  .mm-side a, .mm-side button { flex: none; min-height: 40px; border: 1.5px solid var(--line); background: #fff; border-radius: 20px; }
  .mm-side a.on, .mm-side button.on { background: var(--deep); color: #fff; box-shadow: none; }
  .mm-side .n { margin-left: 6px; color: inherit; opacity: .7; }
  .mm-dash { grid-template-columns: minmax(0, 1fr); }
  .mm-aside { position: static; grid-template-columns: 1fr 1fr; }
  .mm-pp { grid-template-columns: minmax(0, 42%) minmax(0, 1fr); gap: 22px; }
  .mm-wizard { grid-template-columns: 1fr; }
  .mm-steps { position: static; display: flex; overflow-x: auto; gap: 6px; scrollbar-width: none; }
  .mm-steps a { flex: none; }
  .mm-chat { grid-template-columns: 280px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .mm-input, .mm-textarea, .mm-select, .mm-chip, .mm-opt, .mm-seg button, .mm-btn { font-size: 16px; }
  .mm-app input, .mm-app textarea, .mm-sheet input, .mm-sheet textarea { font-size: 16px !important; }
}
@media (max-width: 819px) {
  .mm-chat { grid-template-columns: 1fr; height: auto; min-height: 0; border-radius: 16px; }
  .mm-chat.has-thread .mm-chat-list { display: none; }
  .mm-chat:not(.has-thread) .mm-thread { display: none; }
  .mm-chat-list { border-right: 0; }
  .mm-thread { height: calc(100dvh - 190px - var(--vivah-consent-h, 0px)); }
}

/* ── phone ≤767 ─────────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .mm-body .vh-subheader-bar { display: none !important; }
  .mm-app { padding: 12px 14px calc(92px + var(--vivah-consent-h, 0px)); }
  .mm-app h1 { font-size: 28px; }
  .mm-app h2 { font-size: 23px; }
  .mm-appbar { position: sticky; top: var(--vh-header-h, 0px); z-index: 40; display: flex; align-items: center; gap: 4px; height: 50px; padding: 0 6px;
    background: rgba(250,248,243,.96); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
  .mm-ab-title { flex: 1; min-width: 0; font: 600 20px var(--font-serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 6px; }
  .mm-ab-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: var(--brown); cursor: pointer; }
  .mm-bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-template-columns: repeat(5, 1fr);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: rgba(255,253,248,.98); border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(22,15,4,.06); }
  body.vivah-consent-on .mm-bottomnav { bottom: var(--vivah-consent-h, 0px); }
  .mm-bottomnav a { position: relative; display: grid; justify-items: center; gap: 2px; min-height: 48px; padding-top: 4px; color: var(--muted); font-size: 11.5px; font-weight: 500; text-decoration: none; }
  .mm-bottomnav svg { width: 24px; height: 24px; }
  .mm-bottomnav a.on { color: var(--deep); font-weight: 600; }
  .mm-bottomnav a.on::before { content: ''; position: absolute; top: -6px; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold); }
  .mm-tbadge { position: absolute; top: 0; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--rose); color: #fff; font-size: 10.5px;
    font-style: normal; font-weight: 700; display: grid; place-items: center; }
  .mm-tbadge:empty { display: none; }
  .mm-body.mm-detail .mm-bottomnav { display: none; }
  .mm-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .mm-grid.single { grid-template-columns: 1fr; }
  .mm-rail { grid-auto-columns: 70%; }
  .mm-card-body { padding: 10px 12px 12px; }
  .mm-card-name { font-size: 17px; }
  .mm-card-reasons { font-size: 12.5px; }
  .mm-card-actions { padding: 0 12px 12px; }
  .mm-card-actions .mm-btn { font-size: 14px; min-height: 40px; padding: 0 10px; }
  .mm-hello { grid-template-columns: 1fr; padding: 18px; }
  .mm-hello h1 { font-size: 26px; }
  .mm-tiles { grid-template-columns: 1fr 1fr; }
  .mm-aside { grid-template-columns: 1fr; }
  .mm-pp { grid-template-columns: 1fr; gap: 16px; }
  .mm-gallery { position: static; margin: -12px -14px 0; }
  .mm-gallery-main { border-radius: 0; }
  .mm-thumbs { padding: 0 14px; }
  .mm-kv { grid-template-columns: 1fr 1.3fr; font-size: 14.5px; }
  .mm-grid2 { grid-template-columns: 1fr; }
  .mm-sheet { width: 100%; margin: auto 0 0; border-radius: 22px 22px 0 0; max-height: 92vh; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); animation: mm-up .24s both; }
  .mm-sheet.drawer { margin: auto 0 0; height: auto; max-height: 92vh; width: 100%; border-radius: 22px 22px 0 0; }
  @keyframes mm-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
  .mm-page-head { margin-top: 0; }
  .mm-sticky-actions { position: fixed; left: 0; right: 0; bottom: var(--vivah-consent-h, 0px); z-index: 61; display: flex; gap: 8px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255,253,248,.98); border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(22,15,4,.08); }
  .mm-sticky-actions .mm-btn { flex: 1; }
  .mm-dim { grid-template-columns: 100px 1fr 36px; }
  .mm-thread { height: calc(100dvh - 176px - var(--vivah-consent-h, 0px)); }
  .mm-family-banner { margin: 8px 14px 0; }
}
@media (max-width: 360px) { .mm-grid { grid-template-columns: 1fr; } }
