/*
 * home.css — Harizma Home / Welcome screen
 *
 * Responsive targets
 *   Desktop      > 1024px   full layout, 5-col agent grid
 *   Laptop       768-1024px centred, 4-col agent grid
 *   Tablet       641-767px  3-col agent grid, smaller type
 *   Mobile       ≤ 640px    2-col agent grid, safe-area aware
 *
 * Design tokens (match app.css → design-system/tokens.css)
 *   bg page  --void  #060610   card --raised #101024   border rgba(255,255,255,.055)
 *   text-1   --t1    #EDEDF8   text-2 --t2  #6E6E90   text-3 --t3 #363658
 *   accent   --accent = --hz-brand = --hz-blue-500 #4A8DFF (blue, both themes)
 *   tiny/meta text  --hz-text-meta (AA)   focus ring  outline var(--accent)
 *   Brand accents MUST use --accent / --hz-brand-* — never raw colour literals.
 */

/* ── TOKEN: gold used by the partner bonus card ─────────────
   Light theme needs a much darker amber: #F8B74A on white is ~1.9:1
   contrast — illegible at 11px caps. #946200 clears 4.5:1 (WCAG AA). */
#cmHome { --gold: var(--group, #F8B74A); }
[data-theme="light"] #cmHome { --gold: #946200; }

/* ── PANEL ────────────────────────────────────────────────── */

#cmHome {
  display: none;
  position: absolute; inset: 0;
  z-index: 18;
  flex-direction: column;
  background: var(--void);
  font-family: 'Plus Jakarta Sans', 'IBM Plex Sans Arabic', 'IBM Plex Sans Devanagari', 'Noto Sans Armenian', system-ui, sans-serif;
  color: var(--t1);
  /* iOS overscroll colour match */
  -webkit-overflow-scrolling: touch;
}
#cmHome.show { display: flex; }

/* Reserve the cookie-consent banner's strip on the PANEL, so .cmh-scroll
   (flex: 1) simply gets a shorter viewport and the tail of the home screen —
   the last shelf and the legal row — can still be scrolled into view.
   Deliberately NOT on .cmh-scroll's own padding: that padding is redeclared at
   three breakpoints, so the term was silently dropped on exactly the narrow
   screens that need it most. --hz-consent-h is published by
   public/js/cookie-consent.js; the 0px fallback is the exact previous layout.

   ≥641px ONLY. Below that the panel is a .hz-phone-panel (app.css) and pads
   --hz-nav-clear, which already INCLUDES the consent strip — and an id
   selector here would out-specify that shared class whatever the source
   order, silently dropping the tab-bar clearance and running the home list
   under the bar. (It did: verify-phone-panels.js caught exactly that.) */
@media (min-width: 641px) {
  #cmHome { padding-bottom: var(--hz-consent-h, 0px); }
}
[data-theme="light"] #cmHome { background: #FFFFFF; }


/* ── SCROLL BODY ─────────────────────────────────────────── */

.cmh-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  padding: max(12px, env(safe-area-inset-top, 0px)) 40px max(48px, calc(env(safe-area-inset-bottom, 0px) + 24px));
  box-sizing: border-box;
}
.cmh-scroll::-webkit-scrollbar { display: none; }


/* ── CONTENT COLUMN ──────────────────────────────────────── */

.cmh-inner {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;   /* centers inline-flex children (eyebrow pill) */
}


/* ── 0. TOP ROW — brand + login (guests only) ────────────── */

.cmh-toprow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  margin-bottom: 12px;
  flex-shrink: 0;
}
/* The HTML `hidden` attribute loses to .cmh-toprow { display:flex } above
   because the UA rule has lower specificity. Be explicit. */
.cmh-toprow[hidden] { display: none; }

/* Gap element: reserves breathing room when toprow is hidden  */
.cmh-toprow-gap { height: 4px; width: 100%; flex-shrink: 0; }
#cmhToprow:not([hidden]) + .cmh-toprow-gap { height: 4px; }

.cmh-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--t1);
  user-select: none;
}
/* Desktop: brand lives in tnav; login button moves to #tnavLoginBtn in tnav.
   Hide the entire toprow — nothing inside it is needed at this breakpoint. */
@media (min-width: 641px) {
  #cmhToprow { display: none; }
}
.cmh-brand-mark {
  width: 28px; height: 28px; border-radius: var(--hz-radius-8); flex-shrink: 0;
  overflow: hidden;
}
.cmh-brand-mark img { width: 28px; height: 28px; display: block; object-fit: cover; }
.cmh-brand-name { display: inline-block; height: 15px; color: var(--t1); }

.cmh-login-btn {
  flex-shrink: 0; min-height: 36px; padding: 7px 18px;
  background: var(--raised); border: 1.5px solid var(--border-mid); border-radius: var(--hz-radius-pill);
  font-family: inherit; font-size: 14px; font-weight: 600; color: var(--t1);
  cursor: pointer;
  transition: background .14s, border-color .14s, transform .12s;
  -webkit-tap-highlight-color: transparent;
}
.cmh-login-btn:hover  { background: var(--hover); border-color: var(--hz-brand-border); }
.cmh-login-btn:active { transform: scale(.97); }
[data-theme="light"] .cmh-login-btn { border-color: rgba(0,0,0,.12); }


/* ── A. EYEBROW ───────────────────────────────────────────── */

.cmh-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-block: 5px; padding-inline: 10px 14px;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--hz-radius-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--t2);
  margin-bottom: 28px;
}
.cmh-eyebrow-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}


/* ── B. PERSONALIZED GREETING ────────────────────────────── */

.cmh-greeting {
  width: 100%;
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 500;
  color: var(--t2);
  text-align: center;
  letter-spacing: 0.01em;
}
.cmh-greeting[hidden] { display: none; }


/* ── C. HEADLINE ─────────────────────────────────────────── */

.cmh-headline {
  width: 100%;
  margin: 0 0 18px;
  font-family: var(--hz-font-display);
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--t1);
  text-align: center;
}


/* ── C. SUBTITLE ─────────────────────────────────────────── */

.cmh-lede {
  max-width: 480px;
  margin: 0 0 44px;
  font-size: 15px;
  font-weight: 400;
  color: var(--t2);
  line-height: 1.65;
  text-align: center;
}
.cmh-lede-br { display: block; }


/* ── D. BENEFITS ROW ─────────────────────────────────────── */

.cmh-benefits {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  margin-bottom: 44px;
}

.cmh-benefit {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--hz-radius-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--t1);
  white-space: nowrap;
  transition: border-color .14s, background .14s;
  cursor: default;
}
.cmh-benefit svg { flex-shrink: 0; }


/* ── E. COMPOSER ─────────────────────────────────────────── */

.cmh-composer {
  position: relative;
  width: 100%;
  margin-bottom: 18px;
  padding: 10px 16px 0 16px;
  background: var(--hz-composer-bg);
  border: var(--hz-composer-border-width) solid var(--hz-composer-border);
  border-radius: var(--hz-composer-radius);
  box-shadow:
    0 1px 3px  rgba(0,0,10,.08),
    0 4px 16px rgba(0,0,10,.10),
    0 20px 48px rgba(0,0,10,.08);
  box-sizing: border-box;
  text-align: start;
  transition: border-color .2s, box-shadow .2s;
}
.cmh-composer:focus-within {
  border-color: var(--hz-composer-focus-border);
  box-shadow:
    0 1px 3px  rgba(0,0,10,.08),
    0 4px 16px rgba(0,0,10,.12),
    0 20px 48px rgba(0,0,10,.10),
    var(--hz-composer-focus-ring);
}


