/* Sheet dialogs (Home backgrounds, Content Studio, Host Live history): one glass panel style. */
.sheet-dialog {width:min(720px,calc(100vw - 32px));max-height:calc(100dvh - 32px);box-sizing:border-box;padding:24px;color:#0b285b;}
.sheet-dialog header {display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px;}
.sheet-dialog h2 {margin:0;font:inherit;font-size:clamp(22px,3vw,30px);font-weight:800;}
.sheet-dialog button {min-width:44px;min-height:44px;padding:10px 16px;border:2px solid var(--sp-action-border,#fff);border-radius:20px;background:var(--sp-action-background,#edf4ff);box-shadow:var(--sp-action-shadow);color:inherit;font:inherit;font-weight:800;cursor:pointer;}
.sheet-dialog [data-close] {font-size:24px;}
html[data-theme="dark"] .sheet-dialog {color:#f5f8ff;background:#10243c;}
body.is-logged-in dialog.sheet-dialog {padding:24px!important;width:min(720px,calc(100vw - 32px))!important;max-height:calc(100dvh - 32px)!important;border:2px solid #fff;border-radius:26px;overflow:auto;background:radial-gradient(ellipse at 32% 22%,rgba(137,221,194,.24),transparent 70%),linear-gradient(155deg,#fafdff,#e5efff);box-shadow:0 22px 54px rgba(8,34,78,.25);}
body.is-logged-in dialog.sheet-dialog::backdrop {background:rgba(5,15,34,.3);}
html[data-theme="dark"] body.is-logged-in dialog.sheet-dialog {background:#10243c;border-color:#38577e;}
.sheet-dialog-actions {display:flex;flex-wrap:wrap;justify-content:flex-end;gap:12px;margin-top:20px;}
.sheet-dialog p {line-height:1.55;}
.sheet-dialog select {display:block;width:100%;min-height:44px;margin:0 0 16px;padding:10px 14px;border:2px solid #9663f5;border-radius:16px;background:var(--sp-action-background,#edf4ff);color:inherit;font:inherit;}
html[data-theme="dark"] .sheet-dialog select {background:#10243c;}

/* Home backgrounds tile on Home: a compact picture tile, the same as on iPhone and iPad. */
html:root body .world-map .home-bg-card[data-home-backgrounds] {width:64px!important;height:64px!important;min-width:0!important;min-height:0!important;padding:0!important;gap:0!important;justify-content:center!important;border-radius:20px!important;transition:opacity 160ms var(--sp-ease-out,ease-out),scale var(--sp-dur-snappy,510ms) var(--sp-ease-snappy,ease-out);}
html:root body .world-map .home-bg-card[data-home-backgrounds]:active {scale:.94;}
html:root body .world-map .home-bg-card[data-home-backgrounds] > span:not(.home-bg-icon) {display:none!important;}
html:root body .world-map .home-bg-card[data-home-backgrounds] .home-bg-icon {width:44px;height:44px;border-radius:14px;}
html:root body .world-map .home-bg-card[data-home-backgrounds] .home-bg-icon svg {width:28px;height:28px;}

/* The picker: a large preview of the chosen place, the ten places below it. */
.home-bg-dialog .home-bg-preview {position:relative;margin:0;border-radius:20px;overflow:hidden;aspect-ratio:16/9;background:#0b1a30;box-shadow:0 10px 28px rgba(8,34,78,.22);}
.home-bg-dialog .home-bg-preview img {display:block;width:100%;height:100%;object-fit:cover;transition:opacity 240ms var(--sp-ease-out,ease-out);}
.home-bg-dialog .home-bg-preview img.is-loading {opacity:.35;}
.home-bg-dialog .home-bg-preview figcaption {position:absolute;left:14px;bottom:12px;padding:6px 12px;border-radius:999px;background:rgba(8,20,40,.55);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);color:#fff;font-weight:800;font-size:15px;}
.home-bg-dialog .home-bg-note {margin:12px 2px 4px;font-size:14px;opacity:.75;}
.home-bg-dialog .home-bg-grid {display:grid;grid-template-columns:repeat(auto-fill,minmax(128px,1fr));gap:12px;margin-top:12px;}
.home-bg-dialog .home-bg-grid button {position:relative;display:flex;flex-direction:column;gap:8px;padding:6px 6px 10px;border-radius:18px;text-align:left;transition:scale var(--sp-dur-snappy,510ms) var(--sp-ease-snappy,ease-out),border-color 160ms;}
.home-bg-dialog .home-bg-grid button:active {scale:.96;}
.home-bg-dialog .home-bg-grid img {display:block;width:100%;aspect-ratio:16/9;object-fit:cover;border-radius:13px;background:#d9e6fb;}
.home-bg-dialog .home-bg-grid span {padding:0 4px;font-size:14px;line-height:1.25;}
.home-bg-dialog .home-bg-grid button[aria-pressed="true"] {border-color:#8b55ff;box-shadow:0 0 0 2px #8b55ff,0 8px 20px rgba(139,85,255,.25);}
.home-bg-dialog .home-bg-grid em {position:absolute;top:12px;left:12px;padding:2px 8px;border-radius:999px;background:#8b55ff;color:#fff;font-style:normal;font-size:12px;font-weight:800;}
html[data-theme="dark"] .home-bg-dialog .home-bg-grid img {background:#1b3352;}
.home-bg-dialog [data-apply] {background:#8b55ff;border-color:#8b55ff;color:#fff;}
.home-bg-dialog [data-apply]:disabled {opacity:.5;cursor:default;}
.home-bg-dialog[open] {animation:home-bg-in var(--sp-dur-glide,375ms) var(--sp-ease-glide,ease-out) backwards;}
@keyframes home-bg-in {from {opacity:0;scale:.94;translate:0 12px;}}
@media (prefers-reduced-motion:reduce) {.home-bg-dialog[open] {animation:none;}.home-bg-dialog .home-bg-grid button:active {scale:1;}}

/* Phones and tablets: the Home background has the same rounded corners as Vibe and Live, and the app. */
@media (max-width: 1100px) {
  body.is-logged-in .home-view .world-map { border-radius: 24px; }
}

/* Phones and tablets: Home is laid out as in the iPhone and iPad app. The Family/Friends switch is centred, the
   person card spans the width, and the backgrounds tile sits on the left under the card
   (web/home-seating.js moves it below the card when they overlap). A tile the person dragged keeps its place. */
@media (max-width: 1100px) {
  body.is-logged-in .home-view .world-map > .home-ff-browser {
    left: 14px !important;
    right: 14px !important;
    width: fit-content !important;
    max-width: calc(100% - 28px) !important;
    margin-inline: auto !important;
  }
  body.is-logged-in .home-view .world-map > [data-home-family-card] {
    left: 14px !important;
    right: 14px !important;
    width: auto !important;
    max-width: none !important;
  }
  html:root body.is-logged-in .home-view .world-map > .home-bg-card[data-home-backgrounds]:not([style*="left"]) {
    left: 14px !important;
    right: auto !important;
  }
}
@media (max-width: 600px) {
  html:root body.is-logged-in .home-view .world-map > .home-bg-card[data-home-backgrounds]:not([style*="left"]) {
    width: 56px !important;
    height: 56px !important;
  }
}
