/* Maya Hub — the few compositions Swarm doesn't have (DESIGN.md § Hub-only).
   Swarm tokens ONLY: scripts/check_design_drift.py fails on a raw colour, a raw radius,
   blur, or a coloured side border in this file. Everything else comes from Swarm's
   tokens.css and app.css, vendored and pinned (design.pin). */

/* The two roots are toggled with [hidden]; Swarm's .app { display: grid } would otherwise win
   and draw the tenant shell under the apex cover (seen in the P1 screenshots, invisible to every check). */
#in[hidden], #apex[hidden], #gate[hidden] { display: none; }

/* ------------------------------------------------------------ the tenant seal (H011)
   Swarm's .rail__seal is gold fill. Here the screen's primary is the gold send, so the
   seal is gold-quiet: it names the company without spending the Seal Rule budget. */
.hub-seal.sw-sticker {
  background: var(--gold-quiet); color: var(--gold-ink);
  border-radius: var(--r-pill); padding: 2px 8px;
}
.rail__brand .hub-seal { transform: translateY(-1px); }
:root[data-rail="collapsed"] .rail__brand > span:not(.hub-seal) { display: none; }

/* Activity's Needs-you count: attention tone, not gold (a count is not a decision). */
.hub-badge {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--t-11); font-weight: 700;
  min-width: 18px; padding: 0 6px; line-height: 18px; text-align: center;
  border-radius: var(--r-pill); background: var(--attention-bg); color: var(--attention); flex: none;
}
.hub-badge:empty { display: none; }

/* ------------------------------------------------------------ the thread is the page
   Swarm's Maya is a 400px panel; here the conversation is the whole page. The parts are
   Swarm's (.sw-maya__log, __msg, __bubble, __suggest, __compose…); this only sizes them. */
.hub-chat {
  display: flex; flex-direction: column;
  min-height: calc(100vh - 56px - var(--s-4));
  min-height: calc(100dvh - 56px - var(--s-4));
}
.hub-chat .sw-maya__log {
  flex: 1 1 auto; overflow: visible; background: none;
  padding: 0 0 var(--s-2); justify-content: flex-end;
  width: 100%; max-width: 720px; margin: 0 auto;
}
.hub-chat .sw-maya__bubble { max-width: 70ch; }
.hub-chat .sw-maya__msg--me .sw-maya__bubble { max-width: min(70ch, 85%); }
.hub-dock {
  position: sticky; bottom: 0; z-index: 3;
  width: 100%; max-width: 720px; margin: 0 auto;
  background: var(--canvas);
  padding-bottom: max(var(--s-1), env(safe-area-inset-bottom));
}
.hub-dock .sw-maya__suggest { padding: 8px 0 2px; }
.hub-dock .sw-maya__compose {
  padding: 8px; border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--shadow-soft);
}
.hub-dock .sw-maya__input { background: var(--sunken); }

/* Log lines: a dot and a muted sentence, never a bubble. */
.hub-logline {
  display: flex; align-items: center; gap: 8px; margin: 0;
  font-size: var(--t-13); color: var(--muted);
}
.hub-logline::before {
  content: ""; flex: none; width: 6px; height: 6px; border-radius: var(--r-pill); background: var(--faint);
}

/* Day dividers: a mono label between hairlines. */
.hub-day {
  display: flex; align-items: center; gap: var(--s-1); margin: var(--s-1) 0;
  font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--t-11);
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint);
}
.hub-day::before, .hub-day::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--hairline); }

/* The first-run hello: Maya's avatar and what she can do, centred above the composer. */
.hub-hello { text-align: center; padding: var(--s-5) var(--s-2) var(--s-3); }
.hub-hello .sw-maya__avatar { width: 48px; height: 48px; margin: 0 auto var(--s-2); }
.hub-hello .sw-maya__avatar .sw-mark { width: 22px; height: 22px; }
.hub-hello h1 { font-size: var(--t-28); }
.hub-hello p { margin: var(--s-1) auto 0; max-width: 52ch; color: var(--muted); font-size: var(--t-14); line-height: 1.5; }

/* Placeholder pages (P0–P5): an honest empty state, Swarm's .sw-empty. */
.hub-page { max-width: 720px; margin: 0 auto; }
.hub-page h1 { font-size: var(--t-28); margin-bottom: var(--s-1); }
.hub-page .sw-empty { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-soft); }

/* ------------------------------------------------------------ the apex cover
   maya.littlebee.ai carries no tenant (H016): a name, a picker by typed company, legal links. */
.hub-cover { max-width: 520px; margin: 0 auto; padding: 12vh var(--s-2) var(--s-5); }
.hub-cover h1 { font-size: var(--t-40); }
.hub-cover p { color: var(--body); font-size: var(--t-16); line-height: 1.5; }
.hub-cover form { display: flex; gap: var(--s-1); margin-top: var(--s-3); flex-wrap: wrap; }
.hub-cover .sw-input { flex: 1 1 220px; }
.hub-cover__foot { margin-top: var(--s-5); font-size: var(--t-13); color: var(--muted); }
.hub-cover__foot a { color: var(--muted); }

/* The phone's top bar carries the name and seal (the rail is hidden at ≤760). */
.hub-bar-brand { display: none; align-items: baseline; gap: var(--s-1); font-weight: 800; font-size: var(--t-16); color: var(--text); }
@media (max-width: 760px) {
  .hub-bar-brand { display: inline-flex; }
  #where { display: none; }
}