/* Text input — spacious, readable, inviting */
#cmhInput {
  display: block;
  width: 100%;
  min-height: 36px;
  max-height: 240px;  /* JS cap matches — safety net only */
  padding: 0;
  background: transparent;
  border: none;
  outline: none;
  -webkit-appearance: none;  /* suppress iOS Safari native border/shadow */
  appearance: none;
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  color: var(--t1);
  line-height: 1.65;
  box-sizing: border-box;
  resize: none;
  overflow-y: hidden;  /* JS sets 'auto' only when content reaches the cap */
  overflow-wrap: break-word;
  word-break: break-word;
}
#cmhInput::placeholder {
  color: var(--hz-input-placeholder);
}

/* ── Hint overlay — wraps input for cross-browser opacity transitions ────── */
/* ::placeholder transitions are unsupported in all major browsers; the      */
/* overlay div is the only reliable way to animate hint text smoothly.       */

.cmh-input-wrap {
  position: relative;
}

.cmh-hint-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 0;            /* matches #cmhInput padding: 0 */
  font-family: inherit;
  font-size: 16px;       /* matches #cmhInput */
  font-weight: 400;
  line-height: 1.65;     /* matches #cmhInput */
  color: var(--hz-input-placeholder);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  opacity: 1;
  transition: opacity 500ms ease-in-out;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cmh-hint-overlay.hint-fade { opacity: 0; }
.cmh-hint-overlay[hidden]   { display: none; }
/* The global reduced-motion rule collapses every transition to 0.001ms.
   This hint uses opacity only (no spatial motion), so keep a short fade to
   prevent the text swap itself from flashing. */
@media (prefers-reduced-motion: reduce) {
  .cmh-hint-overlay { transition-duration: 500ms !important; }
}

/* Send button — lives in .cmh-toolbar, right side */
/* Send button: visuals come from the shared .hz-composer-send atom (app.css).
   Home adds only layout (push to the right) + the idle state, mapping its
   existing .active mechanism onto the shared idle tokens: filled brand-blue when
   there's content (.active), neutral when empty. */
.cmh-send { margin-inline-start: auto; }
.cmh-send:not(.active) {
  background: var(--hz-composer-send-idle-bg);
  color: var(--hz-composer-send-idle-fg);
  box-shadow: none;
}
.cmh-send:not(.active):hover { transform: none; box-shadow: none; }
/* Dimmed while an upload is in flight, but the button stays LIVE — the send
   path itself awaits upload settlement (image-addon _settleUploads), so a tap
   during upload means "send now, delivers when ready". Mirrors
   #sendBtn.img-uploading in image-addon.js: pointer-events:none here used to
   dead-tap the button while Enter sailed past the CSS. */
.cmh-send.img-uploading { opacity: 0.55; transition: opacity .2s; }


/* ── SENDING STATE ───────────────────────────────────────── */
/*
 * Applied to #cmhComposer while _csCreateConversation() is in flight.
 * Gives instant visual feedback so the user knows their message was received
 * and the app is working (POST /api/conversations + agent-profile fetch).
 *
 * Three visual signals:
 *   1. Composer border pulses with the accent colour.
 *   2. Send button shows a conic-gradient spinner (same style as cl-sp-arc).
 *   3. Textarea dims and becomes read-only; media buttons are disabled.
 */

.cmh-composer.cmh-sending {
  border-color: var(--hz-brand-border);
  animation: cmhSendingPulse 1.8s ease-in-out infinite;
  pointer-events: none; /* block re-submission at the container level */
}

@keyframes cmhSendingPulse {
  0%, 100% {
    box-shadow:
      0 1px 3px  rgba(0,0,10,.08),
      0 4px 16px rgba(0,0,10,.10),
      0 20px 48px rgba(0,0,10,.08),
      0 0 0 3px var(--hz-brand-soft);
  }
  50% {
    box-shadow:
      0 1px 3px  rgba(0,0,10,.08),
      0 4px 16px rgba(0,0,10,.12),
      0 20px 48px rgba(0,0,10,.10),
      0 0 0 3px var(--hz-brand-glow);
  }
}

/* Dim the textarea to signal it is read-only */
.cmh-composer.cmh-sending #cmhInput {
  opacity: 0.45;
  cursor: default;
}

/* Dim the attach + mic buttons */
.cmh-composer.cmh-sending #cmhAttachBtn,
.cmh-composer.cmh-sending #cmhMicBtn {
  opacity: 0.30;
}

/* Send button: swap arrow for a conic-gradient spinner ring */
.cmh-composer.cmh-sending .cmh-send {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px var(--accent-glow);
  pointer-events: none;
}
.cmh-composer.cmh-sending .cmh-send svg { display: none; }
.cmh-composer.cmh-sending .cmh-send::after {
  content: '';
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  background: conic-gradient(
    from 0deg,
    transparent              0deg,
    rgba(255,255,255,.28)   40deg,
    #fff                   200deg,
    transparent            280deg
  );
  -webkit-mask: radial-gradient(
    farthest-side,
    transparent calc(100% - 2.5px),
    #fff        calc(100% - 2.5px)
  );
  mask: radial-gradient(
    farthest-side,
    transparent calc(100% - 2.5px),
    #fff        calc(100% - 2.5px)
  );
  animation: cmhSendSpin .72s linear infinite;
  will-change: transform;
}

@keyframes cmhSendSpin {
  to { transform: rotate(360deg); }
}

/* No light-theme patch needed — the sending accent uses theme-aware
   --hz-brand-* / --accent tokens (blue in both themes). */

/* Reduced motion: replace spin with an opacity pulse */
@media (prefers-reduced-motion: reduce) {
  .cmh-composer.cmh-sending             { animation: none; }
  .cmh-composer.cmh-sending .cmh-send::after { animation: cmhSendBreathe 1.4s ease-in-out infinite; }
}
@keyframes cmhSendBreathe {
  0%, 100% { opacity: .45; }
  50%      { opacity: 1;   }
}


/* ── COMPOSER TOOLBAR (attach + send row) ────────────────── */

.cmh-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  padding: 2px 0 8px;
}

/* Single "+" attach button — opens the Photos/Camera/File/Note menu.
   44px tap target (HIG/Material minimum); subtle filled circle so it reads
   as a control without competing with the send button. */
/* "+" attach trigger: fully styled by the shared .hz-composer-btn atom
   (app.css) — size, colour, hover, :focus-visible, [aria-expanded] and
   .has-attachments all live there now. No home-specific rule needed. */

/* The "+" menu itself is the SHARED attach-menu component (.hz-attach-*,
   styles injected by attach-menu.js). The home "+" opens it via
   HzAttach.openAt() — no home-owned menu CSS, so both composers stay identical. */

