:root {
  --pc-a: #5aa9ff;           /* PiCloud's own colours — the apps' exit transitions end on these */
  --pc-b: #a78bfa;
  --sky-top: #eaf6ff;
  --sky-bottom: #f1e6ff;
  --ink: #2c2c54;
  --ink-soft: #6b6b8d;
  --card: #ffffffcc;
  --border: #dcdcf3;
  --mint: #06d6a0;
  --coral: #ff6b6b;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
[data-theme="dark"] {
  --sky-top: #0e1226;
  --sky-bottom: #1b1442;
  --ink: #eceaff;
  --ink-soft: #a3a3cc;
  --card: #1f1f3fcc;
  --border: #36365f;
  --mint: #3ddc97;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100svh;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom)) fixed;
  overflow-x: hidden;
  position: relative;
  transition: background .4s;
}
button { font: inherit; color: inherit; }

/* Icons are Lucide (lucide.dev, ISC), inlined as an SVG sprite by the server. */
.icon { width: 1em; height: 1em; font-size: 20px; display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* ---- Sky: drifting clouds + rising mini bubbles ---- */
.sky { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.cloud { position: absolute; background: #fff; border-radius: 999px; opacity: .55; animation: drift linear infinite; }
.cloud::before, .cloud::after { content: ''; position: absolute; background: inherit; border-radius: 50%; }
[data-theme="dark"] .cloud { opacity: .07; }
.cloud--a { width: 150px; height: 48px; top: 10%; left: -20%; animation-duration: 70s; }
.cloud--a::before { width: 72px; height: 72px; top: -36px; left: 20px; }
.cloud--a::after { width: 52px; height: 52px; top: -22px; left: 84px; }
.cloud--b { width: 100px; height: 34px; top: 30%; left: -15%; animation-duration: 52s; animation-delay: -12s; }
.cloud--b::before { width: 52px; height: 52px; top: -26px; left: 12px; }
.cloud--b::after { width: 36px; height: 36px; top: -16px; left: 56px; }
.cloud--c { width: 190px; height: 58px; top: 64%; left: -25%; animation-duration: 90s; animation-delay: -30s; }
.cloud--c::before { width: 92px; height: 92px; top: -46px; left: 26px; }
.cloud--c::after { width: 66px; height: 66px; top: -30px; left: 106px; }
.cloud--d { width: 120px; height: 40px; top: 82%; left: -18%; animation-duration: 60s; animation-delay: -6s; }
.cloud--d::before { width: 58px; height: 58px; top: -28px; left: 14px; }
.cloud--d::after { width: 42px; height: 42px; top: -18px; left: 68px; }
@keyframes drift { to { transform: translateX(calc(100vw + 400px)); } }

.ambient { position: absolute; inset: 0; }
.mini {
  position: absolute; bottom: -60px; border-radius: 50%; pointer-events: auto; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .5);
  background: radial-gradient(circle at 30% 28%, rgba(255, 255, 255, .7), rgba(255, 255, 255, .08) 55%, transparent 72%);
  animation: miniRise var(--d) linear var(--delay) infinite;
}
[data-theme="dark"] .mini { border-color: rgba(190, 200, 255, .35); }
@keyframes miniRise {
  0% { transform: translate(0, 0); opacity: 0; }
  10% { opacity: 1; }
  50% { transform: translate(var(--sway), calc(-55vh - 30px)); }
  90% { opacity: 1; }
  100% { transform: translate(calc(var(--sway) * -1), calc(-110vh - 60px)); opacity: 0; }
}
.mini.pop { animation: none; transition: transform .25s ease-out, opacity .25s; transform: scale(1.7); opacity: 0; }

/* ---- Header / footer / theme toggle ---- */
.top { position: relative; z-index: 2; text-align: center; padding: max(34px, env(safe-area-inset-top)) 20px 0; pointer-events: none; }
.brand { display: inline-flex; align-items: center; gap: 12px; pointer-events: auto; }
.brand__badge {
  width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--pc-a), var(--pc-b));
  box-shadow: 0 8px 22px color-mix(in srgb, var(--pc-a) 45%, transparent);
  animation: bob 3.4s ease-in-out infinite; cursor: pointer;
}
.brand__badge .icon { font-size: 26px; fill: rgba(255, 255, 255, .25); }
.brand__badge.boing { animation: boing .6s var(--spring); }
.brand__title { margin: 0; font-size: clamp(30px, 6vw, 40px); font-weight: 800; letter-spacing: -.02em; }
.brand__title span { background: linear-gradient(90deg, var(--pc-a), var(--pc-b)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.top__tag { margin: 8px 0 0; color: var(--ink-soft); font-size: 15px; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-5px) rotate(3deg); } }
@keyframes boing { 0% { transform: scale(1); } 30% { transform: scale(1.3) rotate(-10deg); } 60% { transform: scale(.92) rotate(5deg); } 100% { transform: scale(1); } }

.theme {
  position: fixed; top: max(16px, env(safe-area-inset-top)); right: 16px; z-index: 5;
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: var(--card);
  backdrop-filter: blur(8px); display: grid; place-items: center; cursor: pointer; color: var(--ink);
  transition: transform .3s var(--spring), opacity .4s, filter .4s;
}
.theme:hover { transform: rotate(25deg) scale(1.08); }
.theme:active { transform: scale(.9); }
.theme .icon--sun { display: none; }
[data-theme="dark"] .theme .icon--sun { display: inline-block; }
[data-theme="dark"] .theme .icon--moon { display: none; }

.foot { position: relative; z-index: 2; display: flex; justify-content: center; padding: 8px 20px max(28px, env(safe-area-inset-bottom)); }
.status {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: var(--card); border: 1px solid var(--border); backdrop-filter: blur(8px); color: var(--ink-soft);
  transition: color .3s, border-color .3s;
}
.status.up { color: var(--mint); }
.status.some { color: #f0b429; }
.status.down { color: var(--coral); }
.status .icon { font-size: 17px; }
.status.busy .icon { animation: spin 1s linear infinite; }
.status.flash { animation: statusPop .5s var(--spring); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes statusPop { 0% { transform: scale(.85); } 100% { transform: scale(1); } }

/* ---- Stage + bubbles ---- */
.stage { position: relative; z-index: 1; min-height: calc(100svh - 190px); pointer-events: none; }
.bubble {
  position: absolute; left: 0; top: 0; width: var(--size); height: var(--size);
  pointer-events: auto; color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent;
  will-change: transform; outline: none; opacity: 0;
}
.bubble.in { opacity: 1; }
.bubble__jelly { position: absolute; inset: 0; will-change: transform; }
.bubble__body { position: absolute; inset: 0; transition: transform .4s var(--spring), filter .3s; }
.bubble:hover .bubble__body, .bubble:focus-visible .bubble__body { transform: scale(1.07); }
.bubble:active .bubble__body { transform: scale(.94); transition-duration: .12s; }
.bubble:focus-visible .bubble__shell { box-shadow: 0 0 0 3px var(--pc-a), 0 18px 50px color-mix(in srgb, var(--a) 35%, transparent); }

.bubble__shell {
  position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(circle at var(--hx, 30%) var(--hy, 24%), rgba(255, 255, 255, .85) 0, rgba(255, 255, 255, .2) 11%, transparent 26%),
    radial-gradient(circle at 50% 52%, transparent 58%, color-mix(in srgb, var(--a) 26%, transparent) 80%, color-mix(in srgb, var(--b) 50%, transparent) 100%),
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--a) 9%, transparent), color-mix(in srgb, var(--b) 15%, transparent));
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, .4),
    inset 0 -16px 30px color-mix(in srgb, var(--b) 28%, transparent),
    inset 0 12px 26px rgba(255, 255, 255, .16),
    0 20px 54px color-mix(in srgb, var(--a) 30%, transparent);
  backdrop-filter: blur(3px);
  transition: box-shadow .3s;
}
.bubble:hover .bubble__shell { box-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, .55), inset 0 -16px 30px color-mix(in srgb, var(--b) 35%, transparent),
    inset 0 12px 26px rgba(255, 255, 255, .2), 0 24px 70px color-mix(in srgb, var(--a) 48%, transparent); }
