/* ALMA - Biz Gift Agent: the page around ALMA's own Mockups screen. Tokens, type and controls
   are the web app's (style.css, docs/DESIGN.md); this only lays out the header, the notes and
   the door. */
body.bg { background: var(--bg); color: var(--text-primary); margin: 0; min-height: 100dvh; }
.bg main { padding: var(--s4) var(--s5) calc(var(--s6) * 3 + env(safe-area-inset-bottom)); }
.bg-top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: calc(var(--s3) + env(safe-area-inset-top)) var(--s5) var(--s3);
  background: color-mix(in srgb, var(--bg) 88%, transparent); border-bottom: 1px solid var(--border-subtle);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
}
.bg-brand { display: flex; align-items: center; gap: var(--s3); color: inherit; text-decoration: none; min-height: 44px; }
.bg-face { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px var(--border-subtle); flex: none; }
.bg-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bg-face-lg { display: block; width: 88px; height: 88px; margin: 0 auto var(--s4); }
.bg-name { display: grid; line-height: 1.15; }
.bg-name b { font-size: var(--fs-body); font-weight: 600; letter-spacing: 0.01em; }
.bg-name span { font-size: var(--fs-caption); color: var(--text-secondary); }
.bg-actions { display: flex; gap: var(--s2); }
.bg-actions[hidden] { display: none; }
.bg-btn {
  display: inline-flex; align-items: center; gap: var(--s2); min-height: 40px; padding: 0 var(--s3);
  border-radius: var(--r-sm); border: 1px solid var(--border-subtle); background: var(--surface);
  color: var(--text-primary); font: inherit; font-size: var(--fs-secondary); font-weight: 500; text-decoration: none; cursor: pointer;
  transition: background var(--dur-fast) var(--ease), transform 100ms var(--ease);
}
.bg-btn:hover { background: var(--surface-hover); }
.bg-btn:active { transform: scale(0.98); }
.bg-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bg-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.bg-test { margin: 0; padding: var(--s2) var(--s5); font-size: var(--fs-caption); color: var(--text-secondary); background: var(--surface-sunken); border-bottom: 1px solid var(--border-subtle); text-align: center; }
.bg-test[hidden] { display: none; }
.bg-notes { display: grid; gap: var(--s2); max-width: var(--wide-w); margin: 0 auto; padding: 0 var(--s5); }
.bg-notes:empty { display: none; }
.bg-note { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); margin-top: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r-lg); background: var(--accent-soft); color: var(--text-primary); font-size: var(--fs-secondary); }
.bg-note p { margin: 0; }
.bg-note-body { display: grid; gap: var(--s2); }
.bg-note-body ol { margin: 0; padding-left: 1.25em; display: grid; gap: var(--s1); line-height: 1.45; }
.bg-note-body a { color: var(--accent); font-weight: 600; }
/* the welcome card: two lines, the rest under "How the pilot works" */
.bg-note-body details { display: grid; }
.bg-note-body summary { justify-self: start; min-height: 32px; display: inline-flex; align-items: center; cursor: pointer; color: var(--accent-text); font-weight: 600; }
.bg-note-body summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
.bg-note-body details[open] > * + * { margin-top: var(--s2); }
/* a header button's short name, shown under its icon on a phone */
.bg-short { display: none; }
/* the studio's pinned picture starts under this page's own top bar */
.bg .mk-ed { --mk-pin-top: calc(69px + env(safe-area-inset-top) + 8px); }
.bg-note .mk-link { white-space: nowrap; }
/* What's new (app.js drawNews): one card in the notes, the welcome card's look; each update under its day */
.bg-news ul { margin: 0; padding-left: 1.25em; display: grid; gap: var(--s1); line-height: 1.45; }
.bg-news ul.bg-news-one { list-style: none; padding-left: 0; }
.bg-news .bg-news-day { font-size: var(--fs-caption); color: var(--text-secondary); }
.bg-news ul + .bg-news-day { margin-top: var(--s1); }
/* "There's a new update": ALMA's own bar (style.css .update-bar), on a page with no tab bar under it. It sits
   above the studio's own bottom bar (Next, Save) when that is on screen, and under the studio's toast. */
