/* Packard native kit — look (Nov 11 2026). Behavior: /kit/pk-native.js · guide: docs/2026-11-11-packard-native-kit.md (wicko-stock)
   Phones only (≤ 900 px), and only under html.pk (on for PREVIEW users until KIT_ALL flips). Two looks off one set of tokens:
   html.pk-ios = Apple's Liquid Glass (iOS 26/27), html.pk-and = Material 3. The Office's own colors, type and topo stay the brand;
   the kit changes how things move, press, frost and stack.
   Specificity note: the Office's shared bars use `html body .seg:not(…):not(…) > button.on` + !important. Where the kit has to win
   over those it uses :is(…, #_) — an id inside :is() lifts the rule to id weight without matching anything extra. */

:root {
  --pk-ease: cubic-bezier(.32,.72,0,1);          /* Apple navigation / sheets */
  --pk-spring: cubic-bezier(.34,1.56,.5,1);       /* press release */
  --pk-m3: cubic-bezier(.2,0,0,1);                /* Material emphasized */
  --pk-tint: #0A84FF;                             /* iOS system blue — back, Cancel, Done (the Office already uses it for back) */
  /* glass, light */
  --pk-glass: rgba(255,255,255,.58); --pk-glass-hi: rgba(255,255,255,.9); --pk-glass-edge: rgba(0,0,0,.08);
  --pk-glass-sh: 0 8px 28px -10px rgba(15,16,19,.28), 0 1px 3px rgba(15,16,19,.08);
  --pk-blur: blur(22px) saturate(1.8);
  /* Material 3 tones (light) — built off the Office paper/card so the brand reads through */
  --pk-m3-surface: var(--paper); --pk-m3-c: #EEEEEA; --pk-m3-ch: #E6E6E1; --pk-m3-on: #1B1C1F; --pk-m3-onv: #4A4D55;
  --pk-m3-sec: #FFDAD6; --pk-m3-onsec: #410002; --pk-m3-outline: #C6C6C0;
}
[data-theme=dark] {
  --pk-glass: rgba(40,44,52,.52); --pk-glass-hi: rgba(255,255,255,.22); --pk-glass-edge: rgba(255,255,255,.10);
  --pk-glass-sh: 0 10px 30px -10px rgba(0,0,0,.65), 0 1px 2px rgba(0,0,0,.4);
  --pk-m3-c: #1E2126; --pk-m3-ch: #272B31; --pk-m3-on: #E8EBF0; --pk-m3-onv: #B3BAC4;
  --pk-m3-sec: #5C1A20; --pk-m3-onsec: #FFDADB; --pk-m3-outline: #49505B;
}
:root.graphite[data-theme=dark] { --pk-glass: rgba(58,64,74,.5); --pk-m3-c: #2A2F36; --pk-m3-ch: #333941; }

/* the kit's own pieces are hidden unless the kit is on */
.pk-thumb, .pk-cancel, .pk-ptr { display: none; }

@media (max-width: 900px) {

/* ================================================================ type */
html.pk-ios { --sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', system-ui, sans-serif; }
html.pk-and { --sans: 'Roboto Flex', Roboto, 'Google Sans', system-ui, sans-serif; }

/* ================================================================ header */
/* iOS: clear over the page at the top; once something scrolls under it, a soft frosted edge (the iOS 26 scroll-edge effect) */
html.pk-ios .top { background: transparent !important; border-bottom-color: transparent !important; box-shadow: none !important;
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important; position: sticky; isolation: isolate; }
html.pk-ios .top::before { content: ''; position: absolute; inset: 0 0 -22px 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity .25s var(--pk-ease);
  background: linear-gradient(to bottom, color-mix(in srgb, var(--paper) 86%, transparent) 0%, color-mix(in srgb, var(--paper) 55%, transparent) 70%, transparent 100%);
  -webkit-backdrop-filter: blur(14px) saturate(1.7); backdrop-filter: blur(14px) saturate(1.7);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 62%, transparent 100%); mask-image: linear-gradient(to bottom, #000 0%, #000 62%, transparent 100%); }
html.pk-ios.pk-scrolled .top::before { opacity: 1; }
/* the big title tightens as you scroll */
html.pk .top .ttl h1 { transform-origin: 0 50%; transition: transform .22s var(--pk-ease), opacity .2s; }
html.pk-ios .top .ttl h1 { font-size: 28px; line-height: 44px; margin: 0; }
html.pk-ios.pk-scrolled .top .ttl h1 { transform: scale(.82); }

/* round glass buttons in the bar: search folds into one, New is the tinted one */
html.pk .top { align-items: center !important; } html.pk .top .ttl { display: flex; align-items: center; align-self: center; }
html.pk .top .newwrap, html.pk .top .who { display: flex; align-items: center; align-self: center; }
html.pk-ios .top label.search, html.pk-ios .top #newbtn, html.pk-ios .top #hard-refresh {
  width: 44px !important; min-width: 44px; height: 44px !important; flex: 0 0 44px !important; margin: 0 !important; padding: 0 !important; border-radius: 50% !important;
  display: inline-flex !important; align-items: center; justify-content: center; gap: 0 !important; overflow: hidden; }
html.pk-ios .top label.search, html.pk-ios .top #hard-refresh {
  background: var(--pk-glass) !important; border: 0 !important; color: var(--text) !important;
  -webkit-backdrop-filter: var(--pk-blur); backdrop-filter: var(--pk-blur);
  box-shadow: inset 0 1px 0 var(--pk-glass-hi), inset 0 0 0 .5px var(--pk-glass-edge), var(--pk-glass-sh) !important; }
html.pk-ios .top label.search input, html.pk-ios .top label.search kbd { width: 0 !important; min-width: 0 !important; padding: 0 !important; opacity: 0; border: 0 !important; }
html.pk-ios .top label.search packard-icon { margin: 0 !important; }
html.pk-ios .top #newbtn { background: var(--red) !important; color: #fff !important; border: 0 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.38), inset 0 -1px 0 rgba(0,0,0,.18), 0 8px 20px -6px color-mix(in srgb, var(--red) 70%, transparent) !important; }
html.pk-ios .top #newbtn span { display: none !important; }
/* title left, the round buttons right: search, New, refresh */
html.pk .top .ttl { order: 0; margin-right: auto; min-width: 0; }
html.pk .top label.search { order: 2; margin-left: auto; } html.pk .top .spacer { display: none !important; }
html.pk .top .newwrap { order: 3; } html.pk .top .who { order: 4; } html.pk .top .pk-cancel { order: 5; }
html.pk-ios .top { gap: 10px !important; } html.pk-and .top { gap: 4px !important; }
/* search open: the field runs across the bar, Cancel on the right, the title steps aside */
html.pk-ios .top:has(#q:focus) label.search { position: absolute; left: 12px; right: 84px; bottom: calc((var(--top) - 44px) / 2); width: auto !important; flex: none !important;
  border-radius: 20px !important; padding: 0 12px !important; justify-content: flex-start; gap: 8px !important; z-index: 3; }
html.pk-ios .top:has(#q:focus) label.search input { width: 100% !important; opacity: 1; font-size: 17px !important; background: transparent !important; box-shadow: none !important; outline: 0; }
html.pk-ios .top:has(#q:focus) :is(.ttl, .newwrap, .who) { opacity: 0; pointer-events: none; }
html.pk .top:has(#q:focus) .pk-cancel { display: block; }
html.pk-ios .pk-cancel { position: absolute; right: 12px; bottom: calc((var(--top) - 44px) / 2); height: 44px; padding: 0 4px; border: 0; background: none;
  color: var(--pk-tint); font: 400 17px var(--sans); z-index: 3; }

/* Android: a Material top app bar — flat at rest, tinted surface once content scrolls under it */
html.pk-and .top { background: var(--pk-m3-surface) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  border-bottom: 0 !important; box-shadow: none !important; transition: background-color .2s linear; }
html.pk-and.pk-scrolled .top { background: var(--pk-m3-c) !important; }
html.pk-and .top .ttl h1 { font-size: 24px; letter-spacing: .02em; }
html.pk-and .top label.search, html.pk-and .top #hard-refresh { width: 48px !important; min-width: 48px; height: 48px !important; flex: 0 0 48px !important; padding: 0 !important;
  border-radius: 50% !important; display: inline-flex !important; align-items: center; justify-content: center; background: transparent !important; border: 0 !important; box-shadow: none !important; color: var(--pk-m3-onv) !important; overflow: hidden; }
html.pk-and .top label.search input, html.pk-and .top label.search kbd { width: 0 !important; min-width: 0 !important; padding: 0 !important; opacity: 0; border: 0 !important; }
html.pk-and .top:has(#q:focus) label.search { position: absolute; left: 8px; right: 96px; bottom: calc((var(--top) - 48px) / 2); width: auto !important; flex: none !important;
  border-radius: 28px !important; padding: 0 16px !important; justify-content: flex-start; gap: 12px; background: var(--pk-m3-ch) !important; z-index: 3; }
html.pk-and .top:has(#q:focus) label.search input { width: 100% !important; opacity: 1; font-size: 16px !important; background: transparent !important; box-shadow: none !important; outline: 0; }
html.pk-and .top:has(#q:focus) :is(.ttl, .newwrap, .who) { opacity: 0; pointer-events: none; }
html.pk-and .pk-cancel { position: absolute; right: 8px; bottom: calc((var(--top) - 40px) / 2); height: 40px; padding: 0 12px; border: 0; border-radius: 20px; background: none;
  color: var(--red); font: 500 14px/1 var(--sans); letter-spacing: .01em; z-index: 3; }
/* New becomes the Material floating action button, bottom right above the nav bar */
html.pk-and:not(.ntabs) .top .newwrap { position: fixed; right: 16px; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); z-index: 31; }
html.pk-and .top #newbtn { width: 56px !important; height: 56px !important; min-width: 56px; padding: 0 !important; border-radius: 16px !important; border: 0 !important;
  display: inline-flex !important; align-items: center; justify-content: center; background: var(--red) !important; color: #fff !important;
  box-shadow: 0 3px 6px rgba(0,0,0,.18), 0 6px 14px -4px rgba(0,0,0,.28) !important; }
html.pk-and .top #newbtn span { display: none !important; }
html.pk-and:not(.ntabs) .top .newmenu { top: auto !important; bottom: 66px; right: 0; transform-origin: 100% 100%; }

/* ================================================================ menus (the New menu) */
html.pk-ios .top .newmenu { border-radius: 22px !important; padding: 6px !important; border: 0 !important;
  background: var(--pk-glass) !important; -webkit-backdrop-filter: blur(30px) saturate(1.9); backdrop-filter: blur(30px) saturate(1.9);
  box-shadow: inset 0 1px 0 var(--pk-glass-hi), inset 0 0 0 .5px var(--pk-glass-edge), 0 24px 60px -16px rgba(0,0,0,.55) !important;
  transform-origin: calc(100% - 20px) 0; }
html.pk-ios .top .newmenu:not([hidden]) { animation: pk-menu .42s var(--pk-spring) both; }
html.pk-ios .top .newmenu button { border-radius: 14px !important; }
@keyframes pk-menu { from { opacity: 0; transform: scale(.4); filter: blur(4px); } 60% { opacity: 1; filter: none; } to { opacity: 1; transform: none; } }
html.pk-and .top .newmenu { border-radius: 16px !important; padding: 8px 0 !important; border: 0 !important; background: var(--pk-m3-ch) !important;
  box-shadow: 0 2px 6px rgba(0,0,0,.2), 0 8px 24px -6px rgba(0,0,0,.3) !important; }
html.pk-and .top .newmenu:not([hidden]) { animation: pk-m3menu .28s var(--pk-m3) both; }
html.pk-and .top .newmenu button { border-radius: 0 !important; }
@keyframes pk-m3menu { from { opacity: 0; transform: scaleY(.6) translateY(12px); } to { opacity: 1; transform: none; } }

/* ================================================================ sliding segmented controls (iOS) */
html.pk-ios :is(.pk-seg, #_) { position: relative; isolation: isolate; }
html.pk-ios :is(.pk-seg, #_) > .pk-thumb { display: block; position: absolute; left: 0; top: 0; z-index: 0; pointer-events: none; will-change: transform, width; }
html.pk-ios :is(.pk-seg, #_) > :is(a, button) { position: relative; z-index: 1; }
html.pk-ios :is(.pk-seg, #_) > .on { background: transparent !important; box-shadow: none !important; transition: color .2s .06s !important; }
/* a tap you can see: the label gives a little under the finger */
html.pk-ios :is(.pk-seg, #_) > :is(a, button):active { transform: scale(.94); transition: transform .08s !important; }
html.pk-ios :is(.pk-seg, #_) > :is(a, button) { transition: transform .45s var(--pk-spring), color .2s !important; }

/* Android: Material segmented buttons / tabs — the pick fills with the secondary container */
html.pk-and :is(.seg, .hubseg, nav.tabs, .subnav, #_) > .on { background: var(--pk-m3-sec) !important; color: var(--pk-m3-onsec) !important; box-shadow: none !important; }
html.pk-and :is(.seg, .hubseg, nav.tabs, .subnav, #_) { border-radius: 20px !important; box-shadow: inset 0 0 0 1px var(--pk-m3-outline) !important; background: transparent !important; }
html.pk-and :is(.seg, .hubseg, nav.tabs, .subnav, #_) > :is(a, button) { border-radius: 16px !important; font-weight: 500 !important; letter-spacing: .01em; }

/* ================================================================ press states */
/* Scott: cards shrinking under the finger made scrolling feel "clunky and hard to move" (iOS fires :active as soon as a finger lands,
   even to scroll). Only buttons react now: a quick dim, the way UIKit buttons do. Cards and rows don't move. */
html.pk-ios :is(.btn, .chip-btn, .newmenu button, .pk-sheet button):active { opacity: .55; transition: opacity 0s; }
html.pk-ios :is(.btn, .chip-btn, .newmenu button, .pk-sheet button) { transition: opacity .2s; }
html.pk-ios .top :is(#newbtn, label.search, #hard-refresh):active { opacity: 1; transform: scale(1.08); transition: transform .12s; }
/* Android: ripples (the JS adds .pk-rip) */
.pk-rip { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; pointer-events: none; z-index: 2; }
.pk-rip > i { position: absolute; border-radius: 50%; background: currentColor; opacity: 0; pointer-events: none; }

/* ================================================================ the web bottom bar (browsers, build 2, Android — the iOS app draws its own) */
/* iOS: deeper Liquid Glass + the sliding lens (the thumb code runs on #pill-bar too) */
html.pk-ios:not(.ntabs) .pnav .bar { background: color-mix(in srgb, var(--paper) 52%, transparent) !important;
  -webkit-backdrop-filter: blur(24px) saturate(1.9) brightness(1.05); backdrop-filter: blur(24px) saturate(1.9) brightness(1.05);
  box-shadow: inset 0 1px 0 var(--pk-glass-hi), inset 0 0 0 .5px var(--pk-glass-edge), 0 18px 40px -14px rgba(0,0,0,.6) !important; }
html.pk-ios:not(.ntabs) .pnav .bar :is(a, button) { color: var(--mute) !important; }
html.pk-ios:not(.ntabs) .pnav .bar a.on { color: var(--red) !important; }
html.pk-ios:not(.ntabs) .pnav .bar > .pk-thumb { box-shadow: inset 0 1px 0 rgba(255,255,255,.16) !important; }

/* Android: the Material 3 navigation bar — full width, the active indicator pill behind the icon */
html.pk-and:not(.ntabs) .pnav { left: 0 !important; right: 0 !important; bottom: 0 !important; width: auto !important; transform: none !important; }
html.pk-and:not(.ntabs) .pnav .bar { height: calc(80px + env(safe-area-inset-bottom, 0px)) !important; padding: 12px 0 calc(16px + env(safe-area-inset-bottom, 0px)) !important; border-radius: 0 !important;
  background: var(--pk-m3-c) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; box-shadow: none !important; gap: 0; }
html.pk-and:not(.ntabs) .pnav .bar :is(a, button) { justify-content: flex-start !important; gap: 4px !important; background: transparent !important; border-radius: 0 !important;
  color: var(--pk-m3-onv) !important; font: 500 12px/16px var(--sans) !important; letter-spacing: .5px; overflow: visible; }
html.pk-and:not(.ntabs) .pnav .bar :is(a, button) > :first-child { position: relative; z-index: 1; display: grid; place-items: center; width: 64px; height: 32px; }
html.pk-and:not(.ntabs) .pnav .bar :is(a, button)::before { content: ''; position: absolute; top: 0; left: 50%; width: 64px; height: 32px; margin-left: -32px; border-radius: 16px;
  background: var(--pk-m3-sec); transform: scaleX(.4); opacity: 0; transition: transform .35s var(--pk-m3), opacity .15s; z-index: 0; }
html.pk-and:not(.ntabs) .pnav .bar a.on::before { transform: none; opacity: 1; }
html.pk-and:not(.ntabs) .pnav .bar a.on { color: var(--pk-m3-on) !important; font-weight: 700 !important; }
html.pk-and:not(.ntabs) .pnav .bar a.on > :first-child { color: var(--pk-m3-onsec); }
html.pk-and:not(.ntabs) .pnav .bar .n { top: -2px !important; right: calc(50% - 26px) !important; z-index: 2; }
html.pk-and:not(.ntabs) .pnav.open .bar #pill-more { background: transparent !important; color: var(--pk-m3-on) !important; }
html.pk-and:not(.ntabs) .pnav.open .bar #pill-more::before { transform: none; opacity: 1; }
html.pk-and:not(.ntabs) .pnav .fan { bottom: calc(92px + env(safe-area-inset-bottom, 0px)) !important; right: 12px !important; }
html.pk-and:not(.ntabs) .pnav .fan :is(a, button) { border-radius: 16px !important; background: var(--pk-m3-ch) !important; box-shadow: 0 2px 6px rgba(0,0,0,.18), 0 6px 18px -6px rgba(0,0,0,.3) !important; font-weight: 500 !important; }
html.pk-and:not(.ntabs) .content { padding-bottom: calc(172px + env(safe-area-inset-bottom, 0px)) !important; }   /* the nav bar + the New button */

/* ================================================================ push / pop */
.pk-stage { position: fixed; left: 0; right: 0; bottom: 0; overflow: hidden; pointer-events: none; contain: strict; }
.pk-stage.pk-under { z-index: 14; } .pk-stage.pk-over { z-index: 19; }
.pk-layer { position: absolute; left: 0; width: 100%; height: calc(100% + 400px); will-change: transform; }
.pk-dim { position: absolute; inset: 0; background: rgba(0,0,0,.22); opacity: 0; }
[data-theme=dark] .pk-dim { background: rgba(0,0,0,.42); }
.pk-under .pk-layer { z-index: 0; } .pk-under .pk-dim { z-index: 1; }
.pk-over .pk-dim { z-index: 0; } .pk-over .pk-layer { z-index: 1; }
html.pk-sliding #content { position: relative; z-index: 16; min-height: calc(100vh - var(--pk-ct, 0px)); }
/* a screen parked off the right edge must not widen the page (iOS would zoom out to fit it) */
html.pk-sliding .main, html.pk-drawer .main { overflow-x: clip; }
html.pk-sliding .content.vin { animation: none !important; }
/* whichever screen is on top while it slides carries its own paper + topo, lined up with the page's, so nothing shows through */
:is(#content, .pk-layer).pk-sheetbg { background: var(--paper); box-shadow: -14px 0 34px -6px rgba(0,0,0,.4); }
#content.pk-sheetbg::before { content: ''; position: absolute; left: 0; top: calc(-1 * var(--pk-ct, 0px)); width: 100vw; height: 100vh; z-index: -1; pointer-events: none;
  background: var(--topo-ink); -webkit-mask: var(--topo, none) center / cover no-repeat; mask: var(--topo, none) center / cover no-repeat; }
.pk-layer.pk-sheetbg::before { content: ''; position: absolute; left: 0; top: 0; width: 100vw; height: 100vh; pointer-events: none;
  background: var(--topo-ink); -webkit-mask: var(--topo, none) center / cover no-repeat; mask: var(--topo, none) center / cover no-repeat; }
.pk-ghost { pointer-events: none !important; }
.pk-ghost * { animation: none !important; }

/* ================================================================ the drawer (an order, a build …) is a pushed screen */
/* iOS: the page underneath eases back and the drawer's ✕ becomes the round glass back chevron */
html.pk-ios .drawer { transition: transform .34s var(--pk-ease) !important; box-shadow: -12px 0 40px -8px rgba(0,0,0,.45); }
html.pk .drawer.pk-instant { transition: none !important; }
html.pk-ios .drawer .dhead { background: color-mix(in srgb, var(--card) 72%, transparent) !important; -webkit-backdrop-filter: blur(20px) saturate(1.8); backdrop-filter: blur(20px) saturate(1.8); }
html.pk-ios #dclose { width: 40px !important; height: 40px !important; padding: 0 !important; border-radius: 50% !important; border: 0 !important; display: inline-flex !important; align-items: center; justify-content: center;
  background: var(--pk-glass) !important; color: var(--text) !important; -webkit-backdrop-filter: var(--pk-blur); backdrop-filter: var(--pk-blur);
  box-shadow: inset 0 1px 0 var(--pk-glass-hi), inset 0 0 0 .5px var(--pk-glass-edge), var(--pk-glass-sh) !important; }
html.pk-ios #dclose packard-icon { display: none; }
html.pk-ios #dclose::before { content: ''; width: 22px; height: 22px; margin-left: -2px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E") center / contain no-repeat; }
/* Android: the drawer rises as a full-screen dialog with Material motion */
html.pk-and .drawer { transform: translateY(24px) !important; opacity: 0; visibility: hidden; transition: transform .3s var(--pk-m3), opacity .2s linear, visibility 0s .3s !important; }
html.pk-and .drawer.open { transform: none !important; opacity: 1; visibility: visible; transition: transform .3s var(--pk-m3), opacity .2s linear, visibility 0s !important; }
html.pk-and .drawer .dhead { background: var(--pk-m3-surface) !important; border-bottom: 0 !important; }
html.pk-and .drawer .dfoot { background: var(--pk-m3-c) !important; border-top: 0 !important; }

/* ================================================================ threads */

/* ================================================================ pull to refresh */
html.pk .pk-ptr { display: grid; place-items: center; position: fixed; left: 50%; z-index: 19; width: 38px; height: 38px; margin-top: -38px; border-radius: 50%;
  opacity: 0; pointer-events: none; transform: translateX(-50%); transition: opacity .2s, transform .35s var(--pk-ease); color: var(--mute); }
html.pk .pk-ptr.pulling { transition: none; }
html.pk .pk-ptr svg { width: 22px; height: 22px; }
html.pk .pk-ptr circle { transition: stroke-dasharray .1s; }
html.pk .pk-ptr.armed { color: var(--text); }
html.pk .pk-ptr.spin svg { animation: pk-spin .75s linear infinite; }
html.pk-ios .pk-ptr { background: var(--pk-glass); -webkit-backdrop-filter: var(--pk-blur); backdrop-filter: var(--pk-blur); box-shadow: inset 0 1px 0 var(--pk-glass-hi), inset 0 0 0 .5px var(--pk-glass-edge), var(--pk-glass-sh); }
html.pk-and .pk-ptr { background: var(--pk-m3-ch); color: var(--red); box-shadow: 0 1px 3px rgba(0,0,0,.3), 0 4px 10px -2px rgba(0,0,0,.25); }
@keyframes pk-spin { to { transform: rotate(360deg); } }

/* ================================================================ toasts */
/* iOS: a glass capsule that drops from the top, the way system banners do */
html.pk-ios .toast { top: calc(10px + env(safe-area-inset-top, 0px)) !important; bottom: auto !important; transform: translate(-50%, -140%) scale(.92) !important;
  background: var(--pk-glass) !important; color: var(--text) !important; -webkit-backdrop-filter: blur(28px) saturate(1.9); backdrop-filter: blur(28px) saturate(1.9);
  box-shadow: inset 0 1px 0 var(--pk-glass-hi), inset 0 0 0 .5px var(--pk-glass-edge), 0 16px 40px -12px rgba(0,0,0,.55) !important;
  padding: 12px 20px !important; font: 600 15px/1.25 var(--sans) !important; width: max-content; text-align: center; transition: transform .5s var(--pk-spring), opacity .25s !important; z-index: 9100 !important; max-width: calc(100vw - 32px); }
html.pk-ios .toast.show { transform: translate(-50%, 0) scale(1) !important; }
html.pk-ios .toast.bad { color: #fff !important; background: color-mix(in srgb, var(--red) 88%, transparent) !important; }
/* Android: the Material snackbar — bottom, dark inverse surface, square-ish */
html.pk-and .toast { left: 12px !important; right: 12px !important; transform: translateY(16px) !important; border-radius: 6px !important; text-align: left;
  bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important; padding: 14px 16px !important; font: 400 14px/1.4 var(--sans) !important;
  background: #2F3033 !important; color: #F1F0F4 !important; box-shadow: 0 3px 8px rgba(0,0,0,.3) !important; transition: transform .25s var(--pk-m3), opacity .2s !important; }
[data-theme=dark] html.pk-and .toast, html.pk-and[data-theme=dark] .toast { background: #E4E2E6 !important; color: #303034 !important; }
html.pk-and .toast.show { transform: none !important; }
html.pk-and .toast.bad { background: #B3261E !important; color: #fff !important; }

/* ================================================================ sheets */
html.pk .wsh-card { position: relative; }
html.pk .wsh-card::before { content: ''; position: absolute; top: 6px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: rgba(127,127,127,.4); }
html.pk .wsh-h { padding-top: 18px !important; touch-action: none; }
html.pk .cnt-grab, html.pk .cnt-bar { touch-action: none; }
html.pk-ios .cnt-sheet, html.pk-ios .wsh-card { border-radius: 28px 28px 0 0 !important; }
html.pk-and .cnt-sheet, html.pk-and .wsh-card { border-radius: 28px 28px 0 0 !important; background: var(--pk-m3-c) !important; }

/* the kit's own sheet: iOS action sheet in glass / Material bottom sheet */
.pk-sheet { position: fixed; inset: 0; z-index: 9200; }
.pk-veil { position: absolute; inset: 0; background: rgba(0,0,0,.42); opacity: 0; transition: opacity .3s; }
.pk-sheet.show .pk-veil { opacity: 1; }
.pk-card { position: absolute; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); max-height: 86vh; overflow: auto; padding: 8px 16px 14px; border-radius: 34px;
  transform: translateY(110%); transition: transform .48s var(--pk-ease); touch-action: pan-y; color: var(--text); font-family: var(--sans); }
.pk-sheet.show .pk-card { transform: none; }
html.pk-ios .pk-card, html:not(.pk-and) .pk-card { background: var(--pk-glass); -webkit-backdrop-filter: blur(34px) saturate(1.9); backdrop-filter: blur(34px) saturate(1.9);
  box-shadow: inset 0 1px 0 var(--pk-glass-hi), inset 0 0 0 .5px var(--pk-glass-edge), 0 30px 70px -20px rgba(0,0,0,.6); }
html.pk-and .pk-card { left: 0; right: 0; bottom: 0; border-radius: 28px 28px 0 0; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); background: var(--pk-m3-c); transition-timing-function: var(--pk-m3); }
.pk-grab { width: 36px; height: 5px; border-radius: 3px; background: rgba(127,127,127,.45); margin: 2px auto 10px; }
html.pk-and .pk-grab { width: 32px; height: 4px; margin: 8px auto 14px; }
.pk-card header { padding: 2px 4px 12px; touch-action: none; }
.pk-card header b { display: block; font: 700 19px/1.2 var(--sans); }
.pk-card header small { display: block; margin-top: 4px; color: var(--mute); font-size: 13px; line-height: 1.4; }
.pk-label { margin: 14px 6px 6px; color: var(--mute); font: 600 12px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; }
.pk-group { border-radius: 16px; overflow: hidden; background: color-mix(in srgb, var(--card) 70%, transparent); }
html.pk-and .pk-group { background: transparent; border-radius: 0; }
.pk-group button { display: flex; align-items: center; width: 100%; min-height: 54px; gap: 12px; padding: 10px 16px; border: 0; background: none; color: var(--text); text-align: left; font: inherit; position: relative; }
.pk-group button + button { box-shadow: inset 0 .5px 0 rgba(127,127,127,.28); }
html.pk-and .pk-group button + button { box-shadow: none; }
.pk-group button span { flex: 1; } .pk-group b { display: block; font-size: 16px; font-weight: 600; } .pk-group small { display: block; color: var(--mute); font-size: 13px; margin-top: 1px; }
.pk-check { width: 22px; height: 22px; flex: none; opacity: 0; background: var(--pk-tint);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5 10 17 19 7'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5 10 17 19 7'/%3E%3C/svg%3E") center / contain no-repeat; }
.pk-group button.sel .pk-check { opacity: 1; }
html.pk-and .pk-group button.sel { background: var(--pk-m3-sec); color: var(--pk-m3-onsec); border-radius: 28px; }
html.pk-and .pk-check { background: currentColor; }
.pk-done { display: block; width: 100%; height: 54px; margin-top: 12px; border: 0; border-radius: 16px; background: color-mix(in srgb, var(--card) 80%, transparent); color: var(--pk-tint); font: 600 17px var(--sans); }
html.pk-and .pk-done { border-radius: 20px; height: 40px; width: auto; padding: 0 24px; margin: 16px 0 0 auto; background: var(--red); color: #fff; font: 500 14px var(--sans); }

/* ================================================================ calm */
@media (prefers-reduced-motion: reduce) {
  html.pk :is(.top, #content, .drawer, .pk-card, .toast) { transition: none !important; }
  html.pk .top .newmenu { animation: none !important; }
}
}

/* ================================================================ the app's own top bar (build 4, html.nbar — set by native.js) */
/* Not part of the kit switch: whenever the app draws the bar, the page hides its header and shows the big title instead. The bar's
   height is already in env(safe-area-inset-top) (the app adds it to the web view's safe area), so everything that left room for
   the status bar now leaves room for the bar too. */
.nbar-title, .nbar-probe, #nbar-cancel { display: none; }
.nbar-probe { position: fixed; top: 0; left: 0; width: 0; height: env(safe-area-inset-top, 0px); pointer-events: none; visibility: hidden; }
html.nbar .nbar-probe { display: block; }
@media (max-width: 900px) {
  html.nbar { --top: 0px; }
  html.nbar .top { display: none !important; }
  html.nbar .nbar-title { display: block; padding: calc(env(safe-area-inset-top, 0px) + 2px) 20px 2px; font: 700 34px/1.15 var(--disp); letter-spacing: .02em;
    text-transform: uppercase; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html.nbar.nbar-fit .nbar-title { display: none; }
  html.nbar #content .pback { display: none !important; }      /* the bar has the back button */
  /* search: a row under the bar, with Cancel */
  html.nbar.nbar-search .top { display: flex !important; position: fixed; left: 0; right: 0; top: env(safe-area-inset-top, 0px); height: 60px !important; padding: 8px 12px !important;
    gap: 10px; align-items: center; z-index: 45; background: color-mix(in srgb, var(--paper) 82%, transparent) !important;
    -webkit-backdrop-filter: blur(20px) saturate(1.8) !important; backdrop-filter: blur(20px) saturate(1.8) !important; border: 0 !important; }
  html.nbar.nbar-search .top > :not(label.search):not(#nbar-cancel) { display: none !important; }
  html.nbar.nbar-search .top label.search { display: flex !important; position: static !important; flex: 1 1 auto !important; width: auto !important; height: 44px !important;
    border-radius: 22px !important; padding: 0 14px !important; gap: 8px !important; justify-content: flex-start !important; margin: 0 !important; }
  html.nbar.nbar-search .top label.search input { width: 100% !important; opacity: 1 !important; font-size: 17px !important; background: transparent !important; box-shadow: none !important; outline: 0; }
  html.nbar.nbar-search .top label.search kbd { display: none !important; }
  html.nbar.nbar-search #nbar-cancel { display: block; order: 9; flex: none; height: 44px; padding: 0 4px; border: 0; background: none; color: var(--pk-tint); font: 400 17px -apple-system, system-ui, sans-serif; }
}
@media (max-width: 900px) {
  html.pk-ios #dactions .pk-share { width: 40px !important; height: 40px !important; padding: 0 !important; border-radius: 50% !important; border: 0 !important; display: inline-flex !important; align-items: center; justify-content: center;
    background: var(--pk-glass) !important; color: var(--text) !important; -webkit-backdrop-filter: var(--pk-blur); backdrop-filter: var(--pk-blur);
    box-shadow: inset 0 1px 0 var(--pk-glass-hi), inset 0 0 0 .5px var(--pk-glass-edge), var(--pk-glass-sh) !important; }
  html.pk-and #dactions .pk-share { width: 48px !important; height: 48px !important; padding: 0 !important; border-radius: 50% !important; border: 0 !important; background: transparent !important; color: var(--pk-m3-onv) !important; }
}