.bubble__disc {
  position: absolute; left: 50%; top: 50%; width: 52%; height: 52%; margin: -26% 0 0 -26%; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(145deg, var(--a), var(--b));
  box-shadow: 0 10px 26px color-mix(in srgb, var(--a) 50%, transparent), inset 0 2px 0 rgba(255, 255, 255, .4);
}
.bubble__disc .icon { width: 46%; height: 46%; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .18)); transition: transform .5s var(--spring); }
.bubble:hover .bubble__disc .icon { transform: scale(1.18) rotate(-8deg); }
.bubble__dot {
  position: absolute; right: 19%; bottom: 19%; width: 15px; height: 15px; border-radius: 50%;
  background: var(--dot, #8c8ca8); border: 2.5px solid var(--sky-bottom); transition: background .4s;
}
.bubble[data-status="up"] { --dot: var(--mint); }
.bubble[data-status="up"] .bubble__dot::after {
  content: ''; position: absolute; inset: -2.5px; border-radius: 50%; border: 2px solid var(--mint); animation: ping 2.2s ease-out infinite;
}
.bubble[data-status="down"] { --dot: var(--coral); }
.bubble[data-status="down"] .bubble__body { filter: saturate(.55); }
@keyframes ping { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(2.6); opacity: 0; } }

