/* ==========================================================================
   Traveler dashboard (Batch 2)
   Mobile-first app shell · Home · Wallet passport · Documents · Profile
   ========================================================================== */
body.is-app .site-header,
body.is-app .site-footer,
body.is-app .skip-link { display: none; }
body.is-app { background: var(--cream); }
body.is-app #main { animation: none; }

/* ================================================================ Shell */
.app-stage { position: relative; min-height: 100svh; overflow: clip; }
.app-stage > .blob { display: none; }
.app-frame {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column;
  background: var(--cream);
}
.app-view {
  flex: 1;
  display: flex; flex-direction: column; gap: 1.75rem;
  padding: max(env(safe-area-inset-top), 0.75rem) 1.1rem 1.5rem;
  animation: view-in 600ms var(--ease-out);
}
.app-view > section { display: grid; gap: 0.85rem; }
@keyframes view-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.app-note { text-align: center; font-size: var(--fs-xs); color: var(--muted); padding-bottom: 0.5rem; }

.sec-head { display: flex; justify-content: space-between; align-items: baseline; }
.sec-head h2 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.035em; }
.sec-head__link { display: inline-flex; align-items: center; gap: 0.2rem; font-size: var(--fs-sm); font-weight: 600; }
.sec-head__link svg { width: 15px; height: 15px; }
.sec-head__hint { font-size: var(--fs-xs); color: var(--muted); font-weight: 500; }

/* Top bar */
.atop { display: flex; align-items: center; gap: 0.75rem; min-height: 52px; }
.atop__me, .atop__back {
  width: 44px; height: 44px; flex: none; border-radius: 50%; overflow: hidden;
  box-shadow: 0 0 0 2px var(--cream), 0 0 0 3px var(--line-strong);
}
.atop__back { display: grid; place-items: center; background: var(--white); box-shadow: inset 0 0 0 1px var(--line); }
.atop__back svg { width: 18px; height: 18px; }
.atop__me .portrait { width: 100%; height: 100%; }
.atop__title { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.03em; }
.atop__loc {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 0.35rem;
  height: 36px; padding: 0 0.85rem; border-radius: var(--r-pill);
  background: var(--white); box-shadow: inset 0 0 0 1px var(--line);
  font-size: var(--fs-sm); font-weight: 600;
}
.atop__loc svg { width: 14px; height: 14px; }

/* Portrait + scene base */
.portrait { display: block; width: 100%; height: 100%; }
.scene { display: block; width: 100%; height: 100%; }

/* Bottom navigation: floating black dock */
.bnav {
  position: sticky; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  margin: 0 0.75rem calc(0.75rem + env(safe-area-inset-bottom));
  padding: 6px;
  border-radius: 26px;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 18px 40px -12px rgba(60, 35, 20, 0.5);
}
.bnav__item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 56px; border-radius: 20px;
  color: rgba(251, 243, 235, 0.6);
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.01em;
  transition: background var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
}
.bnav__ic svg { width: 22px; height: 22px; transition: transform var(--dur-2) var(--ease-spring); }
.bnav__item:hover { color: var(--cream); }
.bnav__item[aria-current="page"] { background: var(--mint); color: var(--black); }
.bnav__item[aria-current="page"] svg { transform: translateY(-1px) scale(1.06); }
.bnav__item:active svg { transform: scale(0.9); }

/* ================================================================ Home */
.hello { gap: 0.25rem !important; padding-top: 0.5rem; }
.hello__kicker { font-family: var(--font-serif); font-style: italic; font-size: 1.6rem; line-height: 1; color: var(--ink-2); }
.hello__name { font-size: clamp(3.6rem, 18vw, 5rem); font-weight: 700; letter-spacing: -0.065em; line-height: 0.88; }
.hello__name .serif { color: var(--peach-deep); }
.hello__sub { color: var(--ink-2); max-width: 32ch; margin-top: 0.5rem; }
.hello__sub b { font-variant-numeric: tabular-nums; }

