/* Mobile Safari may magnify small editable text on focus. Keep controls at a
   readable size instead of disabling the user's viewport/pinch zoom. This
   shared rule also covers lazy-loaded authentication and profile forms. */
@media (max-width:700px), (any-pointer:coarse) {
  input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):not([type=button]):not([type=submit]):not([type=reset]),
  textarea,
  select,
  [contenteditable=""],
  [contenteditable="true"],
  [contenteditable="plaintext-only"] {
    font-size:max(16px, 1em)!important;
  }
}
.mobile-sheet {position:fixed;z-index:120;left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right));bottom:0;max-height:calc(var(--sheet-visible-height,100dvh) - max(8px,calc(env(safe-area-inset-top) - var(--sheet-visible-top,0px))));border-radius:26px 26px 0 0;display:flex;flex-direction:column;color:var(--ink,#f8f7ef);padding-bottom:env(safe-area-inset-bottom);box-sizing:border-box;overflow:hidden;}
.mobile-sheet[hidden]{display:none;}
.mobile-sheet__header {position:relative;flex:none;min-height:68px;display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center;padding:0 10px;touch-action:none;}
.mobile-sheet__grabber {position:absolute;top:0;left:calc(50% - 30px);width:60px;height:24px;border:0;background:none;color:inherit;opacity:.6;cursor:ns-resize;touch-action:none;}
.mobile-sheet__title {grid-column:2;text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:500 16px/1.3 var(--font-ui);padding-top:10px;}
.mobile-sheet__close {grid-column:3;width:44px;height:44px;border:0;background:none;color:inherit;font-size:24px;}
.mobile-sheet__body {min-height:0;flex:1;overflow:auto;overscroll-behavior:contain;}
.mobile-sheet__body > .mobile-sheet-content {position:relative!important;inset:auto!important;transform:none!important;width:100%!important;max-width:none!important;height:auto!important;max-height:none!important;margin:0!important;border:0!important;border-radius:0!important;background:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;box-shadow:none!important;}
.mobile-sheet button:focus-visible {outline:2px solid currentColor;outline-offset:-3px;}
.manyplace-menu[data-mobile-presented]{display:contents;}
.mobile-sheet__back {grid-column:1;grid-row:1;width:44px;height:44px;border:0;background:none;color:inherit;font-size:26px;}
.mobile-sheet__back[hidden] {display:none;}
.mobile-sheet-suspended {display:none!important;}

/* The visual viewport ends at the keyboard; a second home-indicator inset
   would leave a blank strip above it on iOS. */
.mobile-sheet[data-keyboard-open="true"] {padding-bottom:0;}
.mobile-sheet-content.safety-dialog>.safety-dialog__title{display:none}
.mobile-sheet-content.safety-dialog{padding:12px 20px 24px}
.mobile-sheet__close{justify-self:end;}

/* Existing component headers retain their actions and refresh/focus ownership.
   The presenter contributes only the grabber, plus Back when needed. */
.mobile-sheet__title[hidden],.mobile-sheet__close[hidden]{display:none}
.mobile-sheet[data-header="content"]>.mobile-sheet__header{min-height:44px}
.mobile-sheet[data-header="content"] .mobile-sheet__grabber{height:44px}
.mobile-sheet[data-header="content"]>.mobile-sheet__header:has(.mobile-sheet__back:not([hidden])){min-height:68px}
.mobile-sheet[data-header="untitled"]>.mobile-sheet__header{min-height:52px}

.mobile-sheet__body > .mobile-sheet-content{box-sizing:border-box;min-width:0}
.mobile-sheet .manyplace-menu__resume:not(.manyplace-menu__confirm-leave){display:none}
.mobile-sheet .spatial-private-session__privacy,
.mobile-sheet .spatial-private-session__options-button,
.mobile-sheet .spatial-private-session__close{width:44px;height:44px;flex-shrink:0}

.mobile-sheet .spatial-private-session-panel button{min-height:44px;min-width:44px}

/* A single floating pane; fixed content fits before it becomes scrollable. */
.mobile-sheet{border-radius:26px;padding-bottom:8px;max-height:calc(var(--sheet-visible-height,100dvh) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px)}
.mobile-sheet__body{scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.18) transparent}
.mobile-sheet__body>.mobile-sheet-content{overflow:visible!important}
.mobile-sheet[data-header="content"]>.mobile-sheet__header{min-height:44px}
.mobile-sheet[data-header="content"] .mobile-sheet__grabber{height:44px}
.mobile-sheet[data-policy="content"] .mobile-sheet__grabber{cursor:grab}
.mobile-sheet .manyplace-menu__body{max-height:none;overflow:visible}
.mobile-sheet .public-profile__body{overflow:visible;max-height:none}
.mobile-sheet .spatial-private-session-panel{padding:0 16px 16px}
body:has(.mobile-sheet[aria-modal="true"]:not([hidden])) .profile-chip--room{visibility:hidden;pointer-events:none}

