/* AuraViva R6.2.2
   Mobile Presence + Sign Polish
   Presentation-only additive layer.
   Mother, Sign Engine, registry/readings and persistence remain untouched. */

:root{
  --r622-sign-bottom: calc(58px + env(safe-area-inset-bottom));
  --r622-sign-max-h: min(42dvh, 360px);
}

/* Keep the visual stage continuous while the main video changes source/buffers. */
.video-wrap{
  isolation:isolate;
}

#r622ContinuityCanvas{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  z-index:1;
  opacity:0;
  pointer-events:none;
  transition:opacity .12s ease;
}

#r622ContinuityCanvas.is-visible{
  opacity:1;
}

#avatarVideo{
  z-index:2;
}

#r622PassiveRestVideo{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center center;
  z-index:3;
  opacity:0;
  pointer-events:none;
  transition:opacity .28s ease;
  background:transparent;
}

#r622PassiveRestVideo.is-visible{
  opacity:1;
}

/* Small invitation instead of automatically opening the Sign. */
#r622SignNudge{
  position:absolute;
  z-index:38;
  right:64px;
  top:calc(48px + env(safe-area-inset-top));
  max-width:170px;
  min-height:38px;
  padding:8px 12px;
  border:1px solid rgba(255,255,255,.92);
  border-radius:999px;
  background:rgba(255,255,255,.90);
  color:#5d6571;
  box-shadow:0 8px 24px rgba(70,88,115,.14);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  font:700 12px/1.15 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  letter-spacing:.01em;
  text-align:center;
  cursor:pointer;
  opacity:0;
  transform:translateY(-4px);
  transition:opacity .18s ease,transform .18s ease;
}

#r622SignNudge.is-visible{
  opacity:1;
  transform:translateY(0);
}

@media(max-width:600px){
  /* The Sign is a compact ritual over the living companion, not a replacement screen. */
  #sign.sheet{
    position:fixed !important;
    inset:0 !important;
    padding:0 !important;
    background:transparent !important;
    align-items:flex-end !important;
    justify-content:center !important;
    pointer-events:none !important;
    overflow:visible !important;
  }

  #sign.sheet.show{
    pointer-events:none !important;
  }

  #sign .panel{
    position:absolute !important;
    left:8px !important;
    right:8px !important;
    bottom:var(--r622-sign-bottom) !important;
    top:auto !important;
    width:auto !important;
    height:auto !important;
    min-height:0 !important;
    max-height:var(--r622-sign-max-h) !important;
    margin:0 !important;
    padding:10px 14px 12px !important;
    overflow:auto !important;
    overscroll-behavior:contain !important;
    pointer-events:auto !important;
    border-radius:24px !important;
    background:rgba(252,252,252,.96) !important;
    border:1px solid rgba(255,255,255,.96) !important;
    box-shadow:0 18px 50px rgba(48,58,75,.20) !important;
    backdrop-filter:blur(16px) !important;
    -webkit-backdrop-filter:blur(16px) !important;
    scrollbar-width:none;
  }

  #sign .panel::-webkit-scrollbar{
    display:none;
  }

  #sign .handle{
    width:34px !important;
    height:4px !important;
    margin:0 auto 6px !important;
    opacity:.35;
  }

  #sign .panel-head{
    min-height:34px !important;
    margin:0 0 6px !important;
    padding:0 !important;
    display:flex !important;
    align-items:center !important;
  }

  #sign .panel-head .eyebrow{
    font-size:10px !important;
    line-height:1.1 !important;
    letter-spacing:.09em !important;
  }

  #sign .panel-head h3{
    margin:2px 0 0 !important;
    font-size:16px !important;
    line-height:1.12 !important;
  }

  #sign .panel-head .close{
    width:40px !important;
    min-width:40px !important;
    height:40px !important;
    min-height:40px !important;
    margin-left:auto !important;
  }

  #r6SignSetup{
    margin:0 !important;
    padding:2px 0 0 !important;
  }

  #r6SignSetup label{
    display:block !important;
    margin:0 0 5px !important;
    font-size:13px !important;
    line-height:1.2 !important;
    font-weight:700 !important;
  }

  #r6SignDob{
    width:100% !important;
    min-height:46px !important;
    height:46px !important;
    margin:0 0 7px !important;
    padding:8px 12px !important;
    font-size:16px !important;
    line-height:1 !important;
    border-radius:14px !important;
  }

  #r6SignAssign{
    width:100% !important;
    min-height:46px !important;
    height:46px !important;
    margin:0 !important;
    font-size:13px !important;
  }

  #r6SignPrivacy,
  #r6SignError{
    margin:6px 1px 0 !important;
    font-size:11px !important;
    line-height:1.25 !important;
  }

  #r6SignReading{
    margin:0 !important;
    padding:0 !important;
  }

  #r6SignReading .r6-sign-hero{
    min-height:0 !important;
    margin:0 !important;
    padding:0 !important;
  }

  #r6SignSigil,
  #r62SignHand{
    max-width:68px !important;
    max-height:68px !important;
    width:auto !important;
    height:auto !important;
    object-fit:contain !important;
  }

  #r6SignName{
    margin:0 !important;
    font-size:24px !important;
    line-height:1 !important;
  }

  #r6SignMeaning{
    margin:4px 0 !important;
    font-size:13px !important;
    line-height:1.25 !important;
  }

  #r6SignDaily{
    margin:7px 0 !important;
    padding:9px 11px !important;
    border-radius:14px !important;
    font-size:15px !important;
    line-height:1.28 !important;
  }

  #r6SignReading button{
    min-height:40px !important;
    padding:7px 9px !important;
    font-size:11px !important;
  }

  #r62SignManage{
    min-height:34px !important;
    height:34px !important;
    margin-top:4px !important;
    font-size:10px !important;
  }

  /* Secondary destructive/reassignment controls stay available but visually subordinate. */
  #r6SignChange,
  #r6SignDelete{
    min-height:38px !important;
    margin-top:5px !important;
    font-size:10px !important;
  }

  html[data-r622-sign-mode="reading"] #r6SignPrivacy{
    display:none !important;
  }

  #r622SignNudge{
    right:62px;
    top:calc(52px + env(safe-area-inset-top));
    max-width:156px;
    font-size:11px;
  }
}