.dest {
  position: relative; overflow: hidden; isolation: isolate;
  height: 300px; border-radius: var(--r-xl) !important;
  display: flex !important; flex-direction: column; justify-content: space-between;
  padding: 1rem;
  box-shadow: var(--shadow-md);
}
.dest__scene { position: absolute; inset: 0; z-index: -2; transform: scale(1.06); transition: transform 1.6s var(--ease-out); }
.dest:hover .dest__scene { transform: scale(1.1); }
.dest__shade { position: absolute; inset: 40% 0 0; z-index: -1; background: linear-gradient(transparent, rgba(251, 243, 235, 0.9)); }
.dest__top { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.tag--glass { background: rgba(255, 255, 255, 0.6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.tag--glass svg { width: 14px; height: 14px; }
.dest__city { font-size: 2.3rem; font-weight: 700; letter-spacing: -0.055em; line-height: 0.95; margin-top: 0.2rem; }
.dest__city .serif { font-size: 0.8em; }
.dest__chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; margin-top: 0.85rem; }
.dest__chips span {
  display: grid; padding: 0.55rem 0.7rem; border-radius: 16px;
  background: rgba(255, 255, 255, 0.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.dest__chips small { font-size: 0.68rem; color: var(--muted); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.dest__chips b { font-size: 1rem; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* Emergency help: the loudest element on the screen */
.sos {
  display: flex; align-items: center; gap: 0.9rem;
  width: 100%; padding: 0.85rem 0.85rem 0.85rem 0.85rem;
  border-radius: 26px;
  background: var(--alert); color: var(--cream);
  text-align: left;
  box-shadow: 0 16px 30px -14px rgba(168, 67, 42, 0.8);
  transition: transform var(--dur-2) var(--ease-out);
}
.sos:active { transform: scale(0.98); }
.sos__pulse {
  position: relative; display: grid; place-items: center; flex: none;
  width: 54px; height: 54px; border-radius: 50%; background: var(--cream); color: var(--alert);
}
.sos__pulse::before, .sos__pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--cream);
  animation: pulse-ring 2.4s var(--ease-out) infinite;
}
.sos__pulse::after { animation-delay: 1.2s; }
.sos__pulse svg { width: 26px; height: 26px; }
.sos__txt { display: grid; flex: 1; line-height: 1.25; }
.sos__txt b { font-size: 1.2rem; letter-spacing: -0.03em; }
.sos__txt small { opacity: 0.8; font-size: 0.8rem; }
.sos__go { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(251, 243, 235, 0.18); flex: none; }
.sos__go svg { width: 18px; height: 18px; }

.fab-sos {
  position: sticky; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 30;
  align-self: flex-end; margin-top: -3.5rem;
  display: inline-flex; align-items: center; gap: 0.4rem;
  height: 52px; padding: 0 1.1rem 0 0.9rem; border-radius: var(--r-pill);
  background: var(--alert); color: var(--cream); font-weight: 700; letter-spacing: 0.04em;
  box-shadow: 0 14px 30px -10px rgba(168, 67, 42, 0.8);
  opacity: 0; translate: 0 20px; pointer-events: none;
  transition: opacity var(--dur-2) var(--ease-out), translate var(--dur-2) var(--ease-spring);
}
.fab-sos svg { width: 22px; height: 22px; }
.fab-sos.is-in { opacity: 1; translate: 0 0; pointer-events: auto; }

/* Passport card */
.pcard {
  --rx: 0deg; --ry: 0deg; --gx: 30%; --gy: 20%;
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; gap: 1.1rem;
  padding: 1.15rem;
  border-radius: 28px;
  background:
    radial-gradient(90% 70% at 100% 0%, rgba(231, 196, 177, 0.35), transparent 60%),
    radial-gradient(70% 60% at 0% 100%, rgba(193, 222, 186, 0.18), transparent 60%),
    linear-gradient(160deg, #1b1b1b, #000 70%);
  color: var(--cream);
  box-shadow: var(--shadow-lg);
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 500ms var(--ease-out);
}
.pcard::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--grain); opacity: 0.45; mix-blend-mode: overlay; }
.pcard__sheen { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(35% 45% at var(--gx) var(--gy), rgba(231, 196, 177, 0.28), transparent 70%); mix-blend-mode: screen; }
.pcard__top { display: flex; justify-content: space-between; align-items: center; }
.pcard__brand { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--peach); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.pcard__brand svg { width: 18px; height: 18px; }
.pcard__flag { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; padding: 0.3rem 0.6rem; border-radius: var(--r-pill); background: rgba(251, 243, 235, 0.1); }
.pcard__mid { display: flex; gap: 1rem; align-items: center; }
.pcard__photo { width: 74px; height: 92px; flex: none; border-radius: 16px; overflow: hidden; box-shadow: 0 0 0 1px rgba(251, 243, 235, 0.2); }
.pcard__name { font-family: var(--font-serif); font-style: italic; font-size: 1.9rem; line-height: 0.95; letter-spacing: -0.02em; }
.pcard__id { margin-top: 0.5rem; font-size: 0.78rem; letter-spacing: 0.12em; color: rgba(251, 243, 235, 0.6); font-variant-numeric: tabular-nums; }
.pcard__fields { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 0.5rem; align-items: end; padding-top: 0.9rem; border-top: 1px solid rgba(251, 243, 235, 0.14); }
.pcard__fields span { display: block; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(251, 243, 235, 0.55); }
.pcard__fields b { font-size: 1.25rem; letter-spacing: -0.03em; }
.pcard__open { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--peach); color: var(--black); transition: rotate var(--dur-2) var(--ease-out); }
.pcard__open svg { width: 18px; height: 18px; }
.pcard:hover .pcard__open { rotate: -45deg; }

/* Medical summary rail */
.wrail {
  display: grid; grid-auto-flow: column; grid-auto-columns: 152px; gap: 0.6rem;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  margin-inline: -1.1rem; padding: 0.25rem 1.1rem 0.75rem;
}
.wrail::-webkit-scrollbar { display: none; }
.wtile {
  scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem;
  min-height: 176px; padding: 1rem; border-radius: 24px;
  background: var(--white); text-align: left;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-2) var(--ease-spring), box-shadow var(--dur-2) var(--ease-out);
}
.wtile:hover { transform: translateY(-4px) rotate(-1deg); box-shadow: var(--shadow-md); }
.wtile:active { transform: scale(0.97); }
.wtile__ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: rgba(255, 255, 255, 0.6); margin-bottom: auto; }
.wtile__ic svg { width: 18px; height: 18px; }
.wtile .label { opacity: 0.6; font-size: 0.66rem; margin-top: 1rem; }
.wtile b { font-size: 1.12rem; letter-spacing: -0.035em; line-height: 1.1; }
.wtile small { font-size: 0.78rem; color: var(--ink-2); }
.wtile__huge { font-size: 2.8rem !important; letter-spacing: -0.06em !important; line-height: 0.9 !important; }
.wtile--alert { background: #F3D9CE; }
.wtile--alert b { color: var(--alert); }
.wtile--alert .wtile__ic { color: var(--alert); }
.wtile--peach { background: var(--peach); }
.wtile--mint { background: var(--mint); }
.wtile--black { background: var(--black); color: var(--cream); }
.wtile--black .wtile__ic { background: rgba(251, 243, 235, 0.12); }

/* Insurance */
.ins { display: grid; gap: 0.9rem; padding: 1.1rem; border-radius: 26px; background: var(--white); box-shadow: var(--shadow-sm); }
.ins__top { display: flex; align-items: center; gap: 0.75rem; }
.ins__top b { display: block; letter-spacing: -0.025em; line-height: 1.2; }
.ins__top small { color: var(--muted); font-size: var(--fs-sm); }
.ins__logo { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--mint); flex: none; }
.ins__logo svg { width: 22px; height: 22px; }
.ins__status { margin-left: auto; display: inline-flex; align-items: center; gap: 0.4rem; font-size: var(--fs-xs); font-weight: 700; padding: 0.35rem 0.65rem; border-radius: var(--r-pill); background: var(--mint-soft); }
.ins__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin: 0; }
.ins__grid div { padding: 0.7rem 0.8rem; border-radius: 16px; background: var(--cream); }
.ins__grid dt { font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.ins__grid dd { margin: 0; font-weight: 700; letter-spacing: -0.02em; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.ins__near {
  display: flex; align-items: center; gap: 0.75rem; text-align: left;
  padding: 0.8rem; border-radius: 18px; background: var(--peach-soft);
  transition: background var(--dur-1);
}
.ins__near:hover { background: var(--peach); }
.ins__near > svg { width: 20px; height: 20px; flex: none; }
.ins__near span { flex: 1; display: grid; line-height: 1.25; }
.ins__near b { letter-spacing: -0.02em; font-size: 0.95rem; }
.ins__near small { font-size: 0.78rem; color: var(--ink-2); }

/* Quick access */
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.quick__tile {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem;
  min-height: 150px; padding: 1rem; border-radius: 24px; text-align: left;
  transition: transform var(--dur-2) var(--ease-spring);
}
.quick__tile:hover { transform: translateY(-3px); }
.quick__tile:active { transform: scale(0.97); }
.quick__tile > svg { width: 24px; height: 24px; margin-bottom: auto; }
.quick__tile b { font-size: 1.1rem; letter-spacing: -0.035em; margin-top: 1.5rem; }
.quick__tile small { font-size: 0.78rem; opacity: 0.7; }
.quick__tile--cream { background: var(--white); box-shadow: var(--shadow-sm); }
.quick__tile--mint { background: var(--mint); }
.quick__tile--black { background: var(--black); color: var(--cream); }
.quick__tile--peach { background: var(--peach); }
.quick__stack { position: absolute; right: -14px; top: 14px; width: 60px; height: 70px; }
.quick__stack i { position: absolute; inset: 0; border-radius: 10px; background: var(--cream-2); box-shadow: var(--shadow-sm); }
.quick__stack i:nth-child(1) { rotate: 14deg; background: var(--peach); }
.quick__stack i:nth-child(2) { rotate: 6deg; background: var(--mint); }
.quick__stack i:nth-child(3) { rotate: -3deg; background: var(--cream); }
.quick__lang { font-family: var(--font-serif); font-style: italic; font-size: 0.9rem; opacity: 0.75; margin-top: 0.35rem; }
.quick__qr { width: 46px; margin-bottom: auto; }

/* ================================================================ Sheets */
.sheet-layer { position: fixed; inset: 0; z-index: 300; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.42); opacity: 0; transition: opacity 400ms var(--ease-out); backdrop-filter: blur(2px); }
.bsheet {
  position: absolute; left: 0; right: 0; bottom: 0; margin-inline: auto;
  width: 100%; max-width: 520px; max-height: 90svh; overflow-y: auto; overscroll-behavior: contain;
  border-radius: 32px 32px 0 0;
  background: var(--cream);
  padding: 0 1.1rem calc(1.5rem + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 520ms var(--ease-out);
  box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, 0.35);
}
.sheet-layer.is-open .sheet-backdrop { opacity: 1; }
.sheet-layer.is-open .bsheet { transform: translateY(0); }
.bsheet__grab { display: grid; place-items: center; height: 26px; cursor: grab; touch-action: none; position: sticky; top: 0; background: var(--cream); z-index: 2; }
.bsheet__grab span { width: 44px; height: 5px; border-radius: 4px; background: var(--line-strong); }
.bsheet__head { display: flex; justify-content: space-between; align-items: center; padding: 0.25rem 0 1rem; }
.bsheet__head h2 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.05em; }
.bsheet__x { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--white); box-shadow: inset 0 0 0 1px var(--line); }
.bsheet__x svg { width: 18px; height: 18px; }
.bsheet--alert .bsheet__head h2 { color: var(--alert); }