.mobile-sheet { margin-bottom: calc(8px + env(safe-area-inset-bottom)); }
.mobile-sheet[data-keyboard-open="true"] { margin-bottom: 8px; }


/* A single action row below the grabber: title, Back and Close share a center. */
.mobile-sheet__header{box-sizing:border-box;min-height:68px;padding:20px 12px 4px;grid-auto-rows:minmax(44px,auto)}
.mobile-sheet__title{padding:0;align-self:center;line-height:1.3}
.mobile-sheet__close,.mobile-sheet__back{grid-row:1;align-self:center;display:grid;place-items:center;padding:0}
.mobile-sheet__close svg{width:18px;height:18px}
.mobile-sheet__grabber{height:24px;line-height:24px;padding:0}
.mobile-sheet[data-header="content"]>.mobile-sheet__header{min-height:44px;padding:0 12px;grid-auto-rows:44px}
.mobile-sheet[data-header="content"] .mobile-sheet__grabber{height:44px;line-height:44px}
.mobile-sheet[data-header="untitled"]>.mobile-sheet__header{min-height:68px}
.mobile-sheet .seat-control__action,
.mobile-sheet .manyplace-menu__way,
.mobile-sheet .volume-popover__row,
.mobile-sheet .volume-popover__row > button {min-height:44px}
.mobile-sheet__grabber{height:44px;font-size:0;line-height:0}
.mobile-sheet__grabber::after{content:'';position:absolute;top:10px;left:14px;right:14px;height:3px;border-radius:999px;background:currentColor}

/* A grip is a dismissal/resize affordance, not a second full header row. */
.mobile-sheet__header{min-height:60px;padding:12px 12px 4px;}
.mobile-sheet__grabber{height:16px;line-height:0;}
.mobile-sheet__grabber::after{top:6px;}
.mobile-sheet[data-header="content"]>.mobile-sheet__header{min-height:12px;height:12px;padding:0 12px;grid-auto-rows:12px;}
.mobile-sheet[data-header="content"] .mobile-sheet__grabber{height:16px;line-height:0;}
.mobile-sheet[data-header="content"]>.mobile-sheet__header:has(.mobile-sheet__back:not([hidden])){height:auto;min-height:60px;padding-top:12px;grid-auto-rows:44px;}
.mobile-sheet[data-header="untitled"]>.mobile-sheet__header{min-height:60px;}

.mobile-sheet .conversation-lens__header,.mobile-sheet .spatial-private-session__head{touch-action:none;}

.mobile-sheet .spatial-private-session__close{color:inherit;}
.mobile-sheet .spatial-private-session__close svg{width:18px;height:18px;transform:none;}

.mobile-sheet:has(.ask) .mobile-sheet__title{white-space:normal;text-overflow:clip;}

/* Manual popovers retain component ownership while escaping scene stacking contexts. */
.mobile-sheet[popover] {width:auto;top:auto;margin-top:0;margin-left:0;margin-right:0;}
.mobile-sheet::backdrop {background:transparent;pointer-events:none;}
.mobile-sheet__grabber[hidden] {display:none;}
.mobile-sheet .card::after {display:none;}
.mobile-sheet .card::before {display:none;}
.mobile-sheet[data-presentation="card"] {width:min(360px,calc(100% - 24px));left:50%;right:auto;transform:translateX(-50%);border-radius:24px;}
.mobile-sheet[data-presentation="card"]>.mobile-sheet__header {min-height:44px;padding:0 8px;grid-auto-rows:44px;}
.mobile-sheet[data-presentation="card"] .card {padding:0 18px 18px;}

.mobile-sheet[data-presentation="card"]>.mobile-sheet__header{height:44px;min-height:44px;padding:0 8px;grid-auto-rows:44px}