/* ------------------------------------------------------------ sign-in and T&C (H018, H019) */
.hub-signin { display: flex; flex-direction: column; gap: var(--s-1); margin-top: var(--s-3); max-width: 360px; }
.hub-signin .sw-button { justify-content: center; min-height: 44px; text-decoration: none; }
.hub-cover .banner { margin-top: var(--s-2); }

.hub-cover.hub-tc { max-width: 760px; padding-top: var(--s-5); }
.hub-tc h1 { font-size: var(--t-32); margin-top: var(--s-0); }
.hub-tc__meta { display: flex; flex-wrap: wrap; gap: var(--s-0); margin: var(--s-1) 0 var(--s-3); }
.hub-tc__doc {
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-soft);
  padding: var(--s-3) var(--s-4); color: var(--body); font-size: var(--t-14); line-height: 1.6;
}
.hub-tc__doc > * { max-width: 70ch; }
.hub-tc__doc h2 { font-size: var(--t-24); margin: 0 0 var(--s-1); }
.hub-tc__doc h3 { font-size: var(--t-16); margin: var(--s-3) 0 var(--s-1); }
.hub-tc__doc p, .hub-tc__doc ul { margin: 0 0 var(--s-1); }
.hub-tc__doc hr { border: 0; height: 1px; background: var(--hairline); margin: var(--s-3) 0; }
.hub-tc__doc a { color: var(--gold-ink); }
.hub-tc__scroll { max-width: none; overflow-x: auto; margin: var(--s-1) 0 var(--s-2); }
.hub-tc__table { width: 100%; border-collapse: collapse; font-size: var(--t-13); }
.hub-tc__table th { text-align: left; color: var(--muted); font-weight: 700; font-size: var(--t-12); }
.hub-tc__table th, .hub-tc__table td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--hairline); vertical-align: top; }
.hub-tc__accept {
  position: sticky; bottom: 0; margin-top: var(--s-2); padding: var(--s-2);
  background: var(--canvas); border-top: 1px solid var(--hairline);
  display: flex; flex-direction: column; gap: var(--s-1);
}
.hub-tc__check { display: flex; gap: var(--s-1); align-items: flex-start; font-size: var(--t-14); color: var(--text); cursor: pointer; }
.hub-tc__check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--ink-blue); }
.hub-tc__acts { display: flex; gap: var(--s-1); flex-wrap: wrap; }
@media (max-width: 760px) {
  .hub-tc__doc { padding: var(--s-2); }
  .hub-tc__acts .sw-button { flex: 1 1 140px; }
}
@media (pointer: coarse) {
  .hub-tc__acts .sw-button { min-height: 44px; }
  .hub-tc__check { min-height: 44px; }
  .hub-tc__check input { width: 24px; height: 24px; }
}

/* ------------------------------------------------------------ phone
   ≤760: Swarm hides the rail and shows its tab bar. The Hub's bar is the four-tab
   (guest) variant — no gold centre button: on Chat the send ↑ is the primary (H011). */
@media (max-width: 760px) {
  .hub-chat { min-height: calc(100dvh - 56px - var(--s-4) - 72px - var(--tb-lift)); }
  .hub-dock { bottom: calc(72px + var(--tb-lift)); }
}
/* On Chat the composer must reach the bottom (P3 screenshots): a sticky dock can't pass the end of its container,
   so Swarm's page padding below the thread goes. The phone keeps exactly the tab bar's clearance. */
:root[data-screen="chat"] #app, :root[data-screen="chat"] .main { padding-bottom: 0; }
@media (max-width: 760px) {
  :root[data-screen="chat"] .main { padding-bottom: calc(72px + var(--tb-lift)); }
}
@media (pointer: coarse) {
  .hub-dock .sw-maya__send, .hub-dock .sw-maya__mic, .hub-dock .sw-maya__plus { min-width: 44px; height: 44px; }
  .hub-dock .sw-maya__input { min-height: 44px; }
  .hub-dock .sw-maya__chip { min-height: 44px; }
  .hub-cover__foot a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; justify-content: center; }
}

/* ------------------------------------------------------------ the thread (P3) */
/* Swarm's .sw-button and .sw-maya__cammenu set display, which would beat [hidden]. */
.hub-chat [hidden] { display: none !important; }
.hub-items { display: flex; flex-direction: column; gap: 12px; }
.hub-chat .sw-maya__said { align-items: flex-start; }
.hub-chat .sw-maya__bubble { white-space: pre-wrap; }
.hub-chat .sw-maya__msg--maya .sw-maya__bubble { max-width: 70ch; }
.hub-fold { display: flex; justify-content: center; }
.hub-fold:empty { display: none; }
.hub-earlier { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--t-12); color: var(--muted); }
.hub-chat .sw-maya__notice { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.hub-again { font-style: normal; font-size: var(--t-12); padding: 2px 8px; min-height: 28px; }
.hub-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.hub-dock .sw-maya__compose { position: relative; align-items: flex-end; }
.hub-plusmenu { left: 8px; right: auto; }
.hub-composenote { margin: 4px 4px 0; font-size: var(--t-12); color: var(--muted); }
.hub-composenote:empty { display: none; }
/* Stop takes Send's place while Maya answers: same footprint, not gold (the one gold thing is Send). */
.hub-stop { color: var(--text); }

@media (pointer: coarse) {
  .hub-dock .hub-stop { min-width: 44px; height: 44px; }
  .hub-earlier, .hub-again { min-height: 44px; }
  .hub-plusmenu button { min-height: 44px; }
}