.details { display: grid; gap: 0.6rem; }
.detail { display: grid; gap: 0.3rem; padding: 1rem; border-radius: 20px; background: var(--white); }
.detail__head { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; }
.detail__head b { font-size: 1.1rem; letter-spacing: -0.03em; }
.detail p { color: var(--ink-2); }
.detail small { color: var(--muted); }
.detail--alert { background: #F3D9CE; }
.detail--alert b { color: var(--alert); }
.detail__dose { font-family: var(--font-serif); font-style: italic; font-size: 1.05rem; white-space: nowrap; }
.detail__times { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.detail__times span { padding: 0.25rem 0.6rem; border-radius: var(--r-pill); background: var(--mint); font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; }
.detail--big b { font-size: 4.5rem; letter-spacing: -0.07em; line-height: 0.9; }

/* Emergency sheet */
.sos-sheet { display: grid; gap: 0.6rem; }
.sos-sheet__num { display: flex; justify-content: space-between; align-items: flex-end; padding: 1.1rem; border-radius: 24px; background: var(--alert); color: var(--cream); }
.sos-sheet__num .label { max-width: 16ch; opacity: 0.85; }
.sos-sheet__num b { font-size: 4.5rem; line-height: 0.85; letter-spacing: -0.07em; }
.sos-sheet__call { --btn-bg: var(--black); }
.sos-sheet__card { display: grid; gap: 0.35rem; padding: 1rem; border-radius: 22px; background: var(--white); }
.sos-sheet__card .label { color: var(--muted); margin-bottom: 0.25rem; }
.sos-sheet__line { font-weight: 700; letter-spacing: -0.02em; font-size: 1.05rem; line-height: 1.3; }
.sos-sheet__line.is-alert { color: var(--alert); }
.sos-sheet__row {
  display: flex; align-items: center; gap: 0.8rem; width: 100%; text-align: left;
  padding: 0.85rem 0.9rem; border-radius: 20px; background: var(--white);
  transition: background var(--dur-1);
}
.sos-sheet__row:hover { background: var(--mint-soft); }
.sos-sheet__row > svg { width: 20px; height: 20px; flex: none; }
.sos-sheet__row > svg:last-child { width: 16px; height: 16px; opacity: 0.5; }
.sos-sheet__row span { flex: 1; display: grid; line-height: 1.25; }
.sos-sheet__row small { color: var(--muted); font-size: 0.8rem; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(104px + env(safe-area-inset-bottom)); z-index: 400;
  max-width: min(92vw, 420px); width: max-content;
  padding: 0.8rem 1.1rem; border-radius: 18px;
  background: var(--black); color: var(--cream); font-size: var(--fs-sm); font-weight: 500; line-height: 1.35;
  box-shadow: var(--shadow-md);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  transition: transform 450ms var(--ease-spring), opacity 300ms var(--ease-out);
}
.toast.is-in { transform: translate(-50%, 0); opacity: 1; }

/* ================================================================ Passport (wallet) */
.ptitle { display: flex !important; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.ptitle__h { font-size: clamp(3rem, 15vw, 4.2rem); font-weight: 700; letter-spacing: -0.065em; line-height: 0.86; }
.ptitle__h .serif { color: var(--peach-deep); }
.wallet-hint { display: flex; align-items: center; gap: 0.45rem; font-size: var(--fs-sm); color: var(--muted); margin-top: -0.75rem; }
.wallet-hint svg { width: 16px; height: 16px; }

.wallet-btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  height: 52px; padding: 0 1.1rem 0 0.8rem;
  border-radius: 14px; background: var(--black); color: var(--white);
  text-align: left; line-height: 1.05;
  transition: transform var(--dur-2) var(--ease-spring), background var(--dur-2);
}
.wallet-btn:hover { transform: translateY(-2px); }
.wallet-btn span { display: grid; font-weight: 600; font-size: 0.95rem; letter-spacing: -0.01em; }
.wallet-btn small { font-size: 0.62rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mint); }
.wallet-btn__ic { width: 28px; height: 22px; flex: none; }
.wallet-btn--block { width: 100%; justify-content: center; height: 56px; }
.wallet-btn.is-done { background: #2F5A2B; }

.wallet { position: relative; transition: height 600ms var(--ease-out); min-height: 400px; }
.wpass {
  --y: 0px; --s: 1;
  position: absolute; left: 0; right: 0; top: 0;
  z-index: calc(var(--i) + 1);
  border-radius: 24px;
  padding: 0 1.1rem 1.1rem;
  min-height: 228px;
  transform: translateY(var(--y)) scale(var(--s));
  transform-origin: 50% 0;
  transition: transform 700ms var(--ease-spring), box-shadow 400ms var(--ease-out), filter 400ms;
  box-shadow: 0 -2px 0 rgba(255, 255, 255, 0.35) inset, 0 -8px 24px -10px rgba(60, 35, 20, 0.35), 0 1px 0 rgba(0, 0, 0, 0.05);
  overflow: hidden; isolation: isolate;
  cursor: pointer;
}
.wpass::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--grain); opacity: 0.22; mix-blend-mode: multiply; pointer-events: none; }
.wpass.is-active { z-index: 20; cursor: default; box-shadow: var(--shadow-lg); }
.wpass.is-behind { filter: saturate(0.9) brightness(0.98); min-height: 0; max-height: 64px; }
.wpass { max-height: 1200px; transition-property: transform, box-shadow, filter, max-height; }
.wpass:not(.is-active) .wpass__body { pointer-events: none; }
.wpass__head {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  width: 100%; height: 64px; text-align: left;
}
.wpass__label { font-weight: 700; letter-spacing: -0.03em; font-size: 1.05rem; }
.wpass__meta { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.6; font-variant-numeric: tabular-nums; }
.wpass__body { display: grid; gap: 1rem; }
.wpass .label { display: block; font-size: 0.64rem; opacity: 0.6; margin-bottom: 0.15rem; }

