/* ==========================================================
   meet.trubible.com home (public/meet/index.html, js/meet-home.js).
   Tokens from style.css only; dark mode = data-theme="dark" on <html>
   (set from prefers-color-scheme). Phones first: 360px, ≥44px targets.
   Prefix: mh-  (the room page uses mt-, css/meet.css).
   ========================================================== */

.mh-body {
  display: flex; flex-direction: column;
  min-height: 100vh; min-height: 100dvh;
  background:
    radial-gradient(1200px 520px at 85% -10%, rgba(var(--accent-rgb), 0.10), transparent 60%),
    radial-gradient(900px 480px at -10% 0%, rgba(var(--primary-rgb), 0.10), transparent 60%),
    var(--bg-page);
  overflow-x: hidden;
}
.mh-main { flex: 1; display: flex; flex-direction: column; }
.mh-wrap { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 0 24px; box-sizing: border-box; }

/* Page state: html.mh-in = signed in (set early in <head>). */
html:not(.mh-in) .mh-only-in { display: none !important; }
html.mh-in .mh-only-out { display: none !important; }

/* ---------- Top bar ---------- */
.mh-top { padding-top: calc(14px + var(--safe-top)); padding-bottom: 14px; }
.mh-top .mh-wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mh-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--font-heading); font-weight: 700; font-size: 1.15rem; min-height: 44px; min-width: 0; }
.mh-brand:hover { color: var(--text); }
.mh-brand img { width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px; }
.mh-brand-tag {
  font-family: var(--font-body); font-size: var(--fs-xs); font-weight: 600;
  padding: 3px 9px; border-radius: var(--radius-full);
  background: var(--primary-bg); color: var(--primary); border: 1px solid var(--primary-border);
}
.mh-top-actions { display: flex; align-items: center; gap: 8px; }
.mh-top-actions .lang-btn { min-height: 44px; }
.mh-account { display: flex; align-items: center; gap: 6px; }
.mh-user { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: 600; color: var(--text-secondary); max-width: 180px; }
.mh-user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mh-top-actions .btn { min-height: 44px; }
.mh-signin, .mh-signout { white-space: nowrap; }

/* ---------- Hero ---------- */
.mh-hero {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 56px; align-items: center;
  padding-top: 40px; padding-bottom: 48px;
}
.mh-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px;
  font-size: var(--fs-sm); font-weight: 600; color: var(--primary);
}
.mh-eyebrow svg { width: 16px; height: 16px; }
.mh-hero h1 { font-size: var(--fs-4xl); letter-spacing: -0.03em; line-height: 1.1; margin: 0 0 14px; color: var(--text); }
.mh-lead { font-size: var(--fs-lg); color: var(--text-muted); line-height: 1.55; margin: 0 0 26px; max-width: 34em; }
.mh-hello { font-size: var(--fs-sm); color: var(--text-light); margin: 0 0 6px; font-weight: 500; }

.mh-join { display: flex; gap: 10px; align-items: stretch; max-width: 560px; }
.mh-join-field { position: relative; flex: 1; min-width: 0; }
.mh-join-field > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--text-light); pointer-events: none; }
.mh-join-field .form-control { min-height: 52px; padding-left: 44px; font-size: 1rem; border-radius: 12px; background: var(--bg-card); }
.mh-join .btn { min-height: 52px; padding-left: 24px; padding-right: 24px; }
.mh-join-error { max-width: 560px; margin-top: 8px; }
.mh-join-hint { font-size: var(--fs-xs); color: var(--text-light); margin: 10px 0 0; max-width: 560px; line-height: 1.5; }
.mh-join-hint code { font-family: var(--font-mono); font-size: 0.95em; color: var(--text-muted); background: var(--bg-hover); padding: 1px 5px; border-radius: 5px; }

.mh-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.mh-cta .btn { min-height: 48px; white-space: normal; text-align: center; }
.mh-cta-note { flex-basis: 100%; font-size: var(--fs-sm); color: var(--text-light); margin: 2px 0 0; }

/* Hero picture (signed out) */
.mh-media { position: relative; margin: 0; }
.mh-media picture, .mh-media img {
  display: block; width: 100%; aspect-ratio: 4 / 3; height: auto; object-fit: cover;
  border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
}
.mh-media img { border: 1px solid var(--border); background: var(--bg-hover); }
.mh-bubble {
  position: absolute; left: -18px; bottom: 26px; max-width: 78%;
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: 16px;
  background: var(--bg-elevated); color: var(--text);
  border: 1px solid var(--border); box-shadow: var(--shadow-md);
}
.mh-bubble .icon-chip { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; }
.mh-bubble .icon-chip svg { width: 17px; height: 17px; }
.mh-bubble strong { display: block; font-size: var(--fs-xs); color: var(--text-light); font-weight: 600; margin-bottom: 2px; }
.mh-bubble span { display: block; font-size: var(--fs-sm); font-weight: 600; line-height: 1.4; }