/* ── HOME ATTACHMENT TRAY ─────────────────────────────────────
   One horizontal, wrapping row for everything staged before a chat exists —
   photos (image-addon), documents (doc-addon) and the memory note
   (memory-note-addon) — mirroring the chat composer's #attachTray. Each source
   renders into its own display:contents group (kept by id below), so all their
   chips/tiles share ONE row instead of stacking. The chips reuse the shared
   .hz-att markup + CSS (attach-tray.js), so home and chat look identical. */
.cmh-attach-tray {
  display: none;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
  margin-bottom: 8px;
}
/* Shown only while it holds a tile — a MutationObserver in home.js toggles
   .has-items (works on every WebView; the CSS :has() selector does not). */
.cmh-attach-tray.has-items {
  display: flex;
  animation: _stripIn .22s cubic-bezier(.34,1.4,.64,1) both;
}
/* Groups are transparent wrappers: their chips lay out directly in the tray
   row, exactly like the chat tray's .hz-att-group. */
#cmhImgStrip, #cmhDocStrip, #cmhNoteStrip { display: contents; }


/* ── WHO ANSWERS — the identity row IS the model switcher ─────
   The row that heads the composer names the agent the next message
   goes to — Harizma, the universal agent (our router), by default —
   and is a button: it opens the picker of Harizma and the chat models
   (composer-models.js, the "+" menu's engine in its radio form). A
   quiet chip: text-coloured, a chevron as the only affordance at rest,
   a soft fill on hover / open, the brand ring on keyboard focus. */

.cmh-agent-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
  margin-inline-start: -8px;         /* the pad below keeps the text where it was */
  max-width: 100%;
  min-height: 28px;
  padding: 2px 8px;
  border: 0;
  border-radius: var(--hz-radius-pill);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  transition: background .14s;
}
/* The tap target stays at the 44px floor on touch without a taller row:
   the hit area is widened invisibly (HIG/Material minimum). */
@media (pointer: coarse) {
  .cmh-agent-badge::after { content: ''; position: absolute; inset: -8px -4px; }
}
.cmh-agent-badge:hover,
.cmh-agent-badge[aria-expanded="true"] { background: var(--hz-composer-icon-hover-bg); }
.cmh-agent-badge:focus-visible { outline: 2px solid var(--hz-brand); outline-offset: 2px; }
.cmh-agent-badge-chev {
  flex-shrink: 0;
  color: var(--hz-text-meta, var(--t2));
  transition: transform .18s var(--ease);
}
.cmh-agent-badge[aria-expanded="true"] .cmh-agent-badge-chev { transform: rotate(180deg); }
.cmh-composer.cmh-sending .cmh-agent-badge { pointer-events: none; opacity: .6; }
.cmh-agent-badge-av {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: var(--hz-radius-avatar);
  overflow: hidden;   /* clip the real avatar image (<img.av-img>) to the circle */
  display: flex; align-items: center; justify-content: center;
  /* Fallback gradient — _homeSetAgentPill() paints the agent's own gradient. */
  background: linear-gradient(145deg, #1E3A8A 0%, var(--hz-blue-800) 60%, #0891B2 100%);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(26,79,181,.35);
}
.cmh-agent-badge-name {
  flex-shrink: 0;
  font-size: var(--hz-text-sm);   /* 13px */
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--t1);
}



/* ── THE COMPOSER DOCKED IN THE PHONE CHAT LIST ──────────────
   composer-host.js moves the one composer (#cmhComposer) into #sbComposer,
   the chat list panel's .hz-panel-foot (app.css: frosted, pinned above the
   floating tab bar, the list reserves its measured height). Here only what
   is the composer's own in that place: tighter paddings, no bottom margin
   (the foot's padding clears the bar), a lighter shadow on a frosted
   surface. Phone only — ≥641px Home stands beside the list and holds it. */

.cmh-composer-slot { width: 100%; }
.sb-composer { display: none; }
/* The phone rules live in the one ≤640px block below ("Composer docked in
   the chat list"). */

/* ── I. PARTNER BONUS CARD ───────────────────────────────── */

.cmh-partner {
  width: 100%;
  margin-bottom: 28px;
}
.cmh-partner[hidden] { display: none; }

.cmh-partner-card {
  position: relative;
  overflow: hidden;
  border: 1.5px solid rgba(248,183,74,.28);
  border-radius: var(--hz-radius-22);
  background:
    radial-gradient(110% 130% at 0% 0%, rgba(248,183,74,.13) 0%, transparent 52%),
    radial-gradient(110% 130% at 100% 100%, color-mix(in srgb, var(--hz-brand) 10%, transparent) 0%, transparent 52%),
    var(--raised);
  padding: 18px;
}
[data-theme="light"] .cmh-partner-card {
  background:
    radial-gradient(110% 130% at 0% 0%, rgba(248,183,74,.10) 0%, transparent 52%),
    radial-gradient(110% 130% at 100% 100%, color-mix(in srgb, var(--hz-brand) 8%, transparent) 0%, transparent 52%),
    #F8F8FC;
  border-color: rgba(248,183,74,.32);
}

.cmh-partner-head { display: flex; align-items: center; gap: 12px; }

.cmh-partner-logo {
  width: 44px; height: 44px; border-radius: var(--hz-radius-14); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; line-height: 1;
  box-shadow: 0 2px 10px rgba(0,0,0,.22);
}