.wpass--id { background: linear-gradient(160deg, #1d1d1d, #000 75%); color: var(--cream); }
.wpass--id::before { mix-blend-mode: overlay; opacity: 0.5; }
.wpass--id .wpass__label { color: var(--peach); font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: 1.3rem; }
.wpass--health { background: var(--peach); }
.wpass--ins { background: var(--mint); }
.wpass--contact { background: var(--warm-gray); }
.wpass--share { background: var(--white); }

.wid { display: flex; gap: 1rem; align-items: center; }
.wid__photo { width: 96px; height: 120px; border-radius: 18px; overflow: hidden; flex: none; box-shadow: 0 0 0 1px rgba(251, 243, 235, 0.2); }
.wid__who { display: grid; gap: 0.7rem; min-width: 0; }
.wid__name { font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: 1.7rem; line-height: 1; letter-spacing: -0.02em; }
.wid__row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.wid__row b, .wfields b { font-size: 0.95rem; letter-spacing: -0.02em; }
.wfields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; padding-top: 0.85rem; border-top: 1px solid currentColor; border-color: rgba(127, 127, 127, 0.25); }
.wfields b { display: block; line-height: 1.2; overflow-wrap: anywhere; }
.wmrz { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.66rem; letter-spacing: 0.12em; line-height: 1.5; color: rgba(251, 243, 235, 0.45); overflow: hidden; white-space: nowrap; }

.wlist { display: grid; gap: 0.35rem; }
.wlist__item { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 0.75rem; border-radius: 14px; background: rgba(255, 255, 255, 0.55); font-size: 0.9rem; }
.wlist__item b { letter-spacing: -0.02em; }
.wlist__item span { color: var(--ink-2); text-align: right; }
.wlist__item--alert { background: var(--cream); }
.wlist__item--alert b { color: var(--alert); }

.wins { display: flex; gap: 0.8rem; align-items: center; }
.wins__logo { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: var(--black); color: var(--mint); }
.wins__logo svg { width: 28px; height: 28px; }
.wins__plan { font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: 1.6rem; line-height: 1; }

.wcontact { display: flex; gap: 0.9rem; align-items: center; }
.wcontact__av { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--cream); font-weight: 700; font-size: 1.2rem; letter-spacing: -0.03em; }
.wcontact span { display: block; color: var(--ink-2); font-size: var(--fs-sm); margin-top: 0.3rem; }

.wbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 46px; padding: 0 1.1rem; border-radius: var(--r-pill);
  background: var(--black); color: var(--cream); font-weight: 600; font-size: 0.92rem;
  transition: transform var(--dur-2) var(--ease-spring);
}
.wbtn:active { transform: scale(0.97); }
.wbtn svg { width: 17px; height: 17px; }
.wbtn--line { background: transparent; color: var(--black); box-shadow: inset 0 0 0 1.5px var(--line-strong); }

.wshare { display: flex; gap: 1rem; align-items: center; }
.wshare__qr-wrap { position: relative; width: 132px; aspect-ratio: 1; flex: none; display: grid; place-items: center; }
.wshare__qr { width: 78%; padding: 6px; border-radius: 14px; background: var(--white); box-shadow: inset 0 0 0 1px var(--line); transition: filter 500ms, opacity 500ms; }
.wshare__qr.is-new { animation: qr-in 600ms var(--ease-spring); }
@keyframes qr-in { from { transform: scale(0.85) rotate(-4deg); opacity: 0; } to { transform: none; opacity: 1; } }
.wshare__ring { position: absolute; inset: 0; rotate: -90deg; }
.wshare__ring circle { fill: none; stroke: var(--gray-soft); stroke-width: 4; }
.wshare__ring [data-ring] { stroke: var(--mint-deep); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.wshare__info { display: grid; gap: 0.2rem; min-width: 0; }
.wshare__timer { font-size: 2rem; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; line-height: 1; }
.wshare__state { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--ink-2); margin-top: 0.35rem; line-height: 1.3; }
.wshare__state .dot-live { flex: none; }
.wpass--share.is-revoked .wshare__qr { filter: blur(5px) grayscale(1); opacity: 0.35; }
.wpass--share.is-revoked .wshare__state { color: var(--alert); }
.wshare__dur { width: 100%; justify-content: space-between; }
.wshare__dur button { flex: 1; padding: 0 0.6rem; }
.wshare__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }

.pfoot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem; }