/* ---------- Cards ---------- */
.mh-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  padding: 22px;
}
.mh-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.mh-card-head h2 { font-size: var(--fs-xl); margin: 0; display: flex; align-items: center; gap: 10px; }
.mh-card-head h2 svg { width: 20px; height: 20px; color: var(--primary); }
.mh-card-sub { font-size: var(--fs-sm); color: var(--text-light); margin: -8px 0 14px; }

/* Upcoming meetings */
.mh-up-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mh-up {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--border-light); background: var(--bg-subtle);
}
.mh-up.is-now { border-color: var(--primary-border); background: var(--primary-bg); }
.mh-date {
  display: grid; place-items: center; text-align: center; line-height: 1.05;
  width: 52px; height: 54px; border-radius: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
}
.mh-date small { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--primary); }
.mh-date b { font-family: var(--font-heading); font-size: 1.3rem; color: var(--text); }
.mh-up-title { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mh-up-meta { font-size: var(--fs-xs); color: var(--text-light); display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px; }
.mh-up-meta span { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.mh-up-meta svg { width: 13px; height: 13px; flex-shrink: 0; }
.mh-up .btn { min-height: 44px; }
.mh-now { color: var(--primary); font-weight: 700; }
.mh-empty { text-align: center; padding: 22px 12px; color: var(--text-muted); font-size: var(--fs-sm); }
.mh-empty .icon-chip { margin: 0 auto 10px; }
.mh-empty p { margin: 0 0 12px; }

/* Rooms */
.mh-section { padding-top: 8px; padding-bottom: 40px; }
.mh-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.mh-section-head h2 { font-size: var(--fs-2xl); margin: 0; }
.mh-section-head p { margin: 4px 0 0; color: var(--text-light); font-size: var(--fs-sm); }
.mh-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.mh-room { display: flex; flex-direction: column; gap: 14px; transition: box-shadow var(--dur) var(--ease-out), border-color var(--dur) ease; }
.mh-room:hover { box-shadow: var(--shadow-md); border-color: var(--primary-border); }
.mh-room-head { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.mh-room-head .icon-chip { flex-shrink: 0; }
.mh-room-title { min-width: 0; flex: 1; }
.mh-room-title h3 { font-size: var(--fs-lg); margin: 0; overflow-wrap: break-word; line-height: 1.25; }   /* a room's whole name, on two lines if it must (it was cut: "Demo Console…") */
.mh-room-kind { font-size: var(--fs-xs); color: var(--text-light); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mh-room-url {
  display: block; font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-secondary);
  padding: 9px 12px; border-radius: 10px; background: var(--bg-subtle); border: 1px solid var(--border-light);
  overflow-wrap: anywhere;   /* the whole link, on two lines if it must: people copy it by eye too (it was cut) */
}
.mh-room-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.mh-room-actions .btn { min-height: 44px; }
.mh-room-actions .mh-grow { flex: 1 1 0; min-width: 0; }
/* a host's card (TINL-1476): Open, Copy link / New link, Password as a 2 × 2 grid; a label may wrap, never cut */
.mh-room-actions-host { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
/* the content may wrap too (review round 1): the icon, the word and the "On" pill are a row that cannot break, so a
   long word with its pill ("Contraseña Activa", or "Password On" at 360 px) was cut at both edges; now the pill drops
   under the word instead */
.mh-room-actions-host .btn { white-space: normal; line-height: 1.2; justify-content: center; text-align: center; padding-left: 10px; padding-right: 10px; flex-wrap: wrap; row-gap: 3px; }
.mh-pass-on { display: inline-block; margin-left: 2px; padding: 2px 7px; border-radius: 999px; background: var(--success-bg); color: var(--success); font-size: var(--fs-xs); font-weight: 700; line-height: 1.3; }
.mh-room-tools { display: flex; gap: 2px; margin: -6px -8px 0 0; flex-shrink: 0; }
.mh-room-tools .btn-icon { width: 44px; min-width: 44px; min-height: 44px; padding: 0; }

/* Signed-out explainer */
.mh-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding-top: 8px; padding-bottom: 48px; }
.mh-feature h3 { font-size: var(--fs-lg); margin: 14px 0 6px; }
.mh-feature p { margin: 0; color: var(--text-muted); font-size: var(--fs-sm); line-height: 1.6; }

/* ---------- Sign-in hand-off (/auth) ---------- */
.mh-spinner {
  display: inline-block; width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--primary);
  animation: mhSpin 0.8s linear infinite;
}
@keyframes mhSpin { to { transform: rotate(360deg); } }

/* ---------- Dialogs ---------- */
.mh-modal-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 20px; padding-right: 36px; }
.mh-modal-head h2 { margin: 0 0 2px; font-size: var(--fs-2xl); }
.mh-modal-head p { color: var(--text-light); font-size: var(--fs-sm); margin: 0; }
.mh-slug { display: flex; align-items: stretch; min-width: 0; }
.mh-slug-prefix {
  display: flex; align-items: center; padding: 0 10px;
  border: 1px solid var(--border-strong); border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  background: var(--bg-subtle); color: var(--text-light); font-family: var(--font-mono); font-size: 0.8rem; white-space: nowrap;
}
.mh-slug .form-control { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-family: var(--font-mono); min-width: 0; }
.mh-switch-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 14px 0; }
.mh-switch-row + .mh-switch-row { border-top: 1px solid var(--border-light); }
.mh-switch-row strong { display: block; font-size: var(--fs-sm); color: var(--text); font-weight: 600; }
.mh-switch-row span.mh-sw-desc { display: block; font-size: var(--fs-xs); color: var(--text-light); margin-top: 2px; line-height: 1.45; }
.mh-switch-row .switch { flex-shrink: 0; min-height: 44px; }
.mh-team-pick { display: grid; gap: 8px; }
/* "Schedule for which church?": each church is a button that opens its schedule dialog (js/meet-team.js) */
.mh-team-pick :is(a, button) {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px; width: 100%;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-card); color: var(--text);
  font: inherit; font-weight: 600; text-align: start; cursor: pointer;
}
.mh-team-pick :is(a, button):hover { border-color: var(--primary-border); background: var(--primary-bg); color: var(--text); }
.mh-team-pick :is(a, button):focus-visible { outline: none; box-shadow: var(--ring); }
.mh-team-pick :is(a, button) svg { width: 18px; height: 18px; color: var(--text-light); margin-left: auto; flex-shrink: 0; }

