/* Family OS app shell (assets/app-shell.js; DESIGN.md section 10). Only pages that opt in get data-fos-shell on <html>; every rule here is scoped to it.
 * Top bar 56px (or the persona target) plus the safe area; tab bar at the bottom on phones and tablets, inside the top bar from 900px.
 * Built on the kit tokens (assets/family-kit.css), so every persona and style pack applies. No outside host, no pure black or white. */
html[data-fos-shell] {
  --fos-top-h: max(56px, var(--target, 44px));
  --fos-tabbar-h: max(56px, var(--target, 44px));
  --fk-bottom: calc(var(--fos-tabbar-h) + 8px);
}
/* what the shell replaces: the language picker at the top of a page and the small "Home" links */
html[data-fos-shell] :is(.langbar, [data-shell-hide], #fos-top-nav-bar, a.home-link) { display: none !important; }

/* ---- top bar ---- */
.fos-shell-top {
  position: sticky; inset-block-start: 0; z-index: 40;
  padding-block-start: env(safe-area-inset-top, 0px); padding-inline: max(var(--s-2, 8px), env(safe-area-inset-left, 0px)) max(var(--s-2, 8px), env(safe-area-inset-right, 0px));
  background: var(--bg); border-block-end: 1px solid var(--line);
}
.fos-shell-bar { display: flex; align-items: center; gap: var(--s-2, 8px); min-block-size: var(--fos-top-h); max-inline-size: 1120px; margin-inline: auto; }
.fos-shell-lead { flex: none; inline-size: 40px; }
span.fos-shell-lead { inline-size: var(--s-2, 8px); }
.fos-shell-title {
  flex: 1 1 auto; min-inline-size: 0; margin: 0; font-size: var(--t-body, 17px); font-weight: 650; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-body); text-transform: none; letter-spacing: normal;
}
.fos-shell-avatar.fk-btn--icon {
  --fk-fill: var(--accent-soft); --fk-on: var(--on-accent-soft); flex: none; font-weight: 700; font-size: var(--t-body, 17px); text-transform: none;
}
.fos-shell-avatar > svg { inline-size: 22px; block-size: 22px; }
/* Family Faces: the person's drawn face fills the round button */
.fos-shell-avatar.fos-shell-avatar--face { padding: 0; overflow: hidden; }
.fos-shell-avatar.fos-shell-avatar--face > svg { inline-size: 100%; block-size: 100%; }

/* ---- tab bar: phone and tablet ---- */
.fos-shell-tabs {
  position: fixed; z-index: 40; inset-inline: 0; inset-block-end: 0;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  min-block-size: var(--fos-tabbar-h); padding-block-end: env(safe-area-inset-bottom, 0px); padding-inline: env(safe-area-inset-left, 0px) env(safe-area-inset-right, 0px);
  background: var(--surface); border-block-start: 1px solid var(--line);
}
.fos-shell-tab {
  position: relative; display: grid; justify-items: center; align-content: center; gap: 2px; min-block-size: var(--fos-tabbar-h); min-inline-size: 44px; padding: 4px 2px;
  color: var(--ink-2); text-decoration: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; filter: none;
}
.fos-shell-tab__icon { display: grid; place-items: center; inline-size: 64px; max-inline-size: 100%; block-size: 32px; border-radius: var(--r-full, 999px); transition: background-color var(--d-fast, 140ms) var(--ease-std, ease); }
.fos-shell-tab__icon > svg { inline-size: 24px; block-size: 24px; }
.fos-shell-tab__label { font-size: max(11px, calc(var(--t-caption, 13px) * .85)); font-weight: 600; line-height: 1.15; text-align: center; text-transform: none; letter-spacing: normal; }
.fos-shell-tab[aria-current="page"] { color: var(--accent-ink); }
.fos-shell-tab[aria-current="page"] .fos-shell-tab__icon { background: var(--accent-soft); color: var(--on-accent-soft); }
.fos-shell-tab[aria-current="page"] .fos-shell-tab__label { font-weight: 700; }
@media (hover: hover) and (pointer: fine) { .fos-shell-tab:hover .fos-shell-tab__icon { background: color-mix(in oklch, var(--surface), var(--state-on, var(--ink)) 8%); } }
.fos-shell-tab:active { transform: none; }
.fos-shell-tab:active .fos-shell-tab__icon { transform: scale(var(--press-icon, .92)); }
.fos-shell-tab:focus-visible { outline-style: solid; outline-width: 3px; outline-color: CanvasText; outline-color: var(--accent-ink); outline-offset: -3px; }
/* room under the page for the tab bar and the talk button */
html[data-fos-shell] body { padding-block-end: calc(var(--fos-tabbar-h) + env(safe-area-inset-bottom, 0px) + 32px); }