/* Wallet pass preview */
.awallet { display: grid; gap: 1rem; }
.awallet__demo { display: flex; align-items: center; gap: 0.5rem; padding: 0.7rem 0.9rem; border-radius: 14px; background: var(--mint-soft); font-size: var(--fs-sm); font-weight: 600; }
.awallet__demo svg { width: 16px; height: 16px; flex: none; }
.awallet__note { font-size: var(--fs-sm); color: var(--muted); }
.apass {
  display: grid; gap: 1rem; padding: 1.1rem;
  border-radius: 20px; background: var(--peach);
  box-shadow: var(--shadow-lg);
  animation: pass-in 800ms var(--ease-spring) both 120ms;
}
@keyframes pass-in { from { transform: translateY(40px) rotateX(20deg); opacity: 0; } to { transform: none; opacity: 1; } }
.apass small { display: block; font-size: 0.62rem; letter-spacing: 0.1em; font-weight: 600; opacity: 0.6; }
.apass b { font-size: 1rem; letter-spacing: -0.02em; }
.apass__head { display: flex; justify-content: space-between; align-items: center; }
.apass__logo { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; letter-spacing: -0.03em; }
.apass__logo svg { width: 28px; height: 28px; }
.apass__hf { text-align: right; }
.apass__primary { display: flex; justify-content: space-between; align-items: center; }
.apass__primary b { font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: 1.8rem; line-height: 1; }
.apass__ph { width: 58px; height: 72px; border-radius: 12px; overflow: hidden; }
.apass__sec { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.apass__code { justify-self: center; display: grid; justify-items: center; gap: 0.4rem; width: 150px; padding: 0.7rem; border-radius: 12px; background: var(--white); }
.apass__code small { opacity: 0.55; letter-spacing: 0.02em; font-size: 0.66rem; }

/* ================================================================ Documents */
.dhead { gap: 0.6rem !important; }
.dhead__h { font-size: clamp(2.6rem, 12.5vw, 3.6rem); font-weight: 700; letter-spacing: -0.06em; line-height: 0.9; }
.dhead__h .serif { color: var(--mint-deep); }
.dhead__sub { color: var(--ink-2); }
.dhead__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-top: 0.5rem; }
.dact {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  height: 54px; border-radius: 18px; background: var(--white); font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-2) var(--ease-spring);
}
.dact:active { transform: scale(0.97); }
.dact svg { width: 20px; height: 20px; }
.dact--black { background: var(--black); color: var(--cream); }

.chips { display: flex; gap: 0.4rem; overflow-x: auto; scrollbar-width: none; margin-inline: -1.1rem; padding-inline: 1.1rem; }
.chips::-webkit-scrollbar { display: none; }
.chipf {
  flex: none; height: 40px; padding: 0 1rem; border-radius: var(--r-pill);
  box-shadow: inset 0 0 0 1.25px var(--line-strong); font-weight: 600; font-size: var(--fs-sm);
  transition: background var(--dur-2), color var(--dur-2), box-shadow var(--dur-2);
}
.chipf[aria-pressed="true"] { background: var(--black); color: var(--cream); box-shadow: none; }