.cmh-partner-txt { flex: 1; min-width: 0; text-align: start; }
.cmh-partner-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--gold, #F8B74A); margin-bottom: 3px;
}
.cmh-partner-title { font-size: 15px; font-weight: 700; line-height: 1.3; color: var(--t1); }
.cmh-partner-title strong { color: var(--gold, #F8B74A); font-weight: 800; }
.cmh-partner-sub { font-size: 13px; color: var(--t2); margin-top: 2px; line-height: 1.4; }

.cmh-partner-price { font-size: 13px; color: var(--t2); margin-top: 5px; line-height: 1.3; }
.cmh-partner-price strong {
  font-size: 16px; font-weight: 800; color: var(--t1);
}
.cmh-partner-price s {
  color: var(--t3); font-weight: 500; margin-inline-start: 2px;
  text-decoration-color: var(--t3);
}

.cmh-partner-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 48px; margin-top: 14px;
  background: var(--hz-action-gradient);
  border: none; border-radius: var(--hz-radius-14);
  font-family: inherit; font-size: 15px; font-weight: 700; color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 20px var(--accent-glow);
  transition: transform .12s, box-shadow .18s;
  -webkit-tap-highlight-color: transparent;
}
.cmh-partner-cta:hover  { box-shadow: 0 8px 26px var(--accent-glow); }
.cmh-partner-cta:active { transform: scale(.98); }
.cmh-partner-cta svg    { flex-shrink: 0; }

.cmh-partner-foot {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 10px;
  font-size: 12px; color: var(--hz-text-meta);   /* AA at 12px (not sub-AA --t2) */
}

.cmh-partner-dismiss {
  position: absolute; top: 6px; inset-inline-end: 6px;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: 50%;
  color: var(--t3); cursor: pointer;
  transition: background .14s, color .14s;
  -webkit-tap-highlight-color: transparent;
}
.cmh-partner-dismiss:hover { background: var(--hover); color: var(--t1); }


/* ── I.2 PARTNER BONUS CELEBRATION POPUP ─────────────────── */
/* Shown once, right after a successful partner claim. Star-burst hero,    */
/* credited Stars, then the −50% first-month Plus offer (when available).  */

.cmh-bonus-overlay {
  /* Above .moverlay (999) — the no-reload claim-modal path can still be
     closing when the celebration appears. */
  position: fixed; inset: 0; z-index: 1100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  /* Centered-modal scrim + elevation ride the shared elevation register
     (hz-overlay-scrim / hz-overlay-blur / hz-modal-shadow / hz-elevation-border),
     matching .moverlay/.modal — this adds the previously-missing light-theme lift. */
  background: var(--hz-overlay-scrim, rgba(0,0,0,.6));
  backdrop-filter: var(--hz-overlay-blur, blur(12px)); -webkit-backdrop-filter: var(--hz-overlay-blur, blur(12px));
  opacity: 0; pointer-events: none;
  transition: opacity .24s cubic-bezier(.32,1,.56,1);
}
.cmh-bonus-overlay.open { opacity: 1; pointer-events: all; }

.cmh-bonus-modal {
  position: relative;
  width: 100%; max-width: 380px;
  max-height: calc(100dvh - 40px); overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border: var(--hz-elevation-border, 1px solid var(--border-mid));
  border-radius: var(--hz-radius-24);
  padding: 30px 22px 18px;
  text-align: center;
  box-shadow: var(--hz-modal-shadow, 0 24px 80px rgba(0,0,0,.55), 0 4px 16px rgba(0,0,0,.25));
  transform: scale(.92) translateY(10px);
  transition: transform .28s cubic-bezier(.22,.9,.32,1.3);
}
.cmh-bonus-overlay.open .cmh-bonus-modal { transform: scale(1) translateY(0); }

.cmh-bonus-hero {
  position: relative;
  width: 120px; height: 120px;
  margin: 0 auto 6px;
  display: flex; align-items: center; justify-content: center;
}
.cmh-bonus-halo {
  position: absolute; inset: 14px; border-radius: 50%;
  background: radial-gradient(circle, rgba(248,183,74,.4) 0%, transparent 68%);
  animation: cmhBonusHalo 2.2s ease-in-out infinite;
}
.cmh-bonus-logo {
  position: relative;
  width: 64px; height: 64px; border-radius: var(--hz-radius-20);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; line-height: 1;
  box-shadow: 0 6px 24px rgba(0,0,0,.3);
  animation: cmhBonusPop .5s cubic-bezier(.22,.9,.32,1.4) both;
}
.cmh-bonus-spark {
  position: absolute; left: 50%; top: 50%;
  margin: -7px 0 0 -7px;
  font-style: normal; font-size: 14px; line-height: 1;
  color: var(--gold, #F8B74A);
  pointer-events: none;
  opacity: 0;
  animation: cmhBonusSpark .9s ease-out var(--bt, 0ms) both;
}
.cmh-bonus-stars {
  font-size: 34px; font-weight: 800; letter-spacing: -.5px;
  color: var(--gold, #F8B74A);
  animation: cmhBonusPop .5s .12s cubic-bezier(.22,.9,.32,1.4) both;
}
.cmh-bonus-welcome {
  font-size: 14px; font-weight: 600; color: var(--t1);
  margin-top: 3px;
  animation: cmhBonusPop .5s .2s cubic-bezier(.22,.9,.32,1.4) both;
}
.cmh-bonus-title {
  font-size: 18px; font-weight: 700; color: var(--t1);
  margin-top: 6px;
}
.cmh-bonus-sub {
  font-size: 14px; color: var(--t2); line-height: 1.5;
  margin: 8px auto 0; max-width: 300px;
}
.cmh-bonus-sub strong { color: var(--gold, #F8B74A); }

.cmh-bonus-offer {
  margin-top: 18px; padding: 16px 14px 14px;
  border: 1.5px solid color-mix(in srgb, var(--hz-brand) 32%, transparent);
  border-radius: var(--hz-radius-18);
  background: linear-gradient(145deg, color-mix(in srgb, var(--hz-brand) 12%, transparent) 0%, color-mix(in srgb, var(--hz-brand) 4%, transparent) 100%);
}
[data-theme="light"] .cmh-bonus-offer {
  background: linear-gradient(145deg, color-mix(in srgb, var(--hz-brand) 8%, transparent) 0%, color-mix(in srgb, var(--hz-brand) 2%, transparent) 100%);
  border-color: color-mix(in srgb, var(--hz-brand) 26%, transparent);
}
.cmh-bonus-offer-badge {
  display: inline-block; padding: 4px 12px; border-radius: var(--hz-radius-pill);
  background: rgba(248,183,74,.16); border: 1px solid rgba(248,183,74,.4);
  color: var(--gold, #F8B74A); font-size: 12px; font-weight: 800;
  letter-spacing: .03em; text-transform: uppercase;
}
.cmh-bonus-offer-title {
  font-size: 15px; font-weight: 700; color: var(--t1); margin-top: 10px;
}
.cmh-bonus-offer-price {
  font-size: 13px; color: var(--t2); margin: 4px 0 12px;
}
.cmh-bonus-offer-price strong { font-size: 16px; font-weight: 800; color: var(--t1); }
.cmh-bonus-offer-price s { color: var(--t3); margin: 0 2px; }
.cmh-bonus-offer .cmh-partner-cta { margin-top: 0; }

.cmh-bonus-later {
  display: block; width: 100%;
  margin-top: 12px; padding: 12px;
  background: none; border: none; border-radius: var(--hz-radius-12);
  font-family: inherit; font-size: 14px; font-weight: 600;
  color: var(--t2); cursor: pointer;
  transition: color .14s, background .14s;
  -webkit-tap-highlight-color: transparent;
}
.cmh-bonus-later:hover { color: var(--t1); background: var(--hover); }
/* "Already have an account? Sign in" under the welcome's button — a host that
   created the account by itself (Telegram) may have signed in someone who
   already has one (account-switch-addon.js). Secondary: quieter than the button. */
.cmh-bonus-link {
  display: block; width: 100%;
  margin-top: var(--hz-space-1); padding: var(--hz-space-2);
  background: none; border: none; border-radius: var(--hz-radius-12);
  font-family: inherit; font-size: var(--hz-text-sm); font-weight: var(--hz-weight-semibold);
  color: var(--hz-brand); cursor: pointer;
  transition: background .14s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.cmh-bonus-link:hover { background: var(--hz-brand-soft); }
.cmh-bonus-link:focus-visible { outline: var(--hz-focus-width) solid var(--hz-focus-ring); outline-offset: 0; }

@keyframes cmhBonusPop {
  from { opacity: 0; transform: scale(.5); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes cmhBonusHalo {
  0%, 100% { transform: scale(1);    opacity: .8; }
  50%      { transform: scale(1.18); opacity: 1; }
}
@keyframes cmhBonusSpark {
  0%   { opacity: 0; transform: rotate(var(--ba)) translateY(0) scale(.4); }
  18%  { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--ba)) translateY(calc(-1 * var(--bd))) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .cmh-bonus-overlay, .cmh-bonus-modal { transition: none !important; }
  .cmh-bonus-logo, .cmh-bonus-stars, .cmh-bonus-spark, .cmh-bonus-halo, .cmh-bonus-welcome { animation: none !important; }
  .cmh-bonus-spark { display: none; }
}


/* ── H. EXAMPLES FEED — "What you can make" ──────────────── */

.cmh-examples {
  width: 100%;
  margin-top: 16px;
  margin-bottom: 48px;
  text-align: start;
}

/* Header — filtering is driven by the composer quick-action chips */
.cmh-ex-hdr {
  margin-bottom: 20px;
}

.cmh-ex-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--t1);
  letter-spacing: -0.015em;
}

/* ── Masonry grid (CSS columns) ─────────────────────────── */
/* 3 cols on desktop, 2 on tablet/mobile (overridden below)  */

.cmh-ex-rail {
  columns: 3;
  column-gap: 10px;
}

/* ── Example card — full-bleed, variable aspect-ratio ─── */

.cmh-ex-card {
  display: block;              /* required for CSS columns break-inside */
  break-inside: avoid;
  width: 100%;
  aspect-ratio: 3/4;           /* default = medium */
  margin-bottom: 10px;
  border-radius: var(--hz-radius-18);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: transform .22s cubic-bezier(.34,1.4,.64,1), box-shadow .22s;
  -webkit-tap-highlight-color: transparent;
}

/* Size variants — drive visual rhythm in the masonry grid */
.cmh-ex-card[data-size="tall"]   { aspect-ratio: 3/5; }
.cmh-ex-card[data-size="medium"] { aspect-ratio: 3/4; }
.cmh-ex-card[data-size="short"]  { aspect-ratio: 1/1; }

/* Safari < 15 / iOS 14 don't support aspect-ratio — fall back to fixed heights
   so cards are visible (all children are position:absolute, need a real height) */
@supports not (aspect-ratio: 1) {
  .cmh-ex-card                    { height: 220px; }
  .cmh-ex-card[data-size="tall"]  { height: 260px; }
  .cmh-ex-card[data-size="short"] { height: 160px; }
}

.cmh-ex-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 36px rgba(0,0,0,.28);
}
.cmh-ex-card:active { transform: scale(.96); transition-duration: .08s; }

/* Full-bleed photo layer */
.cmh-ex-card-vis {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.cmh-ex-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s ease;
}
.cmh-ex-card:hover .cmh-ex-card-img { transform: scale(1.06); }

/* Bottom gradient + text overlay */
.cmh-ex-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,.90) 0%,
    rgba(0,0,0,.58) 38%,
    rgba(0,0,0,.12) 62%,
    transparent 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px 13px 16px;
}

/* Emoji badge — top-left (more natural reading flow) */
.cmh-ex-card-badge {
  position: absolute;
  top: 10px;
  inset-inline-start: 11px;
  font-size: 18px;
  line-height: 1;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,.5));
  user-select: none;
}

.cmh-ex-card-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  letter-spacing: -.02em;
  text-shadow: 0 1px 8px rgba(0,0,0,.6);
}

