/* ===== shared components (js/ui-kit.js) ===== */
.app-host { position: absolute; inset: 0; overflow: hidden; }
.ios-scrim { position: absolute; inset: 0; z-index: 40; background: rgba(0,0,0,.38); opacity: 0; touch-action: none; }
.ios-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 41; border-radius: 34px 34px 0 0; padding-bottom: var(--sab); touch-action: none;
  max-height: calc(var(--H) - var(--sat) - 12px); display: flex; flex-direction: column; will-change: transform; }
.ios-sheet.dark { background: rgba(28,28,30,.97); color: #fff; }
.ios-sheet.light { background: rgba(250,250,252,.98); color: #000; }
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .ios-sheet.dark { background: rgba(30,30,32,.86); -webkit-backdrop-filter: blur(30px) saturate(1.6); backdrop-filter: blur(30px) saturate(1.6); }
}
.ios-sheet .grab { display: flex; justify-content: center; padding: 7px 0 6px; flex: none; }
.ios-sheet .grab i { width: 36px; height: 5px; border-radius: 3px; background: rgba(127,127,127,.5); }
.ios-sheet .sheet-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ios-sheet .sheet-scroll { overflow-y: auto; touch-action: pan-y; overscroll-behavior: contain; }

.ios-alert { position: absolute; left: 50%; top: 50%; z-index: 42; width: min(300px, calc(var(--W) - 60px)); border-radius: 30px; padding: 20px 18px 16px; text-align: center; color: #fff;
  background: rgba(44,44,48,.84); -webkit-backdrop-filter: blur(30px) saturate(1.8); backdrop-filter: blur(30px) saturate(1.8); box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.alert-scrim { background: rgba(0,0,0,.28); }
.al-t { font-size: 17px; font-weight: 700; line-height: 1.3; }
.al-m { font-size: 14px; line-height: 1.4; margin-top: 6px; color: rgba(235,235,245,.85); }
.al-btns { display: flex; gap: 10px; margin-top: 18px; }
.al-btns.stack { flex-direction: column; }
.al-btns button { flex: 1; height: 46px; border-radius: 23px; background: rgba(120,120,128,.3); font-size: 17px; font-weight: 600; color: #fff; }
.al-btns button.cancel { font-weight: 500; }
.al-btns button.destructive { color: #ff453a; }
.al-btns button.primary { background: #0a84ff; color: #fff; }
.al-btns button.pressed { filter: brightness(1.3); }

.ios-asheet { position: absolute; left: 8px; right: 8px; bottom: calc(var(--sab) + 4px); z-index: 42; display: grid; gap: 8px; will-change: transform; }
.as-group, .as-cancel { border-radius: 26px; overflow: hidden; background: rgba(44,44,48,.88); -webkit-backdrop-filter: blur(30px) saturate(1.8); backdrop-filter: blur(30px) saturate(1.8); }
.as-head { padding: 14px 16px 12px; text-align: center; font-size: 13px; color: rgba(235,235,245,.62); display: grid; gap: 3px; border-bottom: .5px solid rgba(255,255,255,.12); }
.as-head b { font-size: 13.5px; color: rgba(235,235,245,.75); }
.as-group button { display: block; width: 100%; height: 56px; font-size: 19px; color: #0a84ff; }
.as-group button + button { border-top: .5px solid rgba(255,255,255,.12); }
.as-group button.destructive { color: #ff453a; }
.as-cancel { height: 56px; font-size: 19px; font-weight: 600; color: #0a84ff; }
.ios-asheet button.pressed { background: rgba(255,255,255,.1); }

.ios-hud { position: absolute; left: 50%; top: 50%; z-index: 45; min-width: 136px; max-width: 210px; padding: 20px 18px 16px; border-radius: 18px; display: grid; justify-items: center; gap: 10px;
  text-align: center; pointer-events: none; color: #fff; background: rgba(40,40,44,.84); -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6); }
.ios-hud.light { background: rgba(245,245,247,.92); color: #111; }
.hud-ic { width: 38px; height: 38px; display: grid; place-items: center; }
.hud-ic svg { width: 36px; height: 36px; stroke-width: 2.2; }
.hud-spin { width: 30px; height: 30px; border-radius: 50%; border: 3px solid rgba(255,255,255,.22); border-top-color: #fff; animation: spin .8s linear infinite; }
.ios-hud.light .hud-spin { border-color: rgba(0,0,0,.15); border-top-color: #111; }
.hud-t { font-size: 15px; font-weight: 600; line-height: 1.3; }

.ios-sw { position: relative; display: inline-block; width: 51px; height: 31px; flex: none; }
.ios-sw input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; z-index: 2; cursor: pointer; }
.ios-sw .tr { position: absolute; inset: 0; border-radius: 16px; background: rgba(120,120,128,.32); transition: background .25s; }
.ios-sw .th { position: absolute; top: 2px; right: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.16); transition: transform .28s cubic-bezier(.25,.9,.3,1); }
.ios-sw.on .tr { background: var(--sw-on, #34c759); }
.ios-sw.on .th { transform: translateX(-20px); }
.ios-sw input:disabled + .tr { opacity: .5; }
@keyframes spin { to { transform: rotate(360deg); } }

/* scripted chats: tapping the locked text field points at the ready messages (one soft lift, no bounce) */
.chips-nudge { animation: chips-nudge .5s cubic-bezier(.25, 1, .5, 1); }
@keyframes chips-nudge { 0% { transform: none; } 35% { transform: translateY(-4px) scale(1.03); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .chips-nudge { animation: none; } }