.dlist { display: grid; gap: 0.55rem; }
.dlist li[hidden] { display: none; }
.dcard {
  display: flex; align-items: center; gap: 0.85rem; width: 100%; text-align: left;
  padding: 0.9rem; border-radius: 22px; background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-2) var(--ease-spring), box-shadow var(--dur-2);
}
.dcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.dcard:active { transform: scale(0.98); }
.dcard__ic { display: grid; place-items: center; width: 50px; height: 62px; border-radius: 14px; flex: none; }
.dcard__ic svg { width: 22px; height: 22px; }
.dcard--peach .dcard__ic { background: var(--peach); }
.dcard--mint .dcard__ic { background: var(--mint); }
.dcard--alert .dcard__ic { background: #F3D9CE; color: var(--alert); }
.dcard--gray .dcard__ic { background: var(--warm-gray); }
.dcard__txt { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.dcard__txt small { font-size: 0.72rem; color: var(--muted); font-weight: 600; letter-spacing: 0.02em; }
.dcard__txt b { letter-spacing: -0.03em; font-size: 1.05rem; }
.dcard__preview { font-size: 0.82rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dcard__langs { display: flex; flex-direction: column; gap: 3px; }
.dcard__langs i { font-style: normal; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.06em; padding: 2px 6px; border-radius: 6px; background: var(--cream); text-align: center; }
.dempty { text-align: center; color: var(--muted); padding: 2rem 0; }

.dsheet { display: grid; gap: 0.6rem; }
.dsheet__meta { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; font-size: var(--fs-sm); color: var(--muted); margin-bottom: 0.25rem; flex-wrap: wrap; }
.dsheet__orig, .dsheet__tr { display: grid; gap: 0.35rem; padding: 1rem; border-radius: 22px; }
.dsheet__orig { background: var(--warm-gray); }
.dsheet__tr { background: var(--white); }
.dsheet__trhead { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.25rem; }
.dsheet__trhead .segmented button { height: 34px; padding: 0 0.8rem; font-size: 0.8rem; }
.dsheet .label { color: var(--muted); }
.dsheet__swap { justify-self: center; display: grid; place-items: center; width: 40px; height: 40px; margin-block: -1.3rem; z-index: 1; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 5px var(--cream); }
.dsheet__swap svg { width: 18px; height: 18px; }
.dline { font-weight: 600; font-size: 1.08rem; letter-spacing: -0.02em; line-height: 1.35; padding: 0.4rem 0.5rem; margin-inline: -0.5rem; border-radius: 10px; transition: background var(--dur-2); }
.dline.is-alert { color: var(--alert); }
.dline.is-linked { background: rgba(193, 222, 186, 0.6); }
.dline.is-typing { animation: type-in 700ms var(--ease-out) both; animation-delay: calc(var(--i) * 110ms); }
.dsheet__note { display: flex; gap: 0.5rem; align-items: center; font-size: var(--fs-sm); color: var(--muted); margin-top: 0.4rem; }
.dsheet__note svg { width: 16px; height: 16px; flex: none; }
.dsheet__actions { margin-top: 0.4rem; }

/* ================================================================ Profile */
.me { display: flex !important; align-items: flex-end; gap: 1rem; }
.me__photo { width: 120px; height: 150px; border-radius: 28px; overflow: hidden; flex: none; box-shadow: var(--shadow-md); rotate: -3deg; }
.me__name { font-size: 2.6rem; font-weight: 700; letter-spacing: -0.06em; line-height: 0.88; }
.me__name .serif { color: var(--peach-deep); }
.me__txt p { margin-top: 0.6rem; font-size: var(--fs-sm); color: var(--muted); }

.tswitch { display: grid; gap: 0.5rem; }
.tswitch__item {
  display: flex; align-items: center; gap: 0.8rem; width: 100%; text-align: left;
  padding: 0.6rem; border-radius: 22px; background: var(--white);
  box-shadow: inset 0 0 0 1.5px transparent;
  transition: box-shadow var(--dur-2), background var(--dur-2), transform var(--dur-2) var(--ease-spring);
}
.tswitch__item:hover { transform: translateX(3px); }
.tswitch__item[aria-pressed="true"] { background: var(--mint); box-shadow: inset 0 0 0 1.5px var(--black); }
.tswitch__ph { width: 48px; height: 56px; border-radius: 14px; overflow: hidden; flex: none; }
.tswitch__txt { display: grid; line-height: 1.2; }
.tswitch__txt b { letter-spacing: -0.025em; }
.tswitch__txt small { color: var(--ink-2); font-size: 0.8rem; }

.plist { display: grid; margin: 0; padding: 0.25rem 1rem; border-radius: 22px; background: var(--white); }
.plist div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
.plist div:last-child { border-bottom: 0; }
.plist dt { color: var(--muted); font-size: var(--fs-sm); }
.plist dd { margin: 0; font-weight: 600; letter-spacing: -0.02em; text-align: right; }

.ptiles { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.ptile { display: flex; flex-direction: column; gap: 0.1rem; min-height: 150px; padding: 1rem; border-radius: 24px; }
.ptile svg { width: 22px; height: 22px; margin-bottom: auto; }
.ptile .label { opacity: 0.6; font-size: 0.64rem; margin-top: 1rem; }
.ptile b { font-size: 1.1rem; letter-spacing: -0.03em; line-height: 1.15; }
.ptile small { font-size: 0.8rem; opacity: 0.7; }
.ptile--mint { background: var(--mint); }
.ptile--peach { background: var(--peach); }

.settings { display: grid; padding: 0.25rem 1rem; border-radius: 22px; background: var(--white); }
.settings li + li { border-top: 1px solid var(--line); }
.toggle { display: flex; align-items: center; gap: 1rem; padding: 0.9rem 0; cursor: pointer; position: relative; }
.toggle__txt { flex: 1; display: grid; line-height: 1.3; }
.toggle__txt b { letter-spacing: -0.02em; font-size: 0.95rem; }
.toggle__txt small { color: var(--muted); font-size: 0.78rem; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle__ui { position: relative; width: 52px; height: 32px; flex: none; border-radius: 99px; background: var(--warm-gray); transition: background var(--dur-2); }
.toggle__ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: var(--white); box-shadow: var(--shadow-sm); transition: transform 400ms var(--ease-spring); }
.toggle input:checked + .toggle__ui { background: var(--black); }
.toggle input:checked + .toggle__ui::after { transform: translateX(20px); background: var(--mint); }
.toggle input:focus-visible + .toggle__ui { outline: 2px solid var(--black); outline-offset: 3px; }

.pexit { display: flex; align-items: center; justify-content: center; gap: 0.5rem; height: 52px; border-radius: 18px; box-shadow: inset 0 0 0 1.5px var(--line-strong); font-weight: 600; }
.pexit svg { width: 18px; height: 18px; }

/* ================================================================ Shared additions (Batch 3.5) */
.snav { display: none; }
.only-d { display: none; }
.atop__desk { display: none; }
.atop__ctx { margin-left: auto; display: flex; gap: 0.4rem; }
.atop__time { display: none; }
.atop__loc { margin-left: 0; }
.atop__time svg { width: 14px; height: 14px; }

/* Documents: tools, upload inputs, upload rows */
.dact { position: relative; cursor: pointer; }
.dact input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dact:focus-within { outline: 2px solid var(--black); outline-offset: 3px; }
.dtools { display: grid; gap: 0.6rem; }
.dsearch {
  display: flex; align-items: center; gap: 0.6rem;
  height: 50px; padding: 0 1rem; border-radius: 18px; background: var(--white);
  box-shadow: inset 0 0 0 1px var(--line);
}
.dsearch:focus-within { box-shadow: inset 0 0 0 2px var(--black); }
.dsearch svg { width: 18px; height: 18px; flex: none; opacity: 0.6; }
.dsearch input { flex: 1; min-width: 0; border: 0; background: none; font-size: 1rem; outline: none; height: 100%; }
.dtable-head, .dcard__type, .dcard__date, .dpane, .ddrop { display: none; }
.dlayout { display: block; }
.dlist li[hidden] { display: none !important; }
.dcard__langs i.is-new { background: var(--mint); }
.dcard.is-fresh { animation: up-in 700ms var(--ease-spring); box-shadow: inset 0 0 0 2px var(--mint-deep), var(--shadow-sm); }
.dcard.is-uploading { position: relative; overflow: hidden; animation: up-in 600ms var(--ease-spring); }
.dcard__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; }
.dcard__bar i { display: block; height: 100%; background: var(--black); transform-origin: left; animation: fill 1.1s var(--ease-in-out) both; }
.dcard--cream .dcard__ic { background: var(--cream-2); }
.dsheet__cols { display: grid; gap: 0.6rem; }
.ufile { display: flex; align-items: center; gap: 0.8rem; padding: 0.9rem; border-radius: 20px; background: var(--white); }
.ufile__ic { display: grid; place-items: center; width: 46px; height: 56px; border-radius: 14px; background: var(--mint); flex: none; }
.ufile__ic svg { width: 22px; height: 22px; }
.ufile span:last-child { display: grid; min-width: 0; line-height: 1.3; }
.ufile b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ufile small { color: var(--muted); }
.ufound { display: grid; gap: 0.35rem; padding: 1rem; border-radius: 20px; background: var(--white); }
.ufound .label { color: var(--muted); margin-bottom: 0.2rem; }
.ufound__row { display: grid; grid-template-columns: 20px 90px 1fr; align-items: center; gap: 0.5rem; padding: 0.45rem 0; border-top: 1px solid var(--line); }
.ufound__row svg { width: 16px; height: 16px; }
.ufound__row small { color: var(--muted); font-size: 0.75rem; }
.ufound__row b { letter-spacing: -0.02em; font-size: 0.95rem; }
.ufound__row.is-alert b, .ufound__row.is-alert svg { color: var(--alert); }
.unote { padding: 1rem; border-radius: 18px; background: var(--white); color: var(--ink-2); }

.wpass.is-spot { animation: spot 1.6s var(--ease-out) 2; }
@keyframes spot { 0%, 100% { box-shadow: var(--shadow-md); } 50% { box-shadow: 0 0 0 6px var(--mint), var(--shadow-lg); } }
@keyframes up-in { from { opacity: 0; transform: translateY(24px) scale(0.92) rotate(-2deg); } to { opacity: 1; transform: none; } }
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(0.92); } }

/* ================================================================ Tablet (600–959): mobile layout, comfortable measure */
@media (min-width: 600px) and (max-width: 959px) {
  .app-view { width: 100%; max-width: 680px; margin-inline: auto; padding-inline: 1.5rem; }
  .bnav { width: min(520px, calc(100% - 1.5rem)); margin-inline: auto; }
  .fab-sos { margin-right: max(0.75rem, calc((100vw - 680px) / 2)); }
  .wrail { grid-auto-columns: 180px; margin-inline: -1.5rem; padding-inline: 1.5rem; }
  .quick { grid-template-columns: repeat(4, 1fr); }
  .chips { margin-inline: -1.5rem; padding-inline: 1.5rem; }
}

/* ================================================================ Desktop (≥ 960): editorial dashboard */
@media (min-width: 960px) {
  .only-d { display: inline; }
  .only-m { display: none; }
  .bnav, .fab-sos { display: none; }

  .app-stage { display: grid; grid-template-columns: 264px minmax(0, 1fr); background: var(--cream); }
  .app-stage > .blob { display: block; position: fixed; }
  .app-frame { background: transparent; z-index: 1; min-width: 0; }
  .app-view { padding: 1.75rem clamp(1.5rem, 3vw, 3.5rem) 3rem; gap: 1.75rem; width: 100%; max-width: 1360px; margin-inline: auto; animation: view-in-d 600ms var(--ease-out); }

  /* Side navigation */
  .snav {
    position: sticky; top: 0; z-index: 30; align-self: start;
    display: flex; flex-direction: column; gap: 1.5rem;
    height: 100svh; padding: 1.75rem 1.25rem 1.5rem;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--line);
    overflow-y: auto;
  }
  .snav__brand { padding-left: 0.4rem; }
  .snav__nav { display: grid; gap: 4px; }
  .snav__item {
    display: flex; align-items: center; gap: 0.8rem;
    height: 50px; padding: 0 1rem; border-radius: 16px;
    font-weight: 600; letter-spacing: -0.01em; color: var(--ink-2);
    transition: background var(--dur-1), color var(--dur-1);
  }
  .snav__item svg { width: 20px; height: 20px; }
  .snav__item:hover { background: var(--white); color: var(--ink); }
  .snav__item[aria-current="page"] { background: var(--black); color: var(--cream); }
  .snav__item[aria-current="page"] svg { color: var(--mint); }
  .snav__sos {
    display: flex; align-items: center; gap: 0.75rem; text-align: left;
    padding: 0.85rem; border-radius: 20px;
    background: var(--alert); color: var(--cream);
    box-shadow: 0 14px 28px -14px rgba(168, 67, 42, 0.8);
    transition: transform var(--dur-2) var(--ease-spring);
  }
  .snav__sos:hover { transform: translateY(-2px); }
  .snav__sos > svg { width: 40px; height: 40px; padding: 9px; border-radius: 50%; background: var(--cream); color: var(--alert); flex: none; }
  .snav__sos span { display: grid; line-height: 1.25; }
  .snav__sos small { opacity: 0.8; font-size: 0.78rem; }
  .snav__who { display: grid; gap: 0.5rem; margin-top: auto; }
  .snav__who .label { color: var(--muted); padding-left: 0.4rem; }
  .tswitch--compact { gap: 4px; }
  .tswitch--compact .tswitch__item { padding: 0.4rem; border-radius: 16px; background: transparent; }
  .tswitch--compact .tswitch__item:hover { background: var(--white); transform: none; }
  .tswitch--compact .tswitch__item[aria-pressed="true"] { background: var(--mint); box-shadow: none; }
  .tswitch--compact .tswitch__ph { width: 36px; height: 40px; border-radius: 10px; }
  .tswitch--compact .tswitch__txt b { font-size: 0.88rem; }
  .tswitch--compact .tswitch__txt small { font-size: 0.72rem; }
  .snav__back { display: flex; align-items: center; gap: 0.5rem; padding-left: 0.4rem; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
  .snav__back svg { width: 16px; height: 16px; }
  .snav__back:hover { color: var(--ink); }

  /* Top bar */
  .atop { min-height: 64px; }
  .atop__me, .atop__title { display: none; }
  .atop__desk { display: block; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
  .atop__time { display: inline-flex; align-items: center; gap: 0.35rem; height: 36px; padding: 0 0.85rem; border-radius: var(--r-pill); background: var(--white); box-shadow: inset 0 0 0 1px var(--line); font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; }

  /* Sheets become centered dialogs */
  .bsheet {
    top: 50%; bottom: auto; max-width: 600px; max-height: 86vh;
    border-radius: 32px; padding: 0 1.75rem 1.75rem;
    transform: translateY(-46%) scale(0.96); opacity: 0;
    transition: transform 480ms var(--ease-out), opacity 300ms var(--ease-out);
    box-shadow: var(--shadow-lg);
  }
  .sheet-layer.is-open .bsheet { transform: translateY(-50%) scale(1); opacity: 1; }
  .bsheet__grab { visibility: hidden; height: 18px; cursor: default; }
  .toast { left: auto; right: 2rem; bottom: 2rem; transform: translateY(20px); }
  .toast.is-in { transform: translateY(0); }

  /* ---------------- Home: 3-column editorial grid */
  .app-view--home {
    display: grid; align-items: start;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    grid-template-areas:
      "top top"
      "hello dest"
      "sos dest"
      "pass ins"
      "summary summary"
      "quick quick"
      "note note";
    column-gap: 1.5rem; row-gap: 1.5rem;
  }
  .app-view--home .atop { grid-area: top; margin-bottom: -1rem; }
  .h-hello { grid-area: hello; align-self: end; }
  .h-dest { grid-area: dest; height: 100% !important; min-height: 380px; }
  .h-sos { grid-area: sos; align-self: stretch; }
  .h-pass { grid-area: pass; }
  .h-summary { grid-area: summary; }
  .h-ins { grid-area: ins; align-self: stretch; grid-template-rows: auto 1fr; }
  .h-quick { grid-area: quick; }
  .h-note { grid-area: note; }
  .hello__name { font-size: clamp(4.5rem, 7vw, 7rem); }
  .hello__kicker { font-size: 2rem; }
  .dest__city { font-size: 3.4rem; }
  .dest { padding: 1.4rem; }
  .sos { padding: 1.1rem; border-radius: 30px; }
  .sos__txt b { font-size: 1.45rem; }
  .wrail { grid-auto-flow: row; grid-template-columns: repeat(4, 1fr); grid-auto-columns: auto; overflow: visible; margin: 0; padding: 0; }
  .wtile { min-height: 150px; }
  .quick { grid-template-columns: repeat(4, 1fr); gap: 1rem; }
  .quick__tile { min-height: 170px; padding: 1.25rem; }
  .ins { height: 100%; }

  /* ---------------- Passport: all passes open in a grid */
  .app-view--passport { gap: 1.5rem; }
  .ptitle__h { font-size: clamp(3.5rem, 5vw, 5rem); }
  .wallet-hint { margin-top: -0.5rem; }
  .wallet--grid {
    display: grid; gap: 1.25rem; height: auto !important; min-height: 0;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: start;
  }
  .wallet--grid .wpass {
    position: relative; transform: none; max-height: none; min-height: 0;
    cursor: default; box-shadow: var(--shadow-md);
    transition: box-shadow var(--dur-2), transform var(--dur-2) var(--ease-out);
  }
  .wallet--grid .wpass:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
  .wallet--grid .wpass__head { pointer-events: none; }
  .wallet--grid .wpass__body { pointer-events: auto; }
  .wallet--grid [data-pass="id"] { grid-column: 1; grid-row: 1; }
  .wallet--grid [data-pass="health"] { grid-column: 1; grid-row: 2 / span 2; }
  .wallet--grid [data-pass="share"] { grid-column: 2; grid-row: 1; }
  .wallet--grid [data-pass="ins"] { grid-column: 2; grid-row: 2; }
  .wallet--grid [data-pass="contact"] { grid-column: 2; grid-row: 3; }
  .wallet--grid .wid__photo { width: 120px; height: 150px; }
  .wallet--grid .wid__name { font-size: 2.2rem; }

  /* ---------------- Documents: table + preview pane */
  .app-view--documents { gap: 1.25rem; }
  .dhead { grid-template-columns: 1fr auto; align-items: end; column-gap: 2rem; }
  .dhead__h { font-size: clamp(3rem, 4.4vw, 4.4rem); grid-column: 1; }
  .dhead__sub { grid-column: 1; }
  .dhead__actions { grid-column: 2; grid-row: 1 / span 2; display: flex; margin: 0; }
  .dact { padding: 0 1.4rem; }
  .dtools { grid-template-columns: minmax(240px, 340px) 1fr; align-items: center; }
  .chips { margin: 0; padding: 0; flex-wrap: wrap; overflow: visible; }
  .dlayout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(380px, 1fr); gap: 1.5rem; align-items: start; }
  .dtable-head {
    display: grid; grid-template-columns: 50px minmax(0, 1fr) 110px 100px 92px; column-gap: 0.85rem;
    padding: 0 0.9rem 0.5rem; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  }
  .dtable-head span:first-child { grid-column: 1 / span 2; }
  .dlist { gap: 0.4rem; }
  .dcard { display: grid; grid-template-columns: 50px minmax(0, 1fr) 110px 100px 92px; column-gap: 0.85rem; align-items: center; padding: 0.7rem 0.9rem; border-radius: 18px; }
  .dcard__ic { width: 50px; height: 56px; }
  .dcard__txt small { display: none; }
  .dcard__type, .dcard__date { display: block; font-size: var(--fs-sm); color: var(--ink-2); }
  .dcard__type { font-weight: 600; }
  .dcard__langs { flex-direction: row; flex-wrap: wrap; }
  .dcard[aria-pressed="true"] { background: var(--black); color: var(--cream); box-shadow: var(--shadow-md); }
  .dcard[aria-pressed="true"] .dcard__type, .dcard[aria-pressed="true"] .dcard__date, .dcard[aria-pressed="true"] .dcard__preview { color: rgba(251, 243, 235, 0.7); }
  .dcard[aria-pressed="true"] .dcard__langs i { background: rgba(251, 243, 235, 0.14); }
  .dcard:hover { transform: translateX(3px); }
  .ddrop {
    display: flex; align-items: center; justify-content: center; gap: 0.85rem;
    margin-top: 0.75rem; min-height: 96px; border-radius: 22px;
    border: 1.5px dashed var(--line-strong); color: var(--muted);
    transition: background var(--dur-2), border-color var(--dur-2), color var(--dur-2);
  }
  .ddrop svg { width: 26px; height: 26px; }
  .ddrop span { display: grid; line-height: 1.3; }
  .ddrop b { color: var(--ink); }
  .ddrop.is-over { background: var(--mint-soft); border-color: var(--black); color: var(--ink); }
  .dpane {
    display: block; position: sticky; top: 1.5rem;
    max-height: calc(100svh - 3rem); overflow-y: auto;
    padding: 1.5rem; border-radius: 30px; background: var(--cream-2);
    box-shadow: inset 0 0 0 1px var(--line);
  }
  .dpane .dsheet { animation: view-in-d 450ms var(--ease-out); }
  .dpane .dsheet__tr, .dpane .ufile, .dpane .ufound, .dpane .unote { background: var(--white); }
  .dpane .dsheet__swap { box-shadow: 0 0 0 5px var(--cream-2); }
  .dpane .dsheet__actions .btn { width: 100%; }

  /* ---------------- Profile: two columns */
  .app-view--profile {
    display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    column-gap: 2rem; row-gap: 1.5rem; align-items: start;
  }
  .app-view--profile .atop, .app-view--profile .app-note { grid-column: 1 / -1; }
  .p-me { grid-column: 1; grid-row: 2; }
  .p-details { grid-column: 1; grid-row: 3; }
  .p-tiles { grid-column: 1; grid-row: 4; }
  .p-trav { grid-column: 2; grid-row: 2; }
  .p-settings { grid-column: 2; grid-row: 3 / span 2; }
  .p-exit { grid-column: 2; grid-row: 5; }
  .me__photo { width: 170px; height: 210px; }
  .me__name { font-size: 4rem; }
}
@keyframes view-in-d { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (min-width: 1280px) {
  .dpane .dsheet__cols { grid-template-columns: 1fr auto 1fr; align-items: stretch; }
  .dpane .dsheet__swap { align-self: center; margin: 0 -1.4rem; }
  .dlayout { grid-template-columns: minmax(0, 1.1fr) minmax(460px, 1fr); }
}

@media (min-width: 1280px) {
  .app-view--home {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.9fr);
    grid-template-areas:
      "top top top"
      "hello dest dest"
      "sos dest dest"
      "pass summary ins"
      "quick quick quick"
      "note note note";
  }
  .app-view--home .wrail { grid-template-columns: 1fr 1fr; }
}