.cmh-ex-card-sub {
  font-size: 13px;
  color: rgba(255,255,255,.70);
  margin-top: 4px;
  line-height: 1.3;
  text-shadow: 0 1px 5px rgba(0,0,0,.45);
}



/* ── F. POPULAR AGENTS ───────────────────────────────────── */

.cmh-agents {
  width: 100%;
  margin-top: 16px;
  margin-bottom: 36px;
  text-align: start;
}

/* The header, the grid and the launcher tile itself are NOT here: they are the
   shared agent card (design-system/agent-card.css → .hz-agent-section /
   .hz-agent-grid / .hz-agent-card), which the Agents page renders too. This
   screen keeps only its own rhythm — the section's margins above and the
   reveal stagger below. */

[data-theme="light"] .cmh-composer {
  border-color: rgba(0,0,0,.07);
  box-shadow:
    0 1px 3px  rgba(0,0,0,.05),
    0 4px 16px rgba(0,0,0,.08),
    0 16px 40px rgba(0,0,0,.05);
}
/* Light theme: give the idle send button a soft brand tint (dark theme's
   neutral --hover reads as invisible on a white composer). The ACTIVE state
   needs no override — base .cmh-send.active already uses the theme-aware
   var(--accent) / var(--accent-glow), which are blue in both themes. */
[data-theme="light"] .cmh-send {
  background: var(--hz-brand-soft);
  color: var(--accent);
}
[data-theme="light"] .cmh-send:hover { background: var(--hz-brand-border); }


/* ── F2. CATEGORY SHELVES ─────────────────────────────────────
   Extra agent shelves under Popular agents — one per category id in
   config/welcome.js → HOME_SHELF_CATEGORY_IDS (today: Lifestyle), rendered by
   home.js::_homeRenderShelves().

   A shelf IS a `.hz-agent-section`: surface, header, grid, launcher tile,
   hover/press, both themes, the reveal stagger and EVERY breakpoint rule above
   apply unchanged — nothing here restates them. The only additions are the
   host's stacking context and the one muted subtitle line a shelf carries and
   Popular agents does not. */

