/* The home page (public/index.html), rebuilt 2026-11-10 from the approved prototype
   prototypes/home-facelift/v3-auto. Every class starts with hm- because app.css already owns
   names like .row and .toast. Phone first at 390 wide, holds at 320, widens at 700 and 900.
   Colors are the site's own tokens from app.css; each door's color comes from its
   tone-<name> class, which sets --tone-fg and --tone-bg (app.css, "ONE colour per
   destination"). docs/home-most-used-plan.md. */
.hm-body {
  --hm-gut: 16px;
  --hm-bar-h: 63px;
  --hm-live: #ff4d5e; --hm-live-2: #d42a3f; --hm-brand-deep: #4c5bea;
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.4 var(--font); -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
.hm-body a, .hm-body button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.hm-body button { font-family: inherit; }
.hm-body a:hover { color: inherit; }
.hm-body [hidden] { display: none !important; }
.hm-body :focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.hm-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.hm-body .nav-ico { width: 100%; height: 100%; }

/* ---------- Top bar: slim, and it scrolls away on a phone ---------- */
.hm-top { padding: env(safe-area-inset-top) max(6px, env(safe-area-inset-right)) 0 max(var(--hm-gut), env(safe-area-inset-left)); }
.hm-top__in { display: flex; align-items: center; gap: 12px; height: 52px; }
.hm-top__brand {
  display: flex; align-items: center; gap: 10px; min-height: 44px; margin-right: auto; padding-right: 6px;
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 14.5px; letter-spacing: -.005em;
  border-radius: 10px;
}
.hm-top__logo {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), #8f6bff); color: #fff;
  font-weight: 800; font-size: 11.5px; letter-spacing: .02em;
}
.hm-top__find, .hm-top__menu { display: none; }
.hm-top__me {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: none; cursor: pointer;
}
.hm-avatar {
  display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface-3); border: 1px solid var(--line-2); color: var(--ink);
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
}
.hm-top__me:active .hm-avatar { background: var(--line-2); }

/* ---------- Page ---------- */
.hm-page {
  max-width: 1168px; margin: 0 auto;
  padding: 2px max(var(--hm-gut), env(safe-area-inset-right)) calc(var(--hm-bar-h) + 20px + env(safe-area-inset-bottom)) max(var(--hm-gut), env(safe-area-inset-left));
}
.hm-hello { margin: 8px 0 20px; }
.hm-hello__date { margin: 0 0 2px; color: var(--muted); font-size: 13px; font-weight: 500; }
.hm-hello__name { margin: 0; font-size: 27px; line-height: 1.15; font-weight: 700; letter-spacing: -.022em; overflow-wrap: anywhere; }
.hm-empty { margin: 40px 0; color: var(--muted); text-align: center; }

.hm-sec { margin-top: 24px; }
.hm-sec__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 30px; margin-bottom: 9px; }
.hm-sec__title { margin: 0; font-size: 16px; line-height: 1.25; font-weight: 700; letter-spacing: -.012em; }
.hm-note { margin: -2px 0 12px; color: var(--muted); font-size: 13.5px; line-height: 1.4; }
.hm-txtbtn {
  flex: none; min-height: 44px; margin: -7px -10px -7px 0; padding: 0 10px; border: 0; border-radius: 10px;
  background: none; color: var(--brand-2); font: 600 14.5px var(--font); cursor: pointer;
}
.hm-txtbtn:active { background: var(--surface-2); }

/* ---------- Staff Meetings: red and loud only when live ---------- */
/* Live at load: the big red banner on top. If the meeting ends while the page is open it
   turns calm in place (no .is-live), so nothing below it moves. */