.bg .update-bar { bottom: calc(var(--s4) + env(safe-area-inset-bottom)); z-index: 45; }
.bg:has(.mk-bar) .update-bar { bottom: calc(84px + env(safe-area-inset-bottom)); }
@supports not selector(:has(*)) { .bg .update-bar { bottom: calc(84px + env(safe-area-inset-bottom)); } }   /* an older phone: always clear of it */
.bg-gate { display: none; min-height: 60dvh; place-items: center; text-align: center; }
body[data-state="opening"] .bg-gate, body[data-state="gate"] .bg-gate { display: grid; }
.bg-gate-in { max-width: 360px; }
.bg-gate h1 { font-size: var(--fs-section); margin: 0 0 var(--s2); font-weight: 600; }
.bg-gate p { margin: 0 0 var(--s5); color: var(--text-secondary); }
.bg-gate .bg-gate-fine { margin-top: calc(var(--s3) * -1); font-size: var(--fs-caption); color: var(--text-tertiary); }
.bg-gate .mk-link { min-height: 44px; }
.bg-sheet { border: none; border-radius: var(--r-xl); padding: 0; width: min(520px, calc(100vw - 32px)); background: var(--surface); color: var(--text-primary); box-shadow: var(--shadow-pop); }
.bg-sheet::backdrop { background: rgba(10, 10, 12, 0.42); }
.bg-sheet form { display: grid; gap: var(--s3); padding: var(--s5); }
.bg-sheet-head { display: flex; align-items: center; justify-content: space-between; }
.bg-sheet h2 { margin: 0; font-size: var(--fs-section); font-weight: 600; text-transform: none; letter-spacing: normal; color: var(--text-primary); }
.bg-sheet textarea { width: 100%; resize: vertical; min-height: 132px; }
.bg-sheet .mk-check small { display: block; color: var(--text-tertiary); font-size: var(--fs-caption); margin-top: 2px; }
@media (max-width: 560px) {
  /* a phone: each button keeps a word under its icon (2026-11-09: the welcome card and the email name
     "Backup" and "Feedback", and the icons alone didn't say which was which) */
  .bg-actions { gap: var(--s1); }
  .bg-btn .bg-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .bg-btn .bg-short { display: block; font-size: 11px; line-height: 1; color: var(--text-secondary); }
  .bg-btn { flex-direction: column; gap: 3px; min-width: 50px; height: 44px; justify-content: center; padding: 0 4px; }
  .bg main { padding-left: var(--s4); padding-right: var(--s4); }
  .bg-sheet { width: calc(100vw - 24px); margin: auto auto var(--s3); }
}

/* The free pilot's sign-up page (join.html): one column, the pilot note above the form. */
.jn main { padding-top: var(--s5); }
.jn-in { max-width: 460px; margin: 0 auto; display: grid; gap: var(--s5); }
.jn-in[hidden] { display: none; }
.jn h1 { margin: 0; font-size: var(--fs-title); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }
.jn-lead { margin: var(--s2) 0 0; color: var(--text-secondary); line-height: 1.45; }
.jn-pilot { padding: var(--s4); border-radius: var(--r-lg); background: var(--accent-soft); line-height: 1.45; }
.jn-pilot h2 { margin: 0 0 var(--s1); font-size: var(--fs-body); font-weight: 600; color: var(--accent-text); text-transform: none; letter-spacing: normal; }
.jn-pilot p { margin: 0; }
.jn-pilot p + p { margin-top: var(--s2); font-weight: 600; }
.jn-form { display: grid; gap: var(--s4); }
.jn-f { display: grid; gap: var(--s1); font-size: var(--fs-secondary); font-weight: 500; }
.jn-f input {
  min-height: 48px; padding: 0 var(--s3); border-radius: var(--r-md); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text-primary); font: inherit; font-size: 16px; font-weight: 400;
  transition: border-color var(--dur-fast) var(--ease);
}
.jn-f input:hover { border-color: var(--border-control); }
.jn-f input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.jn-check { display: flex; align-items: flex-start; gap: var(--s3); min-height: 44px; font-size: var(--fs-secondary); line-height: 1.4; cursor: pointer; }
.jn-check input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--accent-fill); }
.jn-check input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.jn-error { margin: 0; padding: var(--s3); border-radius: var(--r-md); background: var(--destructive-soft); color: var(--destructive); font-size: var(--fs-secondary); line-height: 1.4; }
.jn-error[hidden] { display: none; }
.jn-go { width: 100%; min-height: 48px; }
.jn-actions { display: grid; gap: var(--s2); }
.jn-fine { margin: 0; color: var(--text-secondary); font-size: var(--fs-secondary); line-height: 1.45; }
.jn-small { margin: 0; color: var(--text-tertiary); font-size: var(--fs-caption); line-height: 1.45; text-align: center; }
.jn-again { justify-self: center; min-height: 44px; padding: 0 var(--s3); border: 0; background: none; color: var(--accent-text); font: inherit; font-size: var(--fs-secondary); font-weight: 500; cursor: pointer; }
.jn-again:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