.cmh-shelves {
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* ── ENTRANCE ANIMATIONS ─────────────────────────────────── */

@keyframes cmhUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

#cmHome.show .cmh-toprow   { animation: cmhUp .28s .02s both; }
#cmHome.show .cmh-eyebrow  { animation: cmhUp .28s .04s both; }
#cmHome.show .cmh-greeting { animation: cmhUp .28s .06s both; }
#cmHome.show .cmh-headline { animation: cmhUp .28s .08s both; }
#cmHome.show .cmh-lede     { animation: cmhUp .28s .12s both; }
#cmHome.show .cmh-benefits { animation: cmhUp .28s .15s both; }
#cmHome.show .cmh-composer      { animation: cmhUp .28s .18s both; }
#cmHome.show .cmh-partner       { animation: cmhUp .28s .21s both; }
#cmHome.show .cmh-agents   { animation: cmhUp .28s .25s both; }
/* Category shelves sit directly under Popular agents — nudge the shared
   .cmh-agents stagger a beat later so the reveal still cascades downward.
   Same specificity, declared after .cmh-agents, so this wins. */
#cmHome.show .cmh-shelf     { animation: cmhUp .28s .265s both; }
#cmHome.show .cmh-examples { animation: cmhUp .28s .30s both; }

/* Returning to Home (every reveal after the first — see openHome) shows the
   content settled: the cascade above is the first arrival's choreography, and
   replayed on each tab switch it held the agent avatars and shelves at
   opacity 0 for up to ~0.55s, which read as the pictures loading again. */
#cmHome.show.cmh-return .cmh-toprow, #cmHome.show.cmh-return .cmh-eyebrow,
#cmHome.show.cmh-return .cmh-greeting, #cmHome.show.cmh-return .cmh-headline,
#cmHome.show.cmh-return .cmh-lede,
#cmHome.show.cmh-return .cmh-benefits, #cmHome.show.cmh-return .cmh-composer,
#cmHome.show.cmh-return .cmh-partner, #cmHome.show.cmh-return .cmh-agents,
#cmHome.show.cmh-return .cmh-shelf,
#cmHome.show.cmh-return .cmh-examples { animation: none; }

/* Respect reduced-motion: show the home content immediately with no entrance
   translate/stagger and no attachment-tray slide-in (motion-sensitivity /
   vestibular safety). Content still appears — only the animation is dropped. */
@media (prefers-reduced-motion: reduce) {
  #cmHome.show .cmh-toprow, #cmHome.show .cmh-eyebrow, #cmHome.show .cmh-greeting,
  #cmHome.show .cmh-headline, #cmHome.show .cmh-lede,
  #cmHome.show .cmh-benefits, #cmHome.show .cmh-composer, #cmHome.show .cmh-partner,
  #cmHome.show .cmh-agents, #cmHome.show .cmh-shelf,
  #cmHome.show .cmh-examples { animation: none; }
  .cmh-attach-tray.has-items { animation: none; }
}


/* ═══════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   All grid and spacing changes in one place — no duplicates.
   ══════════════════════════════════════════════════════════ */

/* ── Laptop / large tablet (768 – 1024px) ─────────────────── */
@media (max-width: 1024px) {
  .cmh-scroll     { padding: max(12px, env(safe-area-inset-top, 0px)) 28px max(48px, calc(env(safe-area-inset-bottom, 0px) + 20px)); }
  /* The agent grid's column count is auto (the shared component's own rule) —
     no override here. */
}

/* ── Tablet portrait (641 – 767px) ───────────────────────── */
@media (max-width: 767px) {
  .cmh-scroll     { padding: max(12px, env(safe-area-inset-top, 0px)) 24px max(36px, calc(env(safe-area-inset-bottom, 0px) + 16px)); }
  .cmh-greeting   { font-size: 15px; }
  .cmh-headline   { font-size: clamp(26px, 4.5vw, 38px); }
  .cmh-lede       { font-size: 14px; margin-bottom: 32px; }
  .cmh-composer   { padding: 10px 16px 0 16px; border-radius: var(--hz-radius-22); }
  /* Masonry: 2 cols on tablet, desktop gets 3 */
  .cmh-ex-rail { columns: 2; }
}

/* ── Mobile (≤ 640px) ────────────────────────────────────── */
@media (max-width: 640px) {
  /* `#cmHome { bottom: var(--hz-nav-clear); padding-bottom: 0 }` — REMOVED.
     The panel now carries `.hz-phone-panel` (app.css): it fills the viewport
     and clears the floating tab bar with padding, so it PAINTS the strip the
     bar sits in instead of letting the body backdrop show through it. That
     shared padding also supersedes this panel's base `--hz-consent-h` padding,
     because --hz-nav-clear already includes the consent strip — which is what
     the `padding-bottom: 0` here was for. */

  .cmh-scroll {
    padding: max(12px, env(safe-area-inset-top, 0px)) 20px max(36px, calc(env(safe-area-inset-bottom, 0px) + 24px));
  }

  .cmh-inner {
    align-items: center;
    text-align: center;
  }

  .cmh-composer,
  .cmh-agents { text-align: start; }

  /* ── Hide desktop-only elements ── */
  .cmh-eyebrow  { display: none; }
  .cmh-benefits { display: none; }

  /* ── Greeting ── */
  .cmh-greeting { font-size: 14px; margin-bottom: 4px; }

  /* ── Hero ── */
  .cmh-headline {
    font-size: clamp(26px, 7.5vw, 34px);
    letter-spacing: -0.025em;
    line-height: 1.1;
    margin-bottom: 18px;
    text-align: center;
  }

  /* Subtitle hidden — removed from this screen */
  .cmh-lede { display: none; }

  /* ── Composer ── */
  .cmh-composer {
    padding: 10px 14px 0 14px;
    border-radius: var(--hz-radius-22);
    margin-bottom: 20px;
  }
#cmhInput        { font-size: 16px; min-height: 36px; max-height: 180px; line-height: 1.6; }
  .cmh-hint-overlay { line-height: 1.6; }
  .cmh-toolbar    { padding: 2px 0 6px; }
  .cmh-send       { width: 44px; height: 44px; }
  .cmh-agent-badge { margin-bottom: 2px; }

  /* ── Composer docked in the chat list (composer-host.js → #sbComposer) ──
     A signed-in phone starts every new chat here; this is the Android Chats
     dock, the same shape on the web and in the Telegram Mini App
     (docs/composer.md §1a; feature/chats DockedComposer, core/ui HzDockComposer):

       • NO BAND. The foot paints nothing: the composer floats over the list as
         GLASS — the tab bar's recipe (--hz-tabbar-glass / -rim / -sheen /
         -shadow, a 16px blur), so the two read as one floating layer — with
         the mark's four inks over it: a wash on the surface and a hairline rim
         that brightens while the field has focus. The wash STANDS STILL at
         rest and drifts only while a chat is starting (.cmh-sending): motion
         means Harizma is working, never idling.
       • ONE LINE at rest: who answers as a NAMED CHIP (the switcher — its face,
         its name, a chevron: a model is a thing you read, not guess), the
         field, "+", and the mic — which becomes the send button once there is
         something to send (.cmh-has-text, home.js; the two share one cell).
         No idle send button as the loudest shape.
       • TWO ROWS while writing (.hz-dock-open, composer-host.js dockOpen: the
         keyboard up under a focused field, a tray, a line break): the tray and
         the field over a tool row — the switcher row, "+", the mic, send.
       • A plain model answers (.cmh-plain): the tab bar's quiet rim, the
         brand's while focused — the spectrum belongs to Harizma.
       • CLEAR OF THE KEYBOARD by --hz-space-2 — the gap the tab bar keeps from
         content: --hz-nav-clear falls to 0 under html.kb-open (app.css).

     The spectrum strengths are Android's (HzDockComposer): wash .08 dark / .05
     light at rest, .16 / .09 while working; rim .60 / .42, focused .95 / .75. */
  .sb-composer { display: block; }
  .sb-composer[hidden],
  .sb-composer.hzs-hidden { display: none; }
  .hz-phone-panel .sb-composer.hz-panel-foot {
    padding: var(--hz-space-2) 12px max(var(--hz-nav-clear), var(--hz-space-2));
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    --hz-dock-wash: .08;
    --hz-dock-wash-working: .16;
    --hz-dock-rim: .6;
    --hz-dock-rim-focus: .95;
  }
  [data-theme="light"] .hz-phone-panel .sb-composer.hz-panel-foot {
    --hz-dock-wash: .05;
    --hz-dock-wash-working: .09;
    --hz-dock-rim: .42;
    --hz-dock-rim-focus: .75;
  }

  .hz-phone-panel .sb-composer .cmh-composer {
    display: grid;
    /* ONE LINE: who · the field · "+" · the mic or send (one cell, `act`). The
       chip's track takes what its name needs, at most two fifths of the screen
       (the chip's own max-width below — a viewport length, so it counts in the
       track's intrinsic size; a percentage would not): the hint keeps the rest. */
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "who field add act";
    align-items: end;
    margin-bottom: 0;
    padding: 4px;
    border-radius: var(--hz-radius-pill);
    overflow: hidden;            /* the spectrum wash is wider than the box */
    isolation: isolate;          /* keeps the wash under the content */
    background-color: var(--hz-tabbar-glass);
    background-image: var(--hz-tabbar-sheen);
    border: .5px solid var(--hz-tabbar-rim);
    box-shadow: var(--hz-tabbar-shadow);
    backdrop-filter: blur(16px) saturate(1.8);
    -webkit-backdrop-filter: blur(16px) saturate(1.8);
    /* The corner eases between the pill and the card as the box opens (the field's own
       height animates in composer.js autosize); the glass itself is never animated. */
    transition: border-radius .24s var(--ease);
  }
  /* TWO ROWS: the tray and the field over the tool row. The corner is the card's. */
  .hz-phone-panel .sb-composer .cmh-composer.hz-dock-open {
    grid-template-columns: auto auto minmax(0, 1fr) auto auto;
    grid-template-areas:
      "tray  tray  tray  tray tray"
      "field field field field field"
      "who   add   .     mic  act";
    align-items: center;
    border-radius: var(--hz-composer-radius);
  }
  .hz-phone-panel .sb-composer .cmh-composer:focus-within {
    border-color: var(--hz-tabbar-rim);
    box-shadow: var(--hz-tabbar-shadow);
  }
  /* The wash: the four inks as one mirrored band, three boxes wide. At rest it
     stands at the frame Android rests on (t = .35 of the cycle); while a chat
     is starting it slides one period (half its width) per cycle — seamless — on
     the compositor (transform only): the glass behind it is never repainted or
     re-blurred by the drift. */
  .hz-phone-panel .sb-composer .cmh-composer::before {
    content: '';
    position: absolute;
    z-index: -1;
    top: 0; bottom: 0; left: 0;
    width: 300%;
    background: linear-gradient(90deg,
      var(--hz-spectrum-1) 0%, var(--hz-spectrum-2) 8.333%, var(--hz-spectrum-3) 16.667%, var(--hz-spectrum-4) 25%,
      var(--hz-spectrum-3) 33.333%, var(--hz-spectrum-2) 41.667%, var(--hz-spectrum-1) 50%,
      var(--hz-spectrum-2) 58.333%, var(--hz-spectrum-3) 66.667%, var(--hz-spectrum-4) 75%,
      var(--hz-spectrum-3) 83.333%, var(--hz-spectrum-2) 91.667%, var(--hz-spectrum-1) 100%);
    opacity: var(--hz-dock-wash);
    transform: translate3d(-17.5%, 0, 0);
    pointer-events: none;
    transition: opacity .4s var(--ease);
  }
  .hz-phone-panel .sb-composer .cmh-composer.cmh-sending::before {
    opacity: var(--hz-dock-wash-working);
    will-change: transform;
    animation: hzDockSpectrum 9s linear infinite;
  }
  /* The rim: a hairline of the same inks (a masked ring), its strength the
     focus signal — the composer's own focus ring, in the mark's colours. */
  .hz-phone-panel .sb-composer .cmh-composer::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    padding: 1px;
    border-radius: inherit;
    background: var(--hz-spectrum-gradient);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    opacity: var(--hz-dock-rim);
    pointer-events: none;
    transition: opacity .24s var(--ease);
  }
  .hz-phone-panel .sb-composer .cmh-composer:focus-within::after { opacity: var(--hz-dock-rim-focus); }
  /* A plain model answers: no wash, the tab bar's hairline, the brand's while focused. */
  .hz-phone-panel .sb-composer .cmh-composer.cmh-plain::before { display: none; }
  .hz-phone-panel .sb-composer .cmh-composer.cmh-plain::after { background: var(--hz-tabbar-rim); opacity: 1; }
  .hz-phone-panel .sb-composer .cmh-composer.cmh-plain:focus-within::after { background: var(--hz-composer-focus-border); }
  @keyframes hzDockSpectrum {
    from { transform: translate3d(-17.5%, 0, 0); }
    to   { transform: translate3d(-67.5%, 0, 0); }
  }
  /* The cells. The toolbar dissolves so its buttons take their own cells (the
     DOM is Home's, unchanged); the tray exists only in the open form. */
  .hz-phone-panel .sb-composer #cmhModelBtn    { grid-area: who; margin: 0; }
  .hz-phone-panel .sb-composer #cmhAttachTray  { grid-area: tray; margin-bottom: 6px; }
  /* The text's air: 8px from the chip and the "+" at rest, 12px inside the open card.
     The hint overlay takes the same inset (it is positioned from the wrap's padding
     box, so the wrap's padding alone would leave it a step left of the typed text). */
  .hz-phone-panel .sb-composer .cmh-input-wrap { grid-area: field; min-width: 0; align-self: stretch; display: flex; align-items: center; padding: 0 8px; }
  .hz-phone-panel .sb-composer .cmh-hint-overlay { inset-inline: 8px; }
  .hz-phone-panel .sb-composer .cmh-toolbar    { display: contents; }
  .hz-phone-panel .sb-composer #cmhAttachBtn   { grid-area: add; margin: 0; }
  .hz-phone-panel .sb-composer #cmhMicBtn      { grid-area: act; }
  .hz-phone-panel .sb-composer #cmhSend        { grid-area: act; margin: 0; }
  /* At rest: the switcher as a NAMED CHIP on the controls' line — the face, the
     name (cut with an ellipsis when long: the hint keeps its room), the chevron.
     A 44px target, its own soft fill so it reads as a control, not a label. */
  .hz-phone-panel .sb-composer .cmh-composer:not(.hz-dock-open) #cmhAttachTray { display: none; }
  .hz-phone-panel .sb-composer .cmh-composer:not(.hz-dock-open) #cmhModelBtn {
    min-height: var(--hz-composer-control-size-touch);
    max-width: 40vw;
    max-width: min(40vw, 160px);   /* Android's 150 dp ceiling: no giant chip on a wide phone */
    padding-block: 0; padding-inline: 5px 8px;
    gap: 6px;
    background: var(--hz-composer-icon-hover-bg);
  }
  .hz-phone-panel .sb-composer .cmh-composer:not(.hz-dock-open) .cmh-agent-badge-av { width: 26px; height: 26px; font-size: 13px; }
  .hz-phone-panel .sb-composer .cmh-composer:not(.hz-dock-open) .cmh-agent-badge-name { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* ONE SLOT for the mic and send (WhatsApp, Telegram, ChatGPT, Gemini): the mic
     while there is nothing to send, the send button as soon as there is. Both sit
     in the `act` cell; the one stepping aside fades and shrinks (150 ms, Android's
     morph) and leaves the hit test. With no mic on the page (no speech API) the
     send button simply stays. */
  .hz-phone-panel .sb-composer .cmh-composer:not(.hz-dock-open) #cmhMicBtn,
  .hz-phone-panel .sb-composer .cmh-composer:not(.hz-dock-open) #cmhMicBtn ~ #cmhSend {
    transition: opacity .15s var(--ease), transform .15s var(--ease), visibility 0s;
  }
  .hz-phone-panel .sb-composer .cmh-composer:not(.hz-dock-open).cmh-has-text #cmhMicBtn,
  .hz-phone-panel .sb-composer .cmh-composer:not(.hz-dock-open).cmh-sending #cmhMicBtn,
  .hz-phone-panel .sb-composer .cmh-composer:not(.hz-dock-open):not(.cmh-has-text):not(.cmh-sending) #cmhMicBtn ~ #cmhSend {
    opacity: 0; transform: scale(.6); visibility: hidden; pointer-events: none;
    transition: opacity .15s var(--ease), transform .15s var(--ease), visibility 0s .15s;
  }
  /* Open: the field runs the full width over the tool row; the switcher row's
     own 8px pull-back lands its face on the text's edge; the mic has its own cell. */
  .hz-phone-panel .sb-composer .cmh-composer.hz-dock-open .cmh-input-wrap { padding: 0 12px; }
  .hz-phone-panel .sb-composer .cmh-composer.hz-dock-open .cmh-hint-overlay { inset-inline: 12px; }
  .hz-phone-panel .sb-composer .cmh-composer.hz-dock-open #cmhModelBtn { justify-self: start; min-height: 40px; margin-inline-start: 4px; }
  .hz-phone-panel .sb-composer .cmh-composer.hz-dock-open #cmhMicBtn { grid-area: mic; }
  /* The field on the controls' line: one 44px row at reading size, centred;
     the hint overlay sits on the same line box. */
  .hz-phone-panel .sb-composer #cmhInput {
    min-height: var(--hz-composer-control-size, 44px);
    padding-block: calc((var(--hz-composer-control-size, 44px) - 1.6em) / 2);
    line-height: 1.6;
  }
  .hz-phone-panel .sb-composer .cmh-hint-overlay {
    top: 50%;
    transform: translateY(-50%);
    line-height: 1.6;
  }
  @media (prefers-reduced-motion: reduce) {
    /* Still throughout, at the resting frame; the swaps are instant. */
    .hz-phone-panel .sb-composer .cmh-composer.cmh-sending::before { animation: none; }
    .hz-phone-panel .sb-composer .cmh-composer { transition: none; }
    .hz-phone-panel .sb-composer .cmh-composer #cmhMicBtn,
    .hz-phone-panel .sb-composer .cmh-composer #cmhMicBtn ~ #cmhSend { transition: none; }
  }
  /* No blur (older WebViews) or the person asked for less transparency: the
     same opaque surface the tab bar falls back to; the spectrum stays. */
  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .hz-phone-panel .sb-composer .cmh-composer { background-color: var(--hz-tabbar-solid); }
  }
  @media (prefers-reduced-transparency: reduce) {
    .hz-phone-panel .sb-composer .cmh-composer {
      background-color: var(--hz-tabbar-solid);
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
    }
  }
  @media (forced-colors: active) {
    .hz-phone-panel .sb-composer .cmh-composer { border: 1px solid CanvasText; background: Canvas; }
    .hz-phone-panel .sb-composer .cmh-composer::before,
    .hz-phone-panel .sb-composer .cmh-composer::after { display: none; }
  }

  /* ── Popular agents ── */
  .cmh-agents       { margin-top: 0; margin-bottom: 36px; }

  /* The section head, the grid, the tile and the compact row are the shared
     component's (design-system/agent-card.css): its head tightens at this same
     width, and its row/tile switch is driven by SHELF width (@container), not
     by the viewport, so a narrow desktop column gets the same list a phone does. */

  /* ── Examples feed on mobile — 2-col vertical masonry ── */
  .cmh-ex-rail { columns: 2; column-gap: 8px; }
  .cmh-ex-card,
  .cmh-ex-card[data-size="tall"],
  .cmh-ex-card[data-size="medium"],
  .cmh-ex-card[data-size="short"] {
    width: 100%;
    margin-bottom: 8px;
    border-radius: var(--hz-radius-16);
    break-inside: avoid;
  }
  .cmh-ex-title      { font-size: 15px; }
  .cmh-ex-card-title { font-size: 14px; }
  .cmh-ex-card-sub   { font-size: 12px; }
  .cmh-ex-card-badge { font-size: 16px; top: 9px; inset-inline-start: 9px; }
  .cmh-ex-card-overlay { padding: 9px 10px 13px; }

  /* ── Examples section spacing ── */
  .cmh-examples  { margin-top: 0; margin-bottom: 40px; }
  .cmh-ex-hdr    { margin-bottom: 14px; }

}