/* ---- desktop: the tabs move into the top bar ---- */
@media (min-width: 900px) {
  html[data-fos-shell] { --fk-bottom: 0px; }
  html[data-fos-shell] body { padding-block-end: 48px; }
  .fos-shell-tabs {
    position: static; display: flex; gap: var(--s-1, 4px); min-block-size: 0; padding: 0; background: transparent; border: 0; flex: none;
  }
  .fos-shell-title { flex: 0 1 auto; margin-inline-end: auto; }
  .fos-shell-tab { display: flex; align-items: center; gap: var(--s-2, 8px); min-block-size: 44px; padding: 0 var(--s-3, 12px) 0 var(--s-2, 8px); border-radius: var(--r-full, 999px); }
  .fos-shell-tab__icon { inline-size: 32px; block-size: 32px; }
  .fos-shell-tab__icon > svg { inline-size: 20px; block-size: 20px; }
  .fos-shell-tab__label { font-size: var(--t-sm, 15px); }
}

/* ---- the talk button (assets/voice.js) lives IN the tab bar, in its own last slot, so it never covers the page ----
   The status box and the voice settings open above the bar; the settings are reached from the avatar menu (Voice settings). From 900px (no
   bottom bar) the button floats bottom right, outside the page column. */
html[data-fos-shell].fos-has-mic #fv {
  left: auto; right: env(safe-area-inset-right, 0px); bottom: env(safe-area-inset-bottom, 0px); z-index: 41; max-width: none; gap: 0;
  inline-size: calc((100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)) / var(--fos-tab-n, 6));
  block-size: var(--fos-tabbar-h); display: flex; align-items: center; justify-content: center;
}
.fos-shell-micslot { min-inline-size: 44px; }
html[data-fos-shell] #fvBar { display: flex; align-items: center; justify-content: center; }
html[data-fos-shell] #fvMore { display: none; }
html[data-fos-shell] #fvBtn { width: 48px; height: 48px; min-height: 48px; font-size: 22px; background: var(--accent); color: var(--on-accent); box-shadow: none; }
html[data-fos-shell] #fvBtn.on { background: var(--accent-2); color: var(--on-accent-2); }
html[data-fos-shell] :is(#fvBox, #fvSheet) {
  position: absolute; bottom: calc(100% + 12px); right: 12px; inline-size: min(360px, calc(100vw - 24px));
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-lg, 16px); box-shadow: var(--e2);
}
html[data-fos-shell] #fvSheet { display: none; }
html[data-fos-shell] #fv.fvOpen #fvSheet { display: flex; flex-direction: column; gap: 8px; align-items: stretch; padding: 10px; }
html[data-fos-shell] #fv.fvOpen #fvBox:not([hidden]) ~ #fvSheet { bottom: auto; }
html[data-fos-shell] #fv.fvOpen #fvHands, html[data-fos-shell] #fv.fvOpen #fvRateRow { border: 0; padding: 4px 6px; border-radius: var(--r-sm, 8px); background: transparent; }
@media (min-width: 900px) {
  html[data-fos-shell].fos-has-mic #fv { bottom: 16px; right: 16px; inline-size: 56px; block-size: 56px; }
  html[data-fos-shell] #fvBtn { width: 56px; height: 56px; box-shadow: var(--e1); }
  .fos-shell-micslot { display: none; }
}

