/* Onboard part: the first-run welcome. A takeover screen over everything but the update screen (20000).
   The rules first below are look "natevatainment" (navy, Santa red, fluoro yellow, snow, chunky 3D buttons), the look
   it was first built in. The default, look "app", is the html.ob-app block further down, which redraws every screen
   from the app's own shell tokens; part.js puts ob-app on <html> unless the app sets look "natevatainment". */
.ob {
  position: fixed; inset: 0; z-index: 9500;
  display: flex; align-items: center; justify-content: center;
  padding: calc(24px + var(--sat, 0px)) 20px calc(24px + var(--sab, 0px));
  background:
    radial-gradient(120% 70% at 50% 38%, #ffffff 0%, #fbfdff 45%, #e6eefa 100%);
  color: #1d2f52; text-align: center; overflow: hidden;
  font-family: var(--font); -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none; touch-action: manipulation; cursor: default;
  transition: opacity .45s ease, transform .45s ease;
}
.ob.bye { opacity: 0; transform: scale(1.04); pointer-events: none; }
.ob-confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.ob-step { position: relative; z-index: 1; width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; }
.ob-step[hidden] { display: none; }
.ob-step-1.out { animation: ob-out .26s ease-in both; }
.ob-step-2 { animation: ob-in .5s cubic-bezier(.25, 1.4, .5, 1) both; }

.ob-logo {
  width: 112px; height: 112px; border-radius: 28px; display: block;
  box-shadow: 0 14px 34px rgba(46, 79, 134, .28);
  animation: ob-pop .7s cubic-bezier(.25, 1.6, .5, 1) .05s both;
}
.ob-logo-small { width: 72px; height: 72px; border-radius: 20px; margin-bottom: 22px; animation: none; }
.ob-title { margin: 26px 0 0; line-height: 1; font-weight: 800; }
.ob-kicker {
  display: block; font-size: 19px; font-weight: 800; letter-spacing: .04em; color: #d3202f;
  margin-bottom: 10px; animation: ob-in .5s ease-out .2s both;
}
.ob-letters {
  display: block; font-family: var(--font-head); font-size: clamp(30px, 10.6vw, 54px); letter-spacing: -.02em;
  color: #2e4f86; white-space: nowrap;
}
.ob-l { display: inline-block; animation: ob-letter .55s cubic-bezier(.25, 1.7, .5, 1) both; }
.ob-tap {
  margin-top: 46px; font-size: 15px; font-weight: 700; color: #5c6f92; opacity: 0;
  transition: opacity .4s ease;
}
.ob-tap.show { opacity: 1; animation: ob-bob 1.6s ease-in-out .4s infinite; }

.ob-q {
  margin: 0; font-family: var(--font-head); font-weight: 800; font-size: clamp(30px, 9vw, 44px);
  line-height: 1.08; letter-spacing: -.02em; color: #2e4f86; max-width: 340px;
}
.ob-line { margin-top: 12px; font-size: 17px; font-weight: 700; color: #d3202f; }
.ob-btn {
  margin-top: 40px; min-height: 68px; width: 100%; max-width: 320px; padding: 0 28px;
  border: 3px solid #2e4f86; border-radius: 999px; background: #e8ff1f; color: #1d2f52;
  font: inherit; font-size: 24px; font-weight: 800; letter-spacing: -.01em; cursor: pointer;
  box-shadow: 0 7px 0 #2e4f86; transition: transform .1s ease, box-shadow .1s ease;
  animation: ob-wiggle 2.8s ease-in-out 1.2s infinite;
}
.ob-step-1 .ob-btn { margin-top: 44px; animation: ob-in .5s ease-out .9s both; }
.ob-btn:active { animation: none; }
.ob-btn:active, .ob-btn.cheer { transform: translateY(5px); box-shadow: 0 2px 0 #2e4f86; }
.ob-btn.cheer { animation: ob-cheer .5s cubic-bezier(.25, 1.7, .5, 1) both; background: #d3202f; color: #ffffff; border-color: #8f1420; box-shadow: 0 2px 0 #8f1420; }
.ob-btn:focus-visible { outline: 3px solid #d3202f; outline-offset: 4px; }

@keyframes ob-pop { from { transform: scale(.2) rotate(-14deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ob-letter { from { transform: translateY(26px) scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ob-in { from { transform: translateY(22px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ob-out { to { transform: translateY(-18px); opacity: 0; } }
@keyframes ob-bob { 0%, 100% { transform: none; } 50% { transform: translateY(-4px); } }
@keyframes ob-wiggle { 0%, 84%, 100% { transform: none; } 88% { transform: rotate(-2.5deg) scale(1.03); } 92% { transform: rotate(2.5deg) scale(1.03); } 96% { transform: rotate(-1deg); } }
@keyframes ob-cheer { 0% { transform: translateY(5px) scale(.94); } 60% { transform: translateY(5px) scale(1.08); } 100% { transform: translateY(5px) scale(1); } }

/* one card at a time: the shell's install and notification cards wait until the welcome has gone */
.ob-open .install-card, .ob-open .push-card { visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
  .ob, .ob * { animation: none !important; transition: none !important; }
  .ob-tap { opacity: 1; }
}

/* the starts, the inductions (coach marks with an arrow at the real button), Get set up and Phone check.
   Look "natevatainment": navy #2e4f86, Santa red #d3202f, fluoro yellow #e8ff1f, snow #fbfdff (html.ob-app below
   redraws them in the app's own colours). 48 px taps. */
.obt {
  position: fixed; inset: 0; z-index: 9400; color: #1d2f52; font-family: var(--font);
  -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
}
.obt-choice, .obs {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(20px + var(--sat, 0px)) 16px calc(20px + var(--sab, 0px));
  background: radial-gradient(120% 70% at 50% 38%, #ffffff 0%, #fbfdff 45%, #e6eefa 100%);
}
.obt-card { width: 100%; max-width: 400px; text-align: center; animation: obt-in .4s cubic-bezier(.25, 1.4, .5, 1) both; }
.obt-logo { width: 64px; height: 64px; border-radius: 18px; display: block; margin: 0 auto 18px; box-shadow: 0 10px 26px rgba(46, 79, 134, .25); }
.obt-title { margin: 0; font-family: var(--font-head); font-weight: 800; font-size: clamp(26px, 8vw, 36px); line-height: 1.1; letter-spacing: -.02em; color: #2e4f86; }
.obt-line { margin: 10px 0 0; font-size: 17px; font-weight: 700; color: #d3202f; }
.obt-choices { display: flex; flex-direction: column; gap: 14px; margin-top: 30px; }
.obt-choices.busy { opacity: .6; pointer-events: none; }
.obt-note { min-height: 1.4em; margin: 14px 0 0; font-weight: 700; color: #d3202f; }
.obt-btn {
  min-height: 56px; width: 100%; padding: 0 22px; border-radius: 999px; font: inherit; font-size: 19px;
  font-weight: 800; cursor: pointer; transition: transform .1s ease, box-shadow .1s ease;
}
.obt-btn.primary { border: 3px solid #2e4f86; background: #e8ff1f; color: #1d2f52; box-shadow: 0 5px 0 #2e4f86; }
.obt-btn.second { border: 2px solid #2e4f86; background: #ffffff; color: #2e4f86; box-shadow: 0 3px 0 rgba(46, 79, 134, .35); }
.obt-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #2e4f86; }
.obt-btn:disabled { opacity: .55; cursor: default; }
.obt-btn:focus-visible, .obs-fix:focus-visible, .obs-switch:focus-visible { outline: 3px solid #d3202f; outline-offset: 3px; }
.obt-row { display: flex; gap: 10px; margin-top: 16px; }
.obt-row .obt-btn { flex: 1 1 0; min-width: 0; font-size: 17px; padding: 0 12px; }

/* the tour: the page shows through a hole round the real button, an arrow points at it, the card says what it is */
.obt-tour { background: transparent; }
.obt-spot {
  position: fixed; border-radius: 16px; pointer-events: none;
  box-shadow: 0 0 0 4px #e8ff1f, 0 0 0 9999px rgba(20, 32, 60, .74);
  transition: left .3s ease, top .3s ease, width .3s ease, height .3s ease;
  animation: obt-ring 1.6s ease-in-out infinite;
}
.obt-tour.no-target .obt-spot { left: 50%; top: 50%; width: 0; height: 0; box-shadow: 0 0 0 9999px rgba(20, 32, 60, .74); animation: none; }
.obt-arrow { position: fixed; width: 32px; height: 36px; pointer-events: none; }
.obt-arrow[hidden] { display: none; }
.obt-arrow::before {
  content: ""; position: absolute; left: 13px; width: 6px; height: 22px; border-radius: 3px; background: #e8ff1f;
}
.obt-arrow::after {
  content: ""; position: absolute; left: 4px; width: 0; height: 0; border-left: 12px solid transparent; border-right: 12px solid transparent;
}
.obt-arrow.up::before { top: 12px; }
.obt-arrow.up::after { top: 0; border-bottom: 16px solid #e8ff1f; }
.obt-arrow.down::before { top: 2px; }
.obt-arrow.down::after { top: 20px; border-top: 16px solid #e8ff1f; }
.obt-arrow.up { animation: obt-bob-up 1.1s ease-in-out infinite; }
.obt-arrow.down { animation: obt-bob-down 1.1s ease-in-out infinite; }
.obt-bubble {
  position: fixed; left: 16px; right: 16px; margin: 0 auto; max-width: 420px; box-sizing: border-box;
  padding: 18px 18px 16px; border-radius: 22px; background: #fbfdff; border: 3px solid #2e4f86;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .3); max-height: calc(100dvh - 120px); overflow: auto;
  animation: obt-in .35s cubic-bezier(.25, 1.4, .5, 1) both;
}
.obt-tour.no-target .obt-bubble { top: 50%; transform: translateY(-50%); animation: none; }
.obt-dots { font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #d3202f; }
.obt-h { margin: 6px 0 0; font-family: var(--font-head); font-size: 24px; line-height: 1.15; font-weight: 800; color: #2e4f86; }
.obt-p { margin: 8px 0 0; font-size: 17px; line-height: 1.4; color: #1d2f52; }
.obt-admin .obt-bubble { border-color: #d3202f; }
.obt-admin .obt-dots::after { content: "  \00b7  admins only"; }
.obt-tree { margin-top: 10px; }
.obt-treecard { text-align: left; }
.obt-tree-name { font-size: 20px; font-weight: 800; color: #2e4f86; }
.obt-facts { margin: 8px 0 0; padding-left: 22px; }
.obt-facts li { margin: 4px 0; }

/* Get set up */
.obs { justify-content: flex-start; overflow-y: auto; }
.obs-card { width: 100%; max-width: 440px; padding-top: 8px; }
.obs-card .obt-title { text-align: left; }
.obs-card .obt-line { text-align: left; color: #1d2f52; font-weight: 600; font-size: 16px; }
.obs-list, .obs-check { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.obs-row {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 12px; box-sizing: border-box;
  border-radius: 18px; background: #ffffff; border: 2px solid #d5deee; cursor: pointer;
}
.obs-row.is-on { border-color: #2e4f86; }
.obs-row.is-na { opacity: .6; }
.obs-ico { flex: 0 0 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: #e6eefa; color: #2e4f86; }
.obs-ico svg { width: 22px; height: 22px; }
.obs-own-ico { display: inline-flex; }
.obs-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.obs-label { font-weight: 800; font-size: 17px; }
.obs-why { font-size: 14px; color: #5c6f92; }
.obs-state { font-size: 14px; font-weight: 800; }
.obs-state:empty { display: none; }
.obs-state.ok { color: #1f7a3a; }
.obs-state.ok::before { content: "\2713  "; }
.obs-state.off { color: #d3202f; }
.obs-state.busy { color: #2e4f86; }
.obs-state.na { color: #5c6f92; }
.obs-help { margin: 4px 0 0; font-size: 13px; color: #1d2f52; }
.obs-help[hidden], .obs-fix[hidden], .obs-switch[hidden] { display: none; }
.obs-fix {
  flex: 0 0 auto; min-height: 48px; min-width: 64px; padding: 0 14px; border-radius: 999px; border: 2px solid #d3202f;
  background: #ffffff; color: #d3202f; font: inherit; font-weight: 800; cursor: pointer;
}
/* the switch: a big pill, On is navy */
.obs-switch {
  -webkit-appearance: none; appearance: none; flex: 0 0 auto; position: relative; width: 56px; height: 32px; margin: 8px 0;
  border-radius: 999px; background: #c5cfdf; cursor: pointer; transition: background .15s ease;
}
.obs-switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: #ffffff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .15s ease;
}
.obs-switch:checked { background: #2e4f86; }
.obs-switch:checked::after { transform: translateX(24px); }
.obs-switch:disabled { opacity: .5; }
.obs-foot {
  position: sticky; bottom: 0; width: 100%; max-width: 440px; margin-top: auto; padding: 14px 0 4px;
  background: #fbfdff; box-shadow: 0 -18px 18px -2px #fbfdff;
}
.obs-hint { margin: 0 0 10px; text-align: center; font-weight: 700; color: #2e4f86; }
.obs-go { min-height: 64px; font-size: 22px; }
.obs-later { display: block; width: 100%; min-height: 48px; margin: 6px 0 0; padding: 10px; border: 0; background: none;
             font: inherit; font-weight: 700; color: #2e4f86; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.obs-later[hidden] { display: none; }
.obs-ding { margin: 0 0 12px; padding: 12px; border-radius: 18px; background: #ffffff; border: 2px solid #2e4f86; text-align: center; }
.obs-ding-q { margin: 0; font-weight: 700; }
.obs-sheet .obs-check { margin-top: 4px; }
.obs-sheet .obs-row { cursor: default; }

/* a sheet another part opens while one of these screens shows (the thumb part's Face ID sheet in a browser, the
   push part's) goes over it, or the person could not reach it */
html.obt-open .sheet-backdrop { z-index: 9600; }
html.obt-open .sheet:not(.modeless) { z-index: 9601; }
@keyframes obt-in { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes obt-ring { 0%, 100% { box-shadow: 0 0 0 4px #e8ff1f, 0 0 0 9999px rgba(20, 32, 60, .74); } 50% { box-shadow: 0 0 0 8px #e8ff1f, 0 0 0 9999px rgba(20, 32, 60, .74); } }
@keyframes obt-bob-up { 0%, 100% { transform: none; } 50% { transform: translateY(-6px); } }
@keyframes obt-bob-down { 0%, 100% { transform: none; } 50% { transform: translateY(6px); } }
.obt-open .install-card, .obt-open .push-card { visibility: hidden; }
@media (prefers-reduced-motion: reduce) {
  .obt, .obt * { animation: none !important; transition: none !important; }
}

/* NAT8: the Permissions screen opened from the menu has an X */
.obs-x { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 12px); right: 12px; z-index: 2; width: 44px; height: 44px;
  border-radius: 50%; background: #e6eefa; color: #2e4f86; border: 0; display: grid; place-items: center; }

/* NAT10: setup_choose, the smaller "The permissions I have chosen" under the big Accept all */
.obs-mine { width: 100%; min-height: 48px; margin-top: 10px; font-size: 16px; }
.obs-mine[hidden] { display: none; }

/*  (22 Nov 2026), the DEFAULT since 29 Nov 2026: look "app" (html.ob-app, on unless
   parts.onboard.settings.look is "natevatainment"). Every screen in the app's own colours, fonts and shapes, read from
   the shell's tokens (--accent, --btn, --surface, --text, --radius ...), so it sits in the app like the app's own
   sheets; dark screen follows. The navy, red and fluoro yellow rules above are look "natevatainment" only. */
html.ob-app { --ob-hi: color-mix(in srgb, var(--accent) 62%, #ffffff); --ob-shade: rgba(8, 12, 20, .64); }
html.ob-app .ob, html.ob-app .obt-choice, html.ob-app .obs { background: var(--bg); color: var(--text); }
html.ob-app .obt { color: var(--text); }
html.ob-app .ob-logo, html.ob-app .obt-logo { box-shadow: var(--shadow); }
html.ob-app .ob-kicker, html.ob-app .ob-line { color: var(--accent); }
html.ob-app .ob-letters, html.ob-app .ob-q { color: var(--text); }
html.ob-app .ob-tap { color: var(--muted); }
html.ob-app .ob-btn, html.ob-app .ob-btn.cheer {
  min-height: 54px; border: var(--btn-border-w, 0px) solid var(--edge); border-radius: var(--radius-btn, 12px);
  background: var(--btn); color: var(--on-btn); box-shadow: none; font-size: 18px; font-weight: var(--btn-weight, 600);
  animation: none;
}
html.ob-app .ob-btn:focus-visible { outline-color: var(--accent); }
html.ob-app .obt-title, html.ob-app .obt-h, html.ob-app .obt-tree-name {
  color: var(--text); font-family: var(--font-head); font-weight: var(--head-weight, 700); letter-spacing: var(--head-spacing, -.02em);
}
html.ob-app .obt-title { font-size: clamp(24px, 7vw, 30px); }
html.ob-app .obt-h { font-size: 20px; }
html.ob-app .obt-line, html.ob-app .obt-note { color: var(--muted); font-weight: 500; }
html.ob-app .obt-btn {
  min-height: 50px; border-radius: var(--radius-btn, 12px); font-size: 16px; font-weight: var(--btn-weight, 600);
  text-transform: var(--btn-case, none); letter-spacing: var(--btn-spacing, 0); box-shadow: none;
}
html.ob-app .obt-btn.primary { background: var(--btn); color: var(--on-btn); border: var(--btn-border-w, 0px) solid var(--edge); }
html.ob-app .obt-btn.second { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
html.ob-app .obs-later { color: var(--text); }
html.ob-app .obt-btn:active { transform: scale(.98); box-shadow: none; }
html.ob-app .obt-btn:focus-visible, html.ob-app .obs-fix:focus-visible, html.ob-app .obs-switch:focus-visible { outline-color: var(--accent); }
/* the tour: the page dimmed, a soft ring in the app's accent round the real button, the card like the app's own sheet */
html.ob-app .obt-spot {
  border-radius: var(--radius, 14px); box-shadow: 0 0 0 3px var(--ob-hi), 0 0 0 9999px var(--ob-shade); animation-name: obt-ring-app;
}
html.ob-app .obt-tour.no-target .obt-spot { box-shadow: 0 0 0 9999px var(--ob-shade); animation: none; }
html.ob-app .obt-arrow::before { background: var(--ob-hi); }
html.ob-app .obt-arrow.up::after { border-bottom-color: var(--ob-hi); }
html.ob-app .obt-arrow.down::after { border-top-color: var(--ob-hi); }
html.ob-app .obt-bubble {
  padding: 18px; border-radius: var(--radius-sheet, 20px); background: var(--surface); color: var(--text);
  border: var(--card-border-w, 0px) solid var(--edge); box-shadow: 0 18px 44px rgba(0, 0, 0, .32);
}
html.ob-app .obt-dots {
  color: var(--accent); font-family: var(--font-label, var(--font)); font-size: var(--label-fs, 12px);
  letter-spacing: var(--label-spacing, .08em); font-weight: 700;
}
html.ob-app .obt-p { color: var(--text); font-size: 16px; line-height: var(--lh, 1.45); }
html.ob-app .obt-admin .obt-bubble { border: 2px solid var(--danger); }
/* Get set up */
html.ob-app .obs-card .obt-line { color: var(--muted); font-weight: 500; }
html.ob-app .obs-row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius, 14px); box-shadow: var(--card-shadow, none); }
html.ob-app .obs-row.is-on { border-color: var(--accent); }
html.ob-app .obs-ico { background: var(--accent-soft); color: var(--accent); border-radius: var(--icon-radius, 9px); }
html.ob-app .obs-label { font-weight: var(--head-weight-2, 650); }
html.ob-app .obs-why, html.ob-app .obs-state.na { color: var(--muted); }
html.ob-app .obs-state.ok { color: var(--ok); }
html.ob-app .obs-state.off { color: var(--danger); }
html.ob-app .obs-state.busy { color: var(--accent); }
html.ob-app .obs-help { color: var(--text); }
html.ob-app .obs-fix { border: 1px solid var(--danger); color: var(--danger); background: var(--surface); border-radius: var(--radius-btn, 12px); }
html.ob-app .obs-switch { background: var(--line); }
html.ob-app .obs-switch:checked { background: var(--accent); }
html.ob-app .obs-foot { background: var(--bg); box-shadow: 0 -18px 18px -2px var(--bg); }
html.ob-app .obs-hint { color: var(--muted); font-weight: 600; }
html.ob-app .obs-go { min-height: 56px; font-size: 17px; } /* still the one big button on Get set up */
html.ob-app .obs-ding { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius, 14px); }
html.ob-app .obs-x { background: var(--surface-2); color: var(--text); }
@keyframes obt-ring-app {
  0%, 100% { box-shadow: 0 0 0 3px var(--ob-hi), 0 0 0 9999px var(--ob-shade); }
  50% { box-shadow: 0 0 0 7px var(--ob-hi), 0 0 0 9999px var(--ob-shade); }
}

/* notify_kinds (NAT13, 26 Nov 2026): the which-pings tick boxes under the Notifications line */
.obs-kinds { margin: -4px 4px 0 56px; display: flex; flex-direction: column; gap: 2px; }
.obs-kinds[hidden] { display: none; }
.obs-kinds-head { margin: 0 0 2px; font-size: 13px; font-weight: 800; color: #5c6f92; }
.obs-kinds .push-kind { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 6px; font-size: 15px; cursor: pointer; }
.obs-kinds .push-kind .grow { flex: 1 1 auto; }

/* view_switch_bar (NAT13, 26 Nov 2026): the Admin mode / User mode pill at the left of the top bar (owners only) */
.ob-viewpill { flex: none; display: inline-flex; align-items: center; gap: 5px; min-height: 30px;
  padding: 3px 9px; border-radius: 999px; border: 2px solid rgba(255,255,255,.75); background: transparent;
  color: inherit; font: inherit; font-size: 12px; font-weight: 800; white-space: nowrap; cursor: pointer; }
/* with the pill in, the page title gives way (shortened with ...) so the bar's right-hand buttons stay on screen */
.appbar:has(.ob-viewpill) .appbar-title { min-width: 0 !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ob-viewpill.on { background: #e8ff1f; border-color: #e8ff1f; color: #1d2b4f; }
.ob-viewpill-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; opacity: .8; }

/* look "app" for the two pieces added after : the which-pings heading and the view pill (in the top bar, so it
   takes the bar's own ink and background) */
html.ob-app .obs-kinds-head { color: var(--muted); }
html.ob-app .ob-viewpill { border-color: color-mix(in srgb, var(--bar-ink) 75%, transparent); }
html.ob-app .ob-viewpill.on { background: var(--bar-ink); border-color: var(--bar-ink); color: var(--bar-bg); }