.hm-livenow {
  display: flex; align-items: center; gap: 12px; min-height: 86px; margin: 2px 0 16px; padding: 14px;
  border-radius: var(--radius-lg); color: #fff; text-decoration: none;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: transform .12s ease;
}
.hm-livenow.is-live {
  border-color: transparent;
  background: linear-gradient(135deg, var(--hm-live-2) 0%, #a81c30 100%);
  box-shadow: 0 12px 32px rgba(212, 42, 63, .34), inset 0 1px 0 rgba(255, 255, 255, .2);
}
.hm-livenow:active { transform: scale(.985); }
.hm-livenow__ico {
  display: grid; place-items: center; flex: none; width: 46px; height: 46px; padding: 10px; border-radius: 14px;
  background: rgba(255, 255, 255, .08); color: var(--muted);
}
.hm-livenow.is-live .hm-livenow__ico { background: rgba(255, 255, 255, .17); color: #fff; }
.hm-livenow__text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.hm-livenow__name { display: flex; align-items: center; gap: 8px; font-size: 18px; line-height: 1.2; font-weight: 700; letter-spacing: -.012em; color: var(--ink); }
.hm-livenow.is-live .hm-livenow__name { color: #fff; }
.hm-livenow__dot { display: none; flex: none; width: 9px; height: 9px; border-radius: 50%; background: #fff; }
.hm-livenow.is-live .hm-livenow__dot { display: block; box-shadow: 0 0 0 0 rgba(255, 255, 255, .6); animation: hm-live-pulse 2s ease-out infinite; }
@keyframes hm-live-pulse { 70% { box-shadow: 0 0 0 9px rgba(255, 255, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); } }
.hm-livenow__hint { font-size: 13.5px; line-height: 1.3; color: var(--muted); }
.hm-livenow.is-live .hm-livenow__hint { color: rgba(255, 255, 255, .94); }
.hm-livenow__go {
  flex: none; padding: 9px 15px; border-radius: 999px; background: var(--surface-3); color: var(--ink);
  font-size: 13.5px; font-weight: 700;
}
.hm-livenow.is-live .hm-livenow__go { background: #fff; color: #a81c30; }

/* Not live at load: the calm card in the middle. If a meeting starts while the page is
   open it turns red in place (.is-live), and moves to the top only on the next load. */
.hm-meet {
  display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  color: var(--ink); text-decoration: none;
}
.hm-meet:active { background: var(--surface-2); }
.hm-meet__ico {
  display: grid; place-items: center; flex: none; width: 36px; height: 36px; padding: 8px; border-radius: 10px;
  background: rgba(255, 255, 255, .06); color: var(--muted);
}
.hm-meet__text { display: grid; gap: 1px; flex: 1; min-width: 0; }
.hm-meet__name { display: flex; align-items: center; gap: 7px; font-size: 15px; line-height: 1.25; font-weight: 600; }
.hm-meet__dot { display: none; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.hm-meet__hint { font-size: 12.5px; line-height: 1.3; color: var(--muted); }
.hm-meet__go {
  flex: none; padding: 6px 11px; border-radius: 999px; background: var(--surface-3); color: var(--ink);
  font-size: 12.5px; font-weight: 600;
}
.hm-meet.is-live {
  border-color: transparent; color: #fff;
  background: linear-gradient(135deg, var(--hm-live-2) 0%, #a81c30 100%);
}
.hm-meet.is-live .hm-meet__ico { background: rgba(255, 255, 255, .17); color: #fff; }
.hm-meet.is-live .hm-meet__hint { color: rgba(255, 255, 255, .94); }
.hm-meet.is-live .hm-meet__go { background: #fff; color: #a81c30; }
.hm-meet.is-live .hm-meet__dot { display: block; animation: hm-live-pulse 2s ease-out infinite; }

/* ---------- Your most used: big tiles ---------- */
.hm-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hm-tile {
  display: flex; flex-direction: column; justify-content: space-between; gap: 10px;
  min-height: 104px; padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: linear-gradient(150deg, var(--tone-bg, var(--surface-3)) 0%, rgba(22, 24, 31, 0) 64%), var(--surface);
  color: var(--ink); text-decoration: none; text-align: left; font: inherit; cursor: pointer;
  transition: transform .12s ease, border-color .12s ease;
}
.hm-tile:active { transform: scale(.972); border-color: var(--tone-fg, var(--line-2)); }
.hm-tile__ico {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px; padding: 8px; border-radius: 12px;
  background: var(--tone-bg, var(--surface-3)); color: var(--tone-fg, var(--muted));
}
.hm-tile__text { display: block; min-width: 0; }
.hm-tile__label { display: block; font-size: 15px; line-height: 1.22; font-weight: 600; letter-spacing: -.006em; text-wrap: balance; overflow-wrap: anywhere; }
.hm-tile__hint { display: block; margin-top: 3px; font-size: 12.5px; line-height: 1.32; color: var(--muted); text-wrap: pretty; }
.hm-tiles--full .hm-tile { min-height: 132px; }
/* A tile that just came in gets a short glow on the visit it changes, so the change is seen. */
.hm-tile--new { animation: hm-tile-new 1.6s ease-out; }
@keyframes hm-tile-new { 0%, 30% { border-color: var(--tone-fg, var(--brand-2)); box-shadow: 0 0 0 3px var(--tone-bg, var(--brand-soft)); } }

/* ---------- Everything: one tidy list ---------- */
.hm-groups { display: grid; gap: 18px; }
.hm-group__title {
  margin: 0 0 7px 2px; color: var(--muted); font-size: 12px; line-height: 1.3; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
}
.hm-rows {
  list-style: none; margin: 0; padding: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.hm-rows > li + li { border-top: 1px solid var(--line); }
.hm-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 9px 8px 9px 12px;
  border: 0; background: none; color: var(--ink); text-decoration: none; text-align: left; font: inherit; cursor: pointer;
}
.hm-row:active { background: var(--surface-2); }
.hm-row:focus-visible { outline-offset: -3px; border-radius: 12px; }
.hm-row__ico {
  display: grid; place-items: center; flex: none; width: 36px; height: 36px; padding: 8px; border-radius: 10px;
  background: var(--tone-bg, var(--surface-3)); color: var(--tone-fg, var(--muted));
}
.hm-row__text { display: grid; gap: 1px; flex: 1; min-width: 0; }
.hm-row__name { font-size: 15px; line-height: 1.25; font-weight: 600; letter-spacing: -.004em; overflow-wrap: anywhere; }
.hm-row__name mark { background: rgba(125, 138, 255, .28); color: inherit; border-radius: 3px; }
.hm-row__hint { font-size: 12.5px; line-height: 1.32; color: var(--muted); overflow-wrap: anywhere; }
.hm-row__end { display: grid; place-items: center; flex: none; width: 24px; height: 40px; color: var(--faint); }
.hm-row--live .hm-row__ico { background: rgba(255, 77, 94, .16); color: #ff6b78; }
.hm-row--plain .hm-row__ico { background: var(--surface-3); color: var(--muted); }

.hm-iconbtn {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 0;
  border-radius: 12px; background: none; color: var(--muted); cursor: pointer;
}
.hm-iconbtn:active { background: var(--surface-3); color: var(--ink); }

/* ---------- Bottom bar: Find a page and the Menu, in thumb reach ---------- */
.hm-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center;
  padding: 8px max(10px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  background: rgba(14, 15, 20, .9); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(150%) blur(16px); backdrop-filter: saturate(150%) blur(16px);
}
.hm-bar__find {
  display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface-2);
  color: var(--muted); font: 500 15px var(--font); text-align: left; cursor: pointer; min-width: 0;
}
.hm-bar__find span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-bar__find:active { background: var(--surface-3); }
.hm-bar__find svg { color: var(--ink); flex: none; }
.hm-bar__menu {
  display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px 0 13px;
  border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface-2);
  color: var(--ink); font: 600 15px var(--font); cursor: pointer;
}
.hm-bar__menu:active { background: var(--surface-3); }
.hm-bar__menu svg { flex: none; }
.hm-bar--solo { grid-template-columns: minmax(0, 1fr); }
.hm-bar--solo .hm-bar__menu { justify-content: center; }
.hm-bar button:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.hm-btn {
  flex: none; min-height: 46px; padding: 0 24px; border: 0; border-radius: 13px;
  background: var(--hm-brand-deep); color: #fff; font: 600 15px var(--font); cursor: pointer;
}
.hm-btn:active { background: var(--brand); }
.hm-btn--ghost { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink); }
.hm-btn--ghost:active { background: var(--surface-3); }
.hm-btn--wide { width: 100%; }

/* The shared fixed pieces from app.css (the toast, the install hint, the update bar) sit
   above the bottom bar on this page instead of on top of it. */
.hm-has-bar .toast { bottom: calc(var(--hm-bar-h) + 14px + env(safe-area-inset-bottom)); }
.hm-has-bar .install-hint,
.hm-has-bar .update-bar { bottom: calc(var(--hm-bar-h) + 10px + env(safe-area-inset-bottom)); }
/* While a sheet is open the install hint steps aside. The update bar stays: it is how a
   deploy reaches a phone. */
.hm-sheet-open .install-hint { display: none; }
/* A sheet is open: the page behind it does not scroll. */
html.hm-sheet-open, body.hm-sheet-open { overflow: hidden; }

/* ---------- Sheets: Find, Menu, the Closing chooser ---------- */
/* Above the install hint and the update bar (95), under the Google sign in box. */
.hm-ov {
  position: fixed; inset: 0; z-index: 96; display: flex;
  background: rgba(4, 5, 8, .68); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  overscroll-behavior: contain;
}
.hm-ov--sheet { align-items: flex-end; justify-content: center; }
.hm-sheet {
  width: 100%; max-width: 520px; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); overflow: auto;
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
  border: 1px solid var(--line-2); border-bottom: 0; border-radius: 22px 22px 0 0; background: var(--surface);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .5); animation: hm-sheet-up .22s cubic-bezier(.2, .8, .2, 1);
}
@keyframes hm-sheet-up { from { transform: translateY(28px); opacity: 0; } }
/* The handle: a 22px strip, the same as the Menu's, and the sheet follows a swipe down. */
.hm-sheet__grab { width: 36px; height: 5px; margin: 0 auto 13px; border-radius: 3px; background: var(--faint); box-sizing: content-box; }
/* The chooser is all handle and never scrolls on a phone, so Safari must not take the drag. */
@media (max-width: 699px) { #ov-choose .hm-sheet { touch-action: none; } }
.hm-sheet__title { flex: 1; min-width: 0; margin: 0; font-size: 18px; line-height: 1.25; font-weight: 700; letter-spacing: -.014em; overflow-wrap: anywhere; }
.hm-sheet__sub { margin: 2px 0 14px; color: var(--muted); font-size: 14px; }
.hm-choices { display: grid; gap: 10px; margin-bottom: 14px; }
.hm-choice {
  display: flex; align-items: center; gap: 13px; min-height: 72px; padding: 12px 10px 12px 14px;
  border: 1px solid var(--line-2); border-radius: 16px;
  background: linear-gradient(150deg, var(--tone-bg, var(--surface-3)) 0%, rgba(28, 31, 40, 0) 70%), var(--surface-2);
  color: var(--ink); text-decoration: none;
}
.hm-choice:active { border-color: var(--tone-fg, var(--line-2)); }
.hm-choice__ico {
  display: grid; place-items: center; flex: none; width: 42px; height: 42px; padding: 9px; border-radius: 12px;
  background: var(--tone-bg, var(--surface-3)); color: var(--tone-fg, var(--muted));
}
.hm-choice__text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.hm-choice__name { font-size: 16px; line-height: 1.25; font-weight: 600; }
.hm-choice__hint { font-size: 13px; line-height: 1.3; color: var(--muted); }
.hm-choice__end { display: grid; place-items: center; flex: none; width: 24px; color: var(--faint); }

/* ---------- 320 wide phones ---------- */
@media (max-width: 359px) {
  .hm-body { --hm-gut: 14px; }
  .hm-hello__name { font-size: 25px; }
  .hm-tile { padding: 12px; }
  .hm-tile__label { font-size: 14.5px; }
  .hm-meet__go { display: none; }
  .hm-livenow { gap: 10px; padding: 12px; }
  .hm-livenow__ico { display: none; }
  .hm-livenow__name { font-size: 16.5px; }
  .hm-livenow__go { padding: 8px 12px; }
}

/* A lone last tile on a two column phone grid runs the full width. */
@media (max-width: 699px) {
  .hm-tiles--odd .hm-tile:last-child { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; min-height: 68px; }
  .hm-tiles--odd.hm-tiles--full .hm-tile:last-child { min-height: 76px; }
}

/* ---------- Tablet ---------- */
@media (min-width: 700px) {
  .hm-body { --hm-gut: 24px; }
  .hm-tiles { grid-template-columns: repeat(var(--nm, 4), minmax(0, 1fr)); gap: 12px; }
  /* Columns, not a grid: a short group tucks under another instead of leaving a hole. */
  .hm-groups { display: block; columns: 2; column-gap: 20px; }
  .hm-group { break-inside: avoid; margin-bottom: 22px; }
  .hm-group:last-child { margin-bottom: 0; }
  .hm-ov--sheet { align-items: center; padding: 24px; }
  .hm-sheet { max-width: 420px; padding-bottom: 16px; border-bottom: 1px solid var(--line-2); border-radius: 20px; }
  .hm-sheet__grab { display: none; }
  .hm-sheet__grab + * { margin-top: 8px; }
}

/* ---------- Desktop: no bottom bar, Find and Menu move to the top ---------- */
@media (min-width: 900px) {
  .hm-top {
    position: sticky; top: 0; z-index: 30; padding: 0 24px;
    background: rgba(12, 13, 17, .86); border-bottom: 1px solid var(--line);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  }
  .hm-top__in { height: 60px; max-width: 1120px; margin: 0 auto; }
  .hm-top__brand { font-size: 15px; }
  .hm-top__find {
    display: flex; align-items: center; gap: 10px; width: 300px; height: 44px; padding: 0 10px 0 12px;
    border: 1px solid var(--line-2); border-radius: 11px; background: var(--surface);
    color: var(--muted); font: 500 14px var(--font); text-align: left; cursor: pointer;
  }
  .hm-top__find[hidden] { display: none; }
  .hm-top__find:hover { border-color: var(--faint); color: var(--ink); }
  .hm-top__find kbd {
    margin-left: auto; padding: 2px 7px; border: 1px solid var(--line-2); border-radius: 6px;
    background: var(--surface-2); color: var(--muted); font: 600 11.5px var(--font);
  }
  .hm-top__menu {
    display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px 0 12px;
    border: 1px solid var(--line-2); border-radius: 11px; background: var(--surface-2);
    color: var(--ink); font: 600 14.5px var(--font); cursor: pointer;
  }
  .hm-top__menu[hidden] { display: none; }
  .hm-top__menu:hover { background: var(--surface-3); }
  .hm-top__me:hover .hm-avatar { border-color: var(--faint); }
  .hm-page { padding-top: 8px; padding-bottom: 56px; }
  .hm-hello { margin: 30px 0 26px; }
  .hm-livenow { margin: 24px 0 -4px; padding: 16px 18px; }
  .hm-hello__date { font-size: 14px; }
  .hm-hello__name { font-size: 33px; }
  .hm-sec { margin-top: 32px; }
  .hm-sec__title { font-size: 17px; }
  .hm-tiles { grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 14px; }
  .hm-tile { min-height: 116px; padding: 15px 16px; }
  .hm-tile__label { font-size: 15.5px; }
  .hm-tile:hover, .hm-choice:hover { border-color: var(--tone-fg, var(--line-2)); }
  .hm-mid { display: flex; align-items: flex-end; gap: 32px; }
  .hm-mid > * { flex: 1 1 0; min-width: 0; }
  .hm-mid > :only-child { flex: 0 1 544px; }
  .hm-groups { columns: 3; column-gap: 24px; }
  .hm-row:hover, .hm-meet:hover { background: var(--surface-2); }
  .hm-meet.is-live:hover { background: linear-gradient(135deg, var(--hm-live-2) 0%, #a81c30 100%); }
  .hm-txtbtn:hover, .hm-iconbtn:hover { background: var(--surface-2); }
  .hm-bar { display: none; }
  .hm-has-bar .toast { bottom: 1.25rem; }
  .hm-has-bar .install-hint, .hm-has-bar .update-bar { bottom: calc(.75rem + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .hm-body *, .hm-body *::before, .hm-body *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* No pages at all: a plain Sign out on the right instead of the Menu buttons. */
.hm-top__signout { margin-left: auto; }