.bubble__label { position: absolute; left: 50%; top: 100%; width: 240px; margin: 6px 0 0 -120px; text-align: center; pointer-events: none; }
.bubble__name { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.bubble__tag { font-size: 13px; color: var(--ink-soft); margin-top: 2px; opacity: 0; transform: translateY(-4px); transition: opacity .3s, transform .3s var(--ease); }
.bubble:hover .bubble__tag, .bubble:focus-visible .bubble__tag { opacity: 1; transform: none; }
@media (hover: none) { .bubble__tag { opacity: 1; transform: none; } }

.bubble--ghost .bubble__shell { background: radial-gradient(circle at 30% 24%, rgba(255,255,255,.35) 0, transparent 22%); box-shadow: inset 0 0 0 2px var(--border); border: 2px dashed var(--border); backdrop-filter: none; }
.bubble--ghost { cursor: default; }
.bubble--ghost .bubble__disc { background: none; box-shadow: none; color: var(--ink-soft); opacity: .7; }
.bubble--ghost .bubble__name { color: var(--ink-soft); }
.bubble--ghost .bubble__tag { opacity: 1; transform: none; }
.bubble--ghost:hover .bubble__disc .icon { transform: rotate(90deg) scale(1.15); }

/* ---- Launch transition ---- */
.top, .foot, .theme { transition: opacity .45s, filter .45s, transform .45s var(--ease); }
body.launching .top, body.launching .foot, body.launching .theme { opacity: 0; filter: blur(8px); pointer-events: none; }
body.launching .top { transform: translateY(-24px); }
body.launching .foot { transform: translateY(24px); }
body.launching .bubble { pointer-events: none; }
body.launching .bubble:not(.is-hero) { transition: opacity .5s, filter .5s; opacity: 0; filter: blur(10px); }
body.launching .bubble:not(.is-hero) .bubble__body { transform: scale(.6); }
.bubble.is-hero { visibility: hidden; }
body.launching .mini { opacity: 0 !important; transition: opacity .4s; }

.fx { position: fixed; inset: 0; z-index: 100; overflow: hidden; pointer-events: all; }
.fx__veil { position: absolute; inset: 0; opacity: 0; background: radial-gradient(circle at 50% 50%, rgba(8, 10, 28, .35), rgba(8, 10, 28, .75)); backdrop-filter: blur(6px); }
.fx__grad { position: absolute; inset: 0; opacity: 0; background: linear-gradient(180deg, var(--a), var(--b)); }
.fx__lines { position: absolute; inset: 0; overflow: hidden; }
.fx__lines i { position: absolute; border-radius: 99px; background: linear-gradient(to top, transparent, #fff); }
.fx__lines--down i { background: linear-gradient(to bottom, transparent, #fff); }
.hero { position: absolute; left: 50%; top: 50%; width: var(--size); height: var(--size); margin: calc(var(--size) / -2) 0 0 calc(var(--size) / -2); will-change: transform; }
.hero .bubble__shell, .hero .bubble__disc { position: absolute; }
.fx__ring { position: absolute; left: 50%; top: 50%; border-radius: 50%; border: 3px solid #fff; opacity: 0; }
.fx__drop { position: absolute; left: 50%; top: 50%; border-radius: 50%; opacity: 0; background: radial-gradient(circle at 30% 30%, #fff, var(--b) 70%); box-shadow: 0 0 10px var(--a); }
.fx__flash { position: absolute; inset: 0; background: #fff; opacity: 0; }

/* Arrival cover: painted from the very first frame when we come from an app. */
.cover { position: fixed; inset: 0; z-index: 200; display: none; overflow: hidden; background: linear-gradient(180deg, var(--pc-a), var(--pc-b)); }
.arriving .cover { display: block; }
.cover .fx__lines { z-index: 1; }
.cover__cloud { position: absolute; left: 50%; top: 50%; width: 92px; height: 92px; margin: -46px 0 0 -46px; color: #fff; filter: drop-shadow(0 6px 10px #0006); will-change: transform; z-index: 2; }
.cover__cloud svg { width: 100%; height: 100%; fill: #fff; stroke: #fff; stroke-width: 1.5; stroke-linejoin: round; }
.arriving .brand__badge { opacity: 0; }

.toast {
  position: fixed; left: 50%; bottom: max(84px, calc(env(safe-area-inset-bottom) + 70px)); z-index: 50; transform: translate(-50%, 30px); opacity: 0;
  padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 14px; pointer-events: none;
  background: var(--card); border: 1px solid var(--border); backdrop-filter: blur(10px); box-shadow: 0 8px 30px rgba(0, 0, 0, .18);
  transition: opacity .3s, transform .4s var(--spring);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .mini, .cloud { display: none; }
}

button.bubble { background: none; border: 0; padding: 0; font: inherit; }
.hero .bubble__disc { box-shadow: 0 0 0 6px rgba(255, 255, 255, .3), 0 22px 44px rgba(0, 0, 0, .35), inset 0 2px 0 rgba(255, 255, 255, .45); }

/* Arrival from PiDrive: its logo-click exit ends on the page's sky with the brand centred
   under faint indigo streaks, so that's the frame we start from. */
.arriving-drive .cover { background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom)); }
.cover__brand { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; white-space: nowrap; z-index: 2; }
.cover__emoji { font-size: 52px; line-height: 1.2; }
.cover__brand h2 { margin: 6px 0 2px; font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.cover__brand h2 span { color: #8285ff; }
.cover__brand p { margin: 8px 0 0; font-size: 15px; font-weight: 700; color: var(--ink-soft); }
.cover__brand p strong { color: #8285ff; }
.cover__streaks { position: absolute; inset: 0; z-index: 1; overflow: hidden; }
.cover__streaks span { position: absolute; top: -30%; width: 2px; height: 36%; border-radius: 2px; background: linear-gradient(180deg, transparent, rgba(130, 133, 255, .35), transparent); opacity: 0; }

/* ---- Sign-in (one login shared by every PiCloud site) ---- */
.foot { gap: 10px; flex-wrap: wrap; }
.authbtn { cursor: pointer; font-family: inherit; transition: transform .25s var(--spring), color .3s, border-color .3s; }
.authbtn:hover { transform: translateY(-2px); color: var(--ink); border-color: var(--pc-a); }
.authbtn:active { transform: scale(.94); }
.authbtn.in { color: var(--mint); }

.bubble__lock {
  position: absolute; right: 17%; top: 17%; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--border); backdrop-filter: blur(6px); color: var(--ink-soft);
  transition: color .3s, background .3s;
}
.bubble__lock .icon { position: absolute; font-size: 15px; transition: transform .5s var(--spring), opacity .25s; }
.bubble__lock .icon--open { opacity: 0; transform: scale(.3) rotate(-40deg); }
body[data-authed="true"] .bubble__lock { color: var(--mint); }
body[data-authed="true"] .bubble__lock .icon--closed { opacity: 0; transform: scale(.3) rotate(40deg); }
body[data-authed="true"] .bubble__lock .icon--open { opacity: 1; transform: none; }
.bubble__lock.pop { animation: lockPop .7s var(--spring); }
@keyframes lockPop { 0% { transform: scale(1); } 35% { transform: scale(1.6) rotate(-12deg); } 100% { transform: scale(1); } }

.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(8, 10, 28, .5); backdrop-filter: blur(8px); animation: fadeIn .25s; }
.modal.closing { animation: fadeIn .2s reverse forwards; }
.modal__card {
  position: relative; width: min(360px, 100%); padding: 30px 26px 24px; text-align: center; border-radius: 26px;
  background: var(--card); border: 1px solid var(--border); backdrop-filter: blur(14px); box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
  animation: cardIn .5s var(--spring);
}
.modal.closing .modal__card { animation: cardOut .2s ease-in forwards; }
.modal__card.shake { animation: shake .4s; }
.modal__card h2 { margin: 12px 0 4px; font-size: 22px; }
.modal__card p { margin: 0 0 18px; color: var(--ink-soft); font-size: 14px; }
.modal__close { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: none; cursor: pointer; color: var(--ink-soft); display: grid; place-items: center; transition: transform .3s var(--spring), color .2s; }
.modal__close:hover { color: var(--ink); transform: rotate(90deg); }
.modal__lock { width: 60px; height: 60px; margin: 0 auto; border-radius: 20px; display: grid; place-items: center; color: #fff; position: relative; background: linear-gradient(135deg, var(--pc-a), var(--pc-b)); box-shadow: 0 10px 26px color-mix(in srgb, var(--pc-a) 45%, transparent); animation: bob 3.4s ease-in-out infinite; }
.modal__lock .icon { position: absolute; font-size: 28px; transition: transform .5s var(--spring), opacity .25s; }
.modal__lock .icon--open { opacity: 0; transform: scale(.3) rotate(-40deg); }
.modal__lock.open { animation: boing .7s var(--spring); }
.modal__lock.open .icon--closed { opacity: 0; transform: scale(.3) rotate(40deg); }
.modal__lock.open .icon--open { opacity: 1; transform: none; }
.modal input { width: 100%; padding: 14px 16px; font: inherit; font-size: 17px; text-align: center; letter-spacing: .12em; border-radius: 14px; border: 2px solid var(--border); background: transparent; color: var(--ink); outline: none; transition: border-color .2s, box-shadow .2s; }
.modal input:focus { border-color: var(--pc-a); box-shadow: 0 0 0 4px color-mix(in srgb, var(--pc-a) 22%, transparent); }
.modal__error { min-height: 22px; margin: 8px 0 2px; color: var(--coral); font-size: 14px; }
.modal__go { width: 100%; padding: 13px; border: 0; border-radius: 14px; cursor: pointer; font: inherit; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--pc-a), var(--pc-b)); box-shadow: 0 8px 22px color-mix(in srgb, var(--pc-a) 40%, transparent); transition: transform .25s var(--spring), filter .2s; }
.modal__go:hover { transform: translateY(-2px); filter: brightness(1.08); }
.modal__go:active { transform: scale(.97); }
.modal__go:disabled { opacity: .6; cursor: wait; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes cardIn { from { opacity: 0; transform: translateY(30px) scale(.9); } }
@keyframes cardOut { to { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-8px); } 40%, 60% { transform: translateX(8px); } }
body.launching .modal { display: none; }

/* ---- passkeys: the Face ID-style face ---- */
.modal__alt { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 10px; padding: 11px; border: 0; border-radius: 14px; background: none; color: var(--ink-soft); font: inherit; font-weight: 600; cursor: pointer; transition: color .2s, background .2s; }
.modal__alt:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent); }
.modal__alt .icon { font-size: 18px; }
.passcard { text-align: center; }
.face { width: 108px; height: 108px; margin: 4px auto 6px; color: var(--pc-a); position: relative; }
.face svg { width: 100%; height: 100%; overflow: visible; }
.face__feat { color: var(--ink); transform-box: view-box; transform-origin: 50px 50px; animation: face-look 6.5s ease-in-out infinite; }
.face__eye { transform-box: fill-box; transform-origin: center; animation: face-blink 6.5s ease-in-out infinite; }
.face__scan, .face__check { opacity: 0; fill: currentColor; }
.face__check { fill: none; stroke-dasharray: 60; stroke-dashoffset: 60; }
.face__corners { transform-box: view-box; transform-origin: 50px 50px; transition: color .3s, transform .5s cubic-bezier(.34, 1.56, .64, 1); }
/* looking around: left, right, up, back to centre, with the head turning a touch */
@keyframes face-look {
  0%, 8% { transform: translate(0, 0) rotate(0); }
  20% { transform: translate(-7px, 1px) rotate(-5deg); }
  34%, 40% { transform: translate(-7px, 1px) rotate(-5deg); }
  52% { transform: translate(7px, 0) rotate(5deg); }
  64%, 68% { transform: translate(7px, 0) rotate(5deg); }
  78% { transform: translate(0, -6px) rotate(0); }
  90%, 100% { transform: translate(0, 0) rotate(0); }
}
@keyframes face-blink { 0%, 44%, 48%, 100% { transform: scaleY(1); } 46% { transform: scaleY(.1); } 80%, 84% { transform: scaleY(1); } 82% { transform: scaleY(.1); } }
/* scanning: the face settles and a scan line sweeps down and up while the corners pulse */
.face[data-state="scan"] .face__feat { animation: none; transition: transform .4s; transform: none; }
.face[data-state="scan"] .face__eye { animation: none; }
.face[data-state="scan"] .face__scan { opacity: .85; animation: face-scan 1.4s ease-in-out infinite; }
.face[data-state="scan"] .face__corners { animation: face-pulse 1.4s ease-in-out infinite; }
@keyframes face-scan { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(62px); } }
@keyframes face-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(.92); } }
/* success: features give way to a tick, corners flash in the accent colour */
.face[data-state="ok"] { color: var(--mint); }
.face[data-state="ok"] .face__feat { opacity: 0; animation: none; transition: opacity .25s; }
.face[data-state="ok"] .face__check { opacity: 1; animation: face-tick .55s .15s ease-out forwards; }
.face[data-state="ok"] .face__corners { transform: scale(1.06); }
@keyframes face-tick { to { stroke-dashoffset: 0; } }
.face[data-state="err"] { color: var(--coral); }
.face[data-state="err"] .face__feat { animation: none; }
@media (prefers-reduced-motion: reduce) { .face__feat, .face__eye, .face__scan, .face__corners { animation: none !important; } }
.passlist { list-style: none; margin: 0 0 12px; padding: 0; text-align: left; display: grid; gap: 8px; max-height: 190px; overflow: auto; }
.passlist li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); font-size: 14px; }
.passlist .pl__meta { flex: 1; min-width: 0; }
.passlist .pl__name { font-weight: 700; }
.passlist .pl__sub { color: var(--ink-soft); font-size: 12px; }
.passlist button { border: 0; background: none; color: var(--ink-soft); cursor: pointer; padding: 6px; border-radius: 8px; display: grid; place-items: center; }
.passlist button:hover { color: var(--coral); }
.passcard .modal__error { min-height: 22px; }

.policy { display: flex; align-items: center; gap: 14px; margin: 0 0 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); text-align: left; }
.policy__txt { flex: 1; min-width: 0; display: grid; gap: 3px; font-size: 14px; }
.policy__txt span { color: var(--ink-soft); font-size: 12px; line-height: 1.35; }
.policy__switch { position: relative; flex: none; width: 50px; height: 30px; border-radius: 999px; border: 0; cursor: pointer; background: color-mix(in srgb, var(--ink) 22%, transparent); transition: background .3s; }
.policy__switch i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); transition: transform .35s var(--spring); }
.policy__switch[aria-checked="true"] { background: linear-gradient(135deg, var(--pc-a), var(--pc-b)); }
.policy__switch[aria-checked="true"] i { transform: translateX(20px); }
.policy__switch:disabled { opacity: .5; cursor: not-allowed; }
