/* ==========================================================
   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 states: html.mh-in = signed in, html.mh-auth-mode = /auth hand-off (set early in <head>). */
.mh-auth { display: none; }
.mh-auth-mode .mh-auth { display: grid; }
.mh-auth-mode .mh-home { display: none; }
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: hidden; text-overflow: ellipsis; white-space: nowrap; }
.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: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.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; }
.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-auth { flex: 1; place-items: center; padding-top: 40px; padding-bottom: 64px; }
.mh-auth-card { max-width: 440px; width: 100%; text-align: center; padding: 32px 26px; }
.mh-auth-card h1 { font-size: var(--fs-2xl); margin: 16px 0 8px; }
.mh-auth-card p { color: var(--text-muted); margin: 0 0 20px; }
.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); } }
.mh-auth-card .icon-chip { margin: 0 auto; }
.mh-auth-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.mh-auth-actions .btn { min-height: 46px; }

/* ---------- 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; }
.mh-team-pick a {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-card); color: var(--text); font-weight: 600;
}
.mh-team-pick a:hover { border-color: var(--primary-border); background: var(--primary-bg); color: var(--text); }
.mh-team-pick a 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; }
}