#sbHomeAgents {
  flex-shrink: 0;
  padding: 4px 6px;
  border-bottom: 1px solid var(--border);
}
#sbHomeAgents[hidden] { display: none; }

.cmh-sa-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: var(--hz-radius-12);
  cursor: pointer;
  margin-bottom: 2px;
  transition: background .14s var(--ease, ease);
  -webkit-tap-highlight-color: transparent;
}
.cmh-sa-row:hover  { background: var(--hover); }
.cmh-sa-row:active { background: var(--active, var(--hover)); }

/* ============================================================================
 * Touch targets (Phase 3 · a11y) — the home-screen action buttons meet the
 * design-system 44px tap minimum (--hz-tap-min) on coarse-pointer (touch)
 * devices. Defined here (not app.css) because .cmh-login-btn ships its own
 * min-height:36px and home.css loads last, so this is where the bump wins.
 * Desktop (fine pointer) keeps the compact 36px.
 * ========================================================================== */
@media (pointer: coarse) {
  .cmh-login-btn { min-height: var(--hz-tap-min); }
}

/* ============================================================================
 * Home legal footer — Terms · Privacy · Cookie settings.
 *
 * Present because '/' serves the app shell to signed-out visitors now
 * (lib/entry-policy.js); the marketing footer that used to carry these links
 * is not on this document. Quiet by design: it closes the home scroll without
 * competing with the agent grid above it.
 *
 * Colour is --hz-text-meta, the AA-compliant tiny-text token — NOT the
 * decorative --t3 (see the note at .cmh-time above): this is real legal
 * navigation and has to stay readable in both themes.
 * ========================================================================== */