/* ---- shared widgets drawn by older scripts (the personalise studio, opportunity cards, My apps) take the kit look on a shell page ---- */
html[data-fos-shell] :is(.fos-w-btn, .opp-btn) {
  display: inline-flex; align-items: center; justify-content: center; min-block-size: var(--target, 44px); padding: 0 var(--s-5, 24px);
  border-radius: var(--r-md, 12px); border: 1px solid var(--accent-soft); background: var(--accent-soft); color: var(--on-accent-soft);
  font: inherit; font-size: var(--t-body, 17px); font-weight: 650; line-height: 1.2; text-decoration: none; box-shadow: var(--fk-hard, none); text-transform: none;
}
html[data-pack="grimy"][data-fos-shell] :is(.fos-w-btn, .opp-btn), html[data-pack="retro"][data-fos-shell] :is(.fos-w-btn, .opp-btn) { border-width: 2px; border-color: var(--ink); }
html[data-fos-shell] :is(.fos-w-btn:not(.fos-w-btn-sec), .opp-btn.primary) { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
html[data-fos-shell] :is(.fos-chip-btn) {
  display: inline-flex; align-items: center; min-block-size: 32px; padding: 0 var(--s-3, 12px); border-radius: var(--r-full, 999px);
  border: 1px solid var(--control-edge); background: var(--surface); color: var(--ink); font: inherit; font-size: var(--t-sm, 15px); font-weight: 600; line-height: 1.2; position: relative;
}
html[data-fos-shell] .fos-chip-btn::after { content: ""; position: absolute; inset: -6px 0; }
html[data-fos-shell] .fos-chip-btn.fos-chip-accent { background: var(--accent-soft); color: var(--on-accent-soft); border-color: var(--accent-soft); }
html[data-fos-shell] :is(.fos-pin-card, .opp-card) {
  background: var(--surface); border: var(--fk-card-bw, 1px) solid var(--fk-card-edge, var(--line)); border-radius: var(--fk-card-r, 16px);
  box-shadow: var(--fk-card-shadow, none); padding: var(--s-4, 16px);
}
html[data-fos-shell] .fos-board-eyebrow { font-size: var(--t-sm, 15px); letter-spacing: .04em; color: var(--accent-ink); }
html[data-fos-shell] #fos-pinned-board > div[style*="dashed"] { border-radius: var(--fk-card-r, 16px) !important; padding: var(--s-4, 16px) !important; gap: var(--s-3, 12px); flex-wrap: wrap; }
html[data-fos-shell] #fos-pinned-board [style*="font-size:12px"], html[data-fos-shell] #fos-pinned-board [style*="font-size:13px"], html[data-fos-shell] #fos-pinned-board [style*="font-size:11px"] { font-size: var(--t-sm, 15px) !important; }
html[data-fos-shell] #fos-pinned-board :is(input, select, textarea) { font-size: max(16px, 1em) !important; min-block-size: 44px; border-radius: var(--r-md, 12px) !important; border-color: var(--control-edge) !important; }
@media (hover: hover) and (pointer: fine) {
  html[data-fos-shell] :is(.fos-w-btn, .opp-btn, .fos-chip-btn):hover { background-color: color-mix(in oklch, var(--accent-soft), var(--ink) 8%); filter: none; }
  html[data-fos-shell] :is(.fos-w-btn:not(.fos-w-btn-sec), .opp-btn.primary):hover { background-color: color-mix(in oklch, var(--accent), var(--ink) 8%); }
}
/* My apps (assets/my-apps.js) */
html[data-fos-shell] .myapps { margin: 0; background: var(--surface); border: var(--fk-card-bw, 1px) solid var(--fk-card-edge, var(--line)); border-radius: var(--fk-card-r, 16px); box-shadow: var(--fk-card-shadow, none); padding: var(--s-4, 16px); }
html[data-fos-shell] .myapps-head h2 { font-size: var(--t-title3, 20px); }
html[data-fos-shell] :is(.myapps-head button:not(.fos-info), .myapps .ma-btn, .myapps .ma-actions button) {
  min-block-size: var(--target, 44px); min-inline-size: var(--target, 44px); padding: 0 var(--s-3, 12px); border-radius: var(--r-md, 12px);
  border: 1px solid var(--control-edge); background: transparent; color: var(--accent-ink); font-size: var(--t-body, 17px); font-weight: 650;
}
html[data-fos-shell] .myapps .ma-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
html[data-fos-shell] .myapps .ma-sugg button { min-block-size: 32px; padding: 0 var(--s-3, 12px); border: 1px solid var(--control-edge); border-radius: var(--r-full, 999px); background: var(--surface); font-size: var(--t-sm, 15px); font-weight: 600; position: relative; }
html[data-fos-shell] .myapps .ma-sugg button::after { content: ""; position: absolute; inset: -6px 0; }
html[data-fos-shell] :is(.myapps-grid a, .myapps-grid button) { border-radius: var(--r-lg, 16px); background: var(--surface-2); border-color: transparent; }
html[data-fos-shell] .myapps .ma-tile { border-radius: var(--r-md, 12px); background: var(--surface); }
html[data-fos-shell] .myapps-grid .ma-add .ma-tile { background: var(--accent-soft); color: var(--on-accent-soft); }
html[data-fos-shell] :is(.myapps .ma-note, .myapps-grid .ma-name) { font-size: var(--t-sm, 15px); color: var(--ink-2); }
html[data-fos-shell] .myapps-grid .ma-name { color: var(--ink); font-weight: 600; }
html[data-fos-shell] .myapps input { border-color: var(--control-edge); border-radius: var(--r-md, 12px); background: var(--surface); }
html[data-fos-shell] .myapps .fos-info { min-block-size: 28px; min-inline-size: 28px; padding: 0; border-radius: 50%; border: 1.5px solid currentColor; background: transparent; color: var(--muted); font: 700 15px/1 system-ui, sans-serif; }
/* the studio's remove-from-board cross: the kit icon button */
html[data-fos-shell] [data-fos-unpin] {
  inline-size: 40px !important; block-size: 40px !important; min-inline-size: 40px !important; min-block-size: 40px !important; margin: -6px -6px -6px 0 !important; padding: 0 !important;
  border: 1px solid transparent !important; border-radius: var(--r-full, 999px) !important; font-size: var(--t-body, 17px) !important; font-weight: 700; color: var(--ink-2) !important; position: relative;
}
html[data-fos-shell] [data-fos-unpin]::before { content: ""; position: absolute; inset: -2px; }
@media print { .fos-shell-top, .fos-shell-tabs { display: none !important; } html[data-fos-shell] body { padding: 0; } }
/* the language picker (assets/i18n.js mountPicker) inside the shell's Language sheet: kit fields */
.fos-shell-lang .i18n-picker { border: 0; margin: 0; padding: 0; min-inline-size: 0; display: grid; gap: 6px; }
.fos-shell-lang .i18n-picker legend { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.fos-shell-lang .i18n-picker label { display: block; font-size: var(--t-sm, 15px); font-weight: 600; margin: var(--s-2, 8px) 0 0; }
.fos-shell-lang .i18n-picker select {
  inline-size: 100%; min-block-size: max(48px, var(--target, 44px)); padding: 10px 44px 10px 14px; border: 1px solid var(--control-edge); border-radius: var(--r-md, 12px);
  background-color: var(--surface); color: var(--ink); font: inherit; font-size: max(16px, var(--t-body, 17px)); appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 22px) 52%, calc(100% - 16px) 52%; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
}
.fos-shell-lang .i18n-picker select:focus-visible { border-color: var(--accent-ink); outline-style: solid; outline-width: 3px; outline-color: CanvasText; outline-color: var(--accent-ink); outline-offset: 2px; }
.fos-shell-lang .i18n-picker-note { font-size: var(--t-sm, 15px); color: var(--ink-2); margin: var(--s-2, 8px) 0 0; }
.fos-shell-lang .i18n-picker-status { font-size: var(--t-sm, 15px); font-weight: 600; color: var(--success-ink); min-block-size: 1.2em; margin: 0; }
html[data-fos-shell] .myapps .ma-msg:empty { display: none; }

/* ---- B01/B02 (docs/NOTIFY-INSTALL.md): the install coach, the share chooser and the notifications card (assets/notify-client.js,
   organiser Settings). Kit tokens only; targets from --target (64px in the grandparent and Amaya looks). */
.nc-coach__lead { margin: 0 0 var(--s-3); color: var(--ink-2); font-size: var(--t-body); }
.nc-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.nc-step { display: grid; grid-template-columns: 28px 52px 1fr; align-items: center; gap: var(--s-3); min-height: var(--target); padding: var(--s-2) var(--s-3); border-radius: var(--r-md); background: var(--surface-2); }
.nc-step__n { width: 28px; height: 28px; border-radius: var(--r-full); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font: 700 var(--t-sm) / 1 var(--font-num, inherit); }
.nc-step__pic { width: 52px; height: 52px; display: grid; place-items: center; color: var(--accent-ink); border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.nc-step__pic svg, .nc-step__pic img { width: 34px; height: 34px; border-radius: 8px; }
.nc-step__text { color: var(--ink); font-size: var(--t-body); line-height: 1.35; }
.nc-coach--big .nc-coach__lead, .nc-coach--big .nc-step__text { font-size: 1.3rem; line-height: 1.4; }
.nc-coach--big .nc-step { grid-template-columns: 40px 72px 1fr; min-height: 88px; }
.nc-coach--big .nc-step__n { width: 40px; height: 40px; font-size: 1.2rem; }
.nc-coach--big .nc-step__pic { width: 72px; height: 72px; }
.nc-coach--big .nc-step__pic svg, .nc-coach--big .nc-step__pic img { width: 48px; height: 48px; }
.nc-share__files { list-style: none; margin: 0 0 var(--s-3); padding: 0; display: flex; gap: var(--s-2); overflow-x: auto; }
.nc-share__file { flex: 0 0 auto; display: grid; place-items: center; width: 88px; height: 88px; border-radius: var(--r-md); background: var(--surface-2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.nc-share__file img { width: 100%; height: 100%; object-fit: cover; }
.nc-share__doc { font: 800 var(--t-sm) / 1 var(--font-num, inherit); color: var(--danger-ink); }
.nc-share__name { font-size: 11px; color: var(--ink-2); max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nc-share__text { margin: 0 0 var(--s-3); padding: var(--s-3); border-radius: var(--r-md); background: var(--surface-2); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.nc-route__icon { font-size: 22px; }
.nc-card .nc-list { margin-top: var(--s-3); }
.nc-card .nc-h3 { font-size: var(--t-body); margin: var(--s-4) 0 var(--s-2); }
.nc-times, #ncDigestAt { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--s-3); margin-top: var(--s-3); }
.nc-time .fk-input { min-height: var(--target); width: 100%; box-sizing: border-box; }
.nc-actions { margin-top: var(--s-4); flex-wrap: wrap; }
.nc-row { padding-inline: 0; }
.nc-row .fk-switch__label { display: grid; gap: 2px; min-width: 0; }
.nc-row__title { font-weight: 600; color: var(--ink); }
.nc-row__sub { font-weight: 400; display: block; }
.nc-row--fixed { display: flex; align-items: center; gap: var(--s-3); min-height: var(--target); }
.nc-row--fixed .fk-switch__label { flex: 1 1 auto; }
.nc-card #pushBtn { max-width: 100%; white-space: normal; height: auto; }
.nc-coach--big ~ .fk-dialog__actions .fk-btn, dialog:has(.nc-coach--big) .fk-dialog__actions .fk-btn { min-height: 64px; font-size: 1.2rem; padding-inline: 32px; }
.nc-row--fixed .fk-chip { flex: none; white-space: nowrap; }

/* a page's own sticky save bar sits above the tab bar, not under it (Nan's window set-up, polish-gaps 13 Nov 2026) */
html[data-fos-shell] .nw-savebar { inset-block-end: var(--fk-bottom, 0px); }