@media(max-width:360px){
  :root{
    --r622-sign-max-h:min(45dvh,330px);
  }

  #sign .panel{
    left:6px !important;
    right:6px !important;
    padding-left:11px !important;
    padding-right:11px !important;
  }

  #r6SignDaily{
    font-size:14px !important;
  }
}

@media(max-height:650px) and (max-width:600px){
  :root{
    --r622-sign-max-h:min(48dvh,300px);
  }

  #r6SignSigil,
  #r62SignHand{
    max-width:54px !important;
    max-height:54px !important;
  }

  #r6SignMeaning{
    font-size:12px !important;
  }

  #r6SignDaily{
    font-size:13px !important;
    padding:7px 9px !important;
  }
}

@media(prefers-reduced-motion:reduce){
  #r622ContinuityCanvas,
  #r622PassiveRestVideo,
  #r622SignNudge{
    transition:none !important;
  }
}
/* R622_SIGNFIT_V6_HIDDEN_SEMANTICS
   [hidden] is authoritative. This prevents .r6-sign-form{display:grid}
   or other author CSS from keeping the retired DOB setup in layout. */
#r6SignSetup[hidden],
#r6SignReading[hidden]{
  display:none !important;
}
/* R622B_SIGN_PROGRESSIVE_DISCLOSURE_V7
   Mobile primary ritual: daily reading first; account-management controls
   remain available through GESTIONAR SIGNO but do not force panel scrolling.
   Setup geometry is compacted across the audited 320/360/390/430 portrait matrix. */
@media (max-width:600px){
  #sign .panel{
    box-sizing:border-box !important;
    width:100% !important;
    height:auto !important;
    max-height:46dvh !important;
    overflow-y:auto !important;
    overscroll-behavior:contain !important;
  }
  #sign .handle{
    margin:1px auto 7px !important;
  }
  #sign .panel-head{
    margin-bottom:6px !important;
  }

  #r6SignSetup{
    gap:6px !important;
  }
  #r6SignSetup .r6-sign-note{
    font-size:12px !important;
    line-height:1.3 !important;
    margin:2px 0 !important;
  }
  #r6SignSetup label{
    font-size:13px !important;
    line-height:1.2 !important;
  }
  #r6SignSetup input[type="date"]{
    min-height:48px !important;
    padding:8px 10px !important;
    font-size:16px !important;
  }
  #r6SignSetup #r6SignAssign{
    min-height:48px !important;
    margin:0 !important;
  }
  #r6SignSetup #r6SignError{
    min-height:0 !important;
    font-size:12px !important;
    line-height:1.2 !important;
  }
  #r6SignSetup #r6SignError:empty{
    display:none !important;
  }

  #r6SignReading #r62SignManage:not(.open) ~ #r6SignChange,
  #r6SignReading #r62SignManage:not(.open) ~ #r6SignDelete,
  #r6SignReading #r62SignManage:not(.open) ~ .r6-sign-note{
    display:none !important;
  }
  #r6SignReading #r62SignManage.open ~ #r6SignChange,
  #r6SignReading #r62SignManage.open ~ #r6SignDelete,
  #r6SignReading #r62SignManage.open ~ .r6-sign-note{
    display:block !important;
  }
  #r6SignReading .r6-sign-hero{
    margin:0 !important;
    gap:8px !important;
  }
  #r6SignReading .r6-sign-date{
    margin-top:4px !important;
  }
  #r6SignReading .r6-sign-actions{
    margin-top:6px !important;
  }
  #r6SignReading #r62SignManage{
    width:100% !important;
    min-height:48px !important;
    margin-top:6px !important;
  }
}

/* 320px-class phones need the tighter form treatment measured from the
   verified 320x700 CDP viewport. Preserve >=45% upper stage, 16px DOB text,
   >=48px primary targets, and zero setup/result panel scroll. */
@media (max-width:339px) and (max-height:760px){
  #sign .panel{
    max-height:46dvh !important;
    padding:6px 12px calc(10px + env(safe-area-inset-bottom)) !important;
  }
  #sign .panel-head{
    margin-bottom:4px !important;
  }
  #sign .panel-head .eyebrow{
    font-size:9px !important;
    line-height:1.1 !important;
  }
  #sign .panel-head h3{
    font-size:16px !important;
    line-height:1.12 !important;
  }
  #r6SignSetup{
    gap:5px !important;
  }
  #r6SignSetup .r6-sign-note{
    line-height:1.28 !important;
    margin:0 !important;
  }
}