.cmh-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--hz-space-2);
  margin: var(--hz-space-8) 0 var(--hz-space-2);
  /* The DS "meta" type role (tiny status / legal chrome). Size + weight come
     from the role; line-height does NOT — the role's 1.0 leading is for
     single-line timestamps, and this row wraps to two lines on a narrow phone.
     Same split .ctime makes in app.css. */
  font-size:      var(--hz-role-meta-size);
  font-weight:    var(--hz-role-meta-weight);
  letter-spacing: var(--hz-role-meta-tracking);
  line-height: 1.4;
}

.cmh-legal-link {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--hz-text-meta);
  font: inherit;              /* escape the UA button font; inherit the meta role above */
  text-decoration: none;
  padding: var(--hz-space-1) var(--hz-space-2);
  border-radius: var(--hz-radius-8);
  cursor: pointer;
  transition: color var(--hz-dur-fast) var(--hz-ease);
  -webkit-tap-highlight-color: transparent;
}
/* Hover polish stays behind a real pointer — on touch a :hover rule sticks
   after the tap and leaves the link looking permanently active. Same gate the
   DS atoms use (enforced by tests/unit/design-system/atoms-interaction.test.js). */
@media (hover: hover) and (pointer: fine) {
  .cmh-legal-link:hover { color: var(--t1); }
}
.cmh-legal-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cmh-legal-sep { color: var(--hz-text-meta); user-select: none; }
@media (prefers-reduced-motion: reduce) { .cmh-legal-link { transition: none; } }

/* Touch: the legal links are the consent-withdrawal path, so they get the same
   44px floor as every other .cmh-* action control (see the block above). */
@media (pointer: coarse) {
  .cmh-legal-link { min-height: var(--hz-tap-min); display: inline-flex; align-items: center; }
}