/* ---------- Footer ---------- */
.mh-foot { margin-top: auto; padding: 22px 0 calc(22px + var(--safe-bottom)); border-top: 1px solid var(--border); }
.mh-foot .mh-wrap { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; font-size: var(--fs-sm); color: var(--text-light); }
.mh-foot nav { display: flex; gap: 4px 16px; flex-wrap: wrap; }
.mh-foot a { color: var(--text-muted); display: inline-flex; align-items: center; min-height: 44px; }
.mh-foot a:hover { color: var(--primary); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .mh-hero { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 20px; padding-bottom: 36px; }
  .mh-media { max-width: 560px; }
  .mh-bubble { left: 12px; }
  .mh-features { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .mh-wrap { padding-left: 16px; padding-right: 16px; }
  .mh-hero h1 { font-size: var(--fs-3xl); }
  .mh-lead { font-size: var(--fs-base); margin-bottom: 20px; }
  .mh-join { flex-wrap: wrap; }
  .mh-join .btn { flex: 1 1 100%; }
  .mh-cta .btn { flex: 1 1 100%; }
  .mh-card { padding: 18px 16px; }
  .mh-up { grid-template-columns: 48px minmax(0, 1fr); padding: 10px; }
  .mh-up .btn { grid-column: 1 / -1; width: 100%; }
  .mh-date { width: 48px; height: 50px; }
  .mh-user-name { display: none; }
  .mh-signout span { display: none; }
  .mh-signout { width: 44px; padding: 0; }
  .mh-brand-tag { display: none; }
  .mh-modal-head .icon-chip { display: none; }
  .mh-slug-prefix { display: none; }
  .mh-slug .form-control { border-radius: var(--radius-sm); }
  .mh-bubble { max-width: calc(100% - 24px); bottom: 12px; }
}

/* ---------- Simpler landing (owner, Nov 26 2026): ONE main button, what a room has at a glance, tabs on a phone ---------- */
/* Signed in, the page's one main button is "Start a meeting": it comes first, and Join is a quiet button beside its box. */
html.mh-in .mh-hero-text { display: flex; flex-direction: column; }
html.mh-in .mh-cta { order: 1; margin-top: 6px; }
html.mh-in .mh-join { order: 2; margin-top: 18px; }
html.mh-in .mh-join-error { order: 3; }
html.mh-in .mh-join-hint { order: 4; }
html.mh-in .mh-has { order: 5; }
html.mh-in .mh-tabs { order: 6; }
html.mh-in #mh-join-btn { background: var(--bg-card); color: var(--text); border: 1px solid var(--border); box-shadow: none; }
html.mh-in #mh-join-btn:hover { background: var(--bg-hover); }
html.mh-in .mh-cta .btn-primary { min-height: 56px; font-size: 1.06rem; }
html.mh-in .mh-cta .btn-primary svg { animation: mh-cam 2.6s ease-in-out 0.8s 2; }

.mh-has { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; max-width: 620px; }
.mh-has li {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text); font-size: 0.88rem; font-weight: 600;
  animation: mh-has-in 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.mh-has li:nth-child(2) { animation-delay: 70ms; } .mh-has li:nth-child(3) { animation-delay: 140ms; } .mh-has li:nth-child(4) { animation-delay: 210ms; }
.mh-has svg { width: 16px; height: 16px; color: var(--brand); flex: none; }
@keyframes mh-has-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes mh-cam { 0%, 100% { transform: none; } 30% { transform: scale(1.18) rotate(-6deg); } 60% { transform: scale(1.05) rotate(3deg); } }

/* the lists as tabs: a phone only */
.mh-tabs { display: none; }
@media (max-width: 760px) {
  html.mh-in .mh-tabs {
    display: flex; gap: 4px; margin: 22px 0 0; padding: 4px; border-radius: 14px; background: var(--bg-hover);
  }
  .mh-tabs::-webkit-scrollbar { display: none; }
  .mh-tabs [role="tab"] {
    flex: 1 1 0; min-width: 0; min-height: 44px; padding: 4px 6px; border: 0; line-height: 1.2; text-align: center; border-radius: 10px; background: transparent; color: var(--text-muted);
    font: inherit; font-size: 0.84rem; font-weight: 650; cursor: pointer; white-space: normal;   /* three equal tabs, words on two lines if they must ("Church mee…" was cut) */ transition: background 160ms ease, color 160ms ease;
  }
  .mh-tabs [role="tab"][aria-selected="true"] { background: var(--bg-card); color: var(--text); box-shadow: var(--shadow-xs, 0 1px 2px rgba(0, 0, 0, 0.08)); }
  .mh-tabs [role="tab"][hidden] { display: none; }
  html.mh-in[data-mh-tab="up"] #mh-rooms-sec, html.mh-in[data-mh-tab="up"] #mh-team,
  html.mh-in[data-mh-tab="rooms"] #mh-up, html.mh-in[data-mh-tab="rooms"] #mh-team,
  html.mh-in[data-mh-tab="team"] #mh-up, html.mh-in[data-mh-tab="team"] #mh-rooms-sec { display: none !important; }
  /* (a list's own heading says what the chosen tab already says) */
  html.mh-in[data-mh-tab] #mh-up .mh-card-head, html.mh-in[data-mh-tab] #mh-rooms-sec .mh-section-head > div:first-child h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  /* (one row a thumb can slide, so the lists start on the first screen) */
  /* all four in sight, two by two (a row running off the edge hid "Screen sharing" and the AI agenda) */
  .mh-has { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 18px 0 0; max-width: none; }
  .mh-has li { font-size: 0.82rem; padding: 6px 10px; white-space: normal; line-height: 1.25; min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) { .mh-has li, html.mh-in .mh-cta .btn-primary svg { animation: none; } }
@media (max-width: 760px) {
  /* (signed in on a phone: Join stays a small button beside its box, not a second full-width button) */
  html.mh-in .mh-join { flex-wrap: nowrap; }
  html.mh-in .mh-join .btn { flex: 0 0 auto; padding-left: 16px; padding-right: 16px; }
}

/* Recordings (js/meet-recs.js): one row each, kept 10 days */
.mh-recs { display: flex; flex-direction: column; gap: 10px; }
.mh-rec { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--bg-card); }
.mh-rec-icon { flex-shrink: 0; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--primary-bg); color: var(--primary); }
.mh-rec-icon svg { width: 22px; height: 22px; }
.mh-rec-body { flex: 1; min-width: 0; }
.mh-rec-body h3 { margin: 0; font-size: var(--fs-md, 1rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mh-rec-body p { margin: 2px 0 0; color: var(--text-light); font-size: var(--fs-sm); }
.mh-rec-gone svg { width: 14px; height: 14px; vertical-align: -2px; }
.mh-rec-actions { display: flex; gap: 6px; flex-shrink: 0; }
@media (max-width: 640px) {
  .mh-rec { flex-wrap: wrap; }
  .mh-rec-actions { width: 100%; justify-content: flex-end; }
}
/* the page's tabs (narrow screens): the recordings go with "Your rooms" */
@media (max-width: 760px) {
  html.mh-in[data-mh-tab="up"] #mh-recs, html.mh-in[data-mh-tab="team"] #mh-recs { display: none !important; }
}
