.meo-home-app { overscroll-behavior-x: none; }

/* Compact heading for the share campaign in Zibll's system notice. */
#modal-system-notice:has(.mivo-share) { --mivo-notice-heading-height: 72px; }
#modal-system-notice:has(.mivo-share) .modal-colorful-header {
  container-type: inline-size;
  color: var(--key-color);
  height: var(--mivo-notice-heading-height);
  border-bottom: 1px solid var(--muted-border-color);
  background: var(--main-bg-color) url("../mili.png") right 38px top 3px / 24px 24px no-repeat;
  background-color: color-mix(in srgb, var(--main-bg-color) 96%, var(--focus-color));
}
#modal-system-notice:has(.mivo-share) .modal-colorful-header + div {
  margin-top: var(--mivo-notice-heading-height);
}
#modal-system-notice:has(.mivo-share) .colorful-make { display: none; }
#modal-system-notice:has(.mivo-share) .modal-colorful-header > .text-center {
  max-width: calc(100% - 64px);
}
#modal-system-notice:has(.mivo-share) .modal-colorful-header .em12 {
  margin: 0;
  padding: 0;
  font-size: 20px;
  font-size: clamp(20px, 6cqi, 25px);
  font-weight: 700;
  line-height: 1.35;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
#modal-system-notice:has(.mivo-share) .modal-colorful-header > .close {
  color: inherit;
  opacity: 1;
}

body { min-height: 100vh; min-height: 100dvh; }

:root.meo-home-app {
  --mivo-safe-area-top: var(--mivo-cutout-top, env(safe-area-inset-top, 0px));
  --mivo-top-color: var(--mivo-header-tint, var(--mivo-initial-canvas));
  background-color: var(--mivo-top-color);
}

/* Give WebKit the header color on both canvases while preserving the visible page background. */
:root.meo-home-app[data-mivo-header-tint] > body {
  background: var(--mivo-content-paint) !important;
  background-color: var(--mivo-top-color) !important;
}

:root.meo-home-app:is([data-mivo-status-header-visible], [data-mivo-fixed-status])::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: var(--mivo-safe-area-top);
  z-index: 1001;
  pointer-events: none;
  background-color: var(--mivo-inset-color, var(--mivo-top-color));
}

/* Pages with a fixed status color keep their inset solid when a sheet dims the content. */
:root.meo-home-app[data-mivo-fixed-status]::before { z-index: 2147483647; }
:root.meo-home-app[data-mivo-fixed-status] dialog::backdrop {
  clip-path: inset(var(--mivo-safe-area-top) 0 0);
}

/* Personal settings retain the native drawer's controls and layout with immediate opening and closing. */
.user-center-content.drawer-sm[data-mivo-instant-settings] { transition: none; }

/* Zibll's full-viewport loader hides the destination until window.load. */
.qjl.qj_loading { display: none !important; }

@media (prefers-reduced-motion: no-preference) {
  /* Keep child navigation directional without moving an entire screen width. */
  @view-transition { navigation: auto; }
  :root[data-mivo-slide]::view-transition { pointer-events: none; }
  :root[data-mivo-slide]::view-transition-group(*),
  :root[data-mivo-slide]::view-transition-old(*),
  :root[data-mivo-slide]::view-transition-new(*) { animation: none; mix-blend-mode: normal; }
  :root[data-mivo-slide]::view-transition-group(*) { overflow: clip; }
  :root[data-mivo-slide="forward"]:not([data-mivo-slide-pane])::view-transition-new(root),
  :root[data-mivo-slide="forward"]::view-transition-new(mivo-pane),
  :root[data-mivo-slide-fallback="forward"] body > :is(header, main, footer, .meo-chat-shell, .footer-tabbar, .header-slider-container, .fluid-widget-wrap, [data-mivo-status-underlay], #mivo-install-banner) {
    animation: mivo-drawer-in .165s cubic-bezier(.2,.8,.2,1) both;
  }
  :root[data-mivo-slide="back"]:not([data-mivo-slide-pane])::view-transition-old(root),
  :root[data-mivo-slide="back"]::view-transition-old(mivo-pane) {
    z-index: 2; animation: mivo-drawer-out .14s ease-out both;
  }
  :root[data-mivo-slide-pane]::view-transition-old(root) { opacity: 0; }
  :root[data-mivo-slide-fallback], :root[data-mivo-slide-fallback] body { overflow-x: clip; }
  :root[data-mivo-slide-fallback="back"] body > :is(header, main, footer, .meo-chat-shell, .footer-tabbar, .header-slider-container, .fluid-widget-wrap, [data-mivo-status-underlay], #mivo-install-banner) {
    animation: mivo-drawer-under .14s ease-out both;
  }

  .posts-item.card:has(.item-thumbnail a:active, .item-heading a:active) {
    scale: .988;
    transition-duration: 90ms;
  }
  .footer-tabbar a.tabbar-item > icon {
    transition: opacity 140ms ease-out, scale 140ms ease-out;
  }
  .footer-tabbar a.tabbar-item:active > icon {
    scale: .92;
  }
}

/* Use a short pressed state without changing the target size or hit area. */
:is(.meo-detail-back, .meo-detail-start, .meo-header-back, .meo-header-settings,
    .meo-inbox-tabs > a, .footer-tabbar a.tabbar-item,
    .posts-item.card .item-thumbnail a, .posts-item.card .item-heading a) {
  touch-action: manipulation;
}
/* The inbox uses a horizontal swipe to expose session actions. */
.meo-inbox-thread > a.meo-inbox-row { touch-action: pan-y pinch-zoom; }
html body :is(.meo-detail-back, .meo-detail-start, .meo-header-back, .meo-header-settings,
    .meo-inbox-tabs > a):active,
html body .footer-tabbar a.tabbar-item:active > icon {
  opacity: .78;
}
.posts-item.card :is(.item-thumbnail a, .item-heading a):active {
  opacity: .8;
}

/* Immediate feedback on the site's tap controls. Keep drag and voice-recording gestures native. */
:is(.navbar-toggle, .mobile-navbar .close, .mobile-navbar .toggle-theme, .mobile-menus a,
    .md-controls label, .md-all, .md-more, .meo-square-sort a, .meo-square-icon-action,
    .meo-quick-row, .meo-quick-close, .meo-detail-follow, .meo-detail-action, .mivo-promo-entry,
    .mivo-share-send, [data-copy-invite], .mivo-share-topic, .meo-background-preset, .meo-inbox-thread-toggle,
    .role-authoring .but, .role-cover-library, .role-gender-options label, .mivo-profile-social, .btn-input-expand) {
  touch-action: manipulation;
}
:is(.mobile-menus a, .md-controls label > span, .md-all, .md-more, .meo-square-sort a,
    .meo-square-icon-action, .meo-quick-row, .meo-quick-close, .meo-detail-follow, .meo-detail-action,
    .mivo-promo-entry, .mivo-share-send, [data-copy-invite], .mivo-share-topic, .meo-background-preset,
    .meo-inbox-thread-toggle, .role-authoring .but, .role-cover-library, .role-gender-options label,
    .mivo-profile-social, .btn-input-expand):not(:disabled):active,
.user-center-sidebar [data-onclick][role="button"]:active,
.meo-square-rank a[aria-busy="true"] { opacity: .75; }
:is(.header .navbar-toggle, .mobile-navbar button, .mobile-navbar a, .meo-square a,
    .meo-root button, .meo-root a, .mivo-share-main button, .user-center-sidebar a, .user-center-sidebar [data-onclick][role="button"]):focus-visible {
  outline: 2px solid var(--focus-color, currentColor);
  outline-offset: -2px;
}

@media (pointer: coarse) {
  .navbar-top .navbar-toggle { min-width: 44px; min-height: 44px; margin-top: 2px; }
  .mobile-navbar :is(button.close, .toggle-theme.toggle-radius) {
    min-width: 44px; min-height: 44px; text-align: center;
  }
  .mobile-navbar .toggle-theme.toggle-radius { line-height: 44px; }
  .footer-tabbar .tabbar-ontop > a { min-width: 44px; }
  .mivo-discovery :is(.md-orders span, .md-genres label > span, .md-genres .md-all) {
    display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  }

  .meo-square .meo-square-rank a, .meo-square .meo-square-icon-action:not(.meo-square-save), .meo-role-detail .meo-detail-follow,
  .meo-role-detail .meo-detail-back, .mivo-friend-code-row button, .mivo-share-section .mivo-share-topic,
  .mivo-share-main .mivo-share-send, .role-authoring .role-gender-options span,
  .role-authoring :is(.role-terms, .role-author-tools) .but, .role-authoring .role-cover-library,
  .role-authoring #app-actions #app-save-button { min-height: 44px; }
  .meo-role-detail .btn-input-expand, .meo-role-detail .input-expand-submit {
    display: inline-flex; align-items: center; justify-content: center; min-width: 44px;
    min-height: 44px;
  }
  .user-center-content .mivo-profile-social, .mivo-profile-social.but {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 3px; position: relative; box-sizing: border-box;
    min-height: 0; height: 24px; padding: 0 9px; line-height: 1; border-radius: 99px;
  }
}

/* The dialog and backdrop start together; only composite opacity and transform. */
body .modal.fade { transition: opacity 110ms ease-out; }
body .modal.bottom.flex.fade:not(.in) { opacity: 0; }
body .modal.fade > .modal-dialog { transition: transform 110ms cubic-bezier(.2,.75,.3,1); }
body .modal.fade.in > .modal-dialog { transition: transform 150ms cubic-bezier(.2,.8,.3,1); }
body .modal-backdrop.fade { transition: opacity 110ms ease-out; }
@media (prefers-reduced-motion: no-preference) {
  body .modal.fade:not(.in):not(.bottom):not(.meo-drawer-modal) > .modal-dialog { transform: scale(.98); }
  body .modal.bottom.fade:not(.in) > .modal-dialog { transform: translateY(14px); }
}
@media (prefers-reduced-motion: reduce) {
  body .modal.fade, body .modal.fade > .modal-dialog, body .modal.fade.in > .modal-dialog, body .modal-backdrop.fade {
    transition-duration: 1ms;
  }
}

/* Keep the visible chips compact while preserving their touch area. */
.meo-square .meo-role-card :is(.meo-square-save, .meo-square-action) {min-height:0;height:24px;box-sizing:border-box;padding:0 7px;gap:4px;font-size:11px;line-height:1}
@media (pointer:coarse) {
  .meo-square .meo-role-card .meo-square-action::after {content:"";position:absolute;inset:auto -1px -6px auto;width:max(100%,44px);height:44px}
  .meo-square .meo-role-card .meo-square-save::after,.mivo-profile-social.but::after {content:'';position:absolute;inset:-10px 0}
}
.mivo-discovery fieldset.md-orders {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%;box-sizing:border-box;padding:4px;gap:4px}
.mivo-discovery .md-orders > label {display:block;width:100%;min-width:0}
.mivo-discovery .md-orders > label > span {display:flex;width:100%;box-sizing:border-box;justify-content:center;align-items:center;padding:0 6px}
.mivo-discovery .md-orders :checked + span {background:var(--focus-color-opacity1,rgba(240,80,140,.12));background:color-mix(in srgb,var(--focus-color) 11%,var(--main-bg-color))}

@media (prefers-reduced-motion: no-preference) {
  /* Keep the tap target stationary while the icon acknowledges the press. */
  :is(.meo-header-back, .meo-detail-back, .meo-header-settings, .meo-quick-close, .meo-square-icon-action) > svg {
    transition: transform 110ms ease-out;
  }
  :is(.meo-header-back, .meo-detail-back, .meo-header-settings, .meo-quick-close, .meo-square-icon-action):active > svg {
    transform: scale(.90);
    transition-duration: 0s;
  }
}
@keyframes mivo-drawer-in { from { transform: translateX(12px); opacity: .92; } to { transform: none; } }
@keyframes mivo-drawer-out { from { transform: none; } to { transform: translateX(12px); opacity: 0; } }
@keyframes mivo-drawer-under { from { transform: translateX(-6px); } to { transform: none; } }

@media (min-width: 768px) {
  :root:not(.meo-home-app):has(body) { background-color: #fdfcfe; }
  :root:not(.meo-home-app):has(body.dark-theme) { background-color: #2f3135; }
  :root:not(.meo-home-app):has(.meo-call-body) { background-color: #151620; }
  :is(.meo-home-app, [data-mivo-immersive]) body > header.header {
    border-top: var(--mivo-cutout-top, env(safe-area-inset-top, 0px)) solid transparent;
  }
  :is(.meo-home-app, [data-mivo-immersive]) body.nav-fixed:not(.meo-chat-body, .meo-role-detail-body) {
    padding-top: calc(88px + var(--mivo-cutout-top, env(safe-area-inset-top, 0px)));
  }
}
@media (max-width: 767px) {
  :root {
    --mivo-default-top-color: var(--mivo-initial-canvas, #fff);
    --mivo-top-color: var(--mivo-header-tint, var(--mivo-default-top-color));
    background-color: var(--mivo-top-color);
  }
  :root:has(body) { --mivo-default-top-color: #fff; }
  :root:has(body.dark-theme) { --mivo-default-top-color: #37383a; }
  :root:has(body.dark-theme .meo-chat-header) { --mivo-default-top-color: #323335; }
  :root:has(.meo-call-body) { --mivo-default-top-color: #151620; }
  :root:has(body.mobile-navbar-show) { --mivo-default-top-color: #fff; }
  :root:has(body.dark-theme.mobile-navbar-show) { --mivo-default-top-color: #323335; }
  /* With the site header hidden, these native mobile controls start at the page edge. */
  :root.meo-home-app body.mivo-inner-page:not(.nav-fixed, .meo-chat-body):has(> header.header):has(> main.meo-square, > main .meo-message-center, > main .user-center) {
    padding-top: var(--mivo-safe-area-top);
  }
  :root.meo-home-app body:has(.user-center) > .drawer-header { top: var(--mivo-safe-area-top); }
  body > header.header {
    border-top: var(--mivo-cutout-top, env(safe-area-inset-top, 0px)) solid transparent;
  }
  body.mobile-navbar-show {
    background-color: var(--main-bg-color, #fff) !important;
  }
  body > .mobile-header > .mobile-navbar {
    padding-top: calc(10px + var(--mivo-cutout-top, env(safe-area-inset-top, 0px)));
  }
  body.mobile-navbar-show > .mobile-header > .mobile-navbar {
    z-index: 1000;
  }
  body.nav-fixed:not(.meo-chat-body, .meo-role-detail-body) {
    padding-top: calc(72px + var(--mivo-cutout-top, env(safe-area-inset-top, 0px)));
  }
  body.meo-chat-body .meo-chat-header {
    padding-top: calc(9px + var(--mivo-cutout-top, env(safe-area-inset-top, 0px)));
    background: var(--meo-bg);
  }
  /* Use the bottom tabs or role detail back link as the mobile navigation. */
  body.meo-hide-mobile-header:has(.footer-tabbar, .meo-role-detail) > header.header {
    display: none;
  }
  body.meo-hide-mobile-header:has(> header.header):has(.footer-tabbar, .meo-role-detail) {
    padding-top: var(--mivo-cutout-top, env(safe-area-inset-top, 0px));
  }
  body.meo-hide-mobile-header:has(> header.header):has(.footer-tabbar, .meo-role-detail):has(> .header-slider-container, > .meo-role-detail) {
    padding-top: 0;
  }
  body.meo-hide-mobile-header.nav-fixed:has(.footer-tabbar) > .header-slider-container .slide-header {
    margin-top: 0;
  }
  body.meo-hide-mobile-header:has(.footer-tabbar) > .header-slider-container .slide-header .slide-text {
    padding-top: max(52px, calc(var(--mivo-cutout-top, env(safe-area-inset-top, 0px)) + 12px));
  }
  body.meo-role-detail-body:is(.meo-hide-mobile-header, .mivo-inner-page) > .meo-role-detail .meo-detail-hero-inner {
    padding-top: calc(16px + var(--mivo-cutout-top, env(safe-area-inset-top, 0px)));
  }
}
.meo-notification-device { margin-top: 8px; gap: 12px; }
.meo-notification-device [data-meo-push-enable] { min-height: 36px; padding: 6px 18px; }
[data-meo-notification-settings] label[aria-busy="true"] .form-switch { opacity: .55; }
.meo-notification-device [data-meo-push-status] { line-height: 1.6; }
@media (max-width: 767px) {
  .user-center-content.drawer-sm:has(#user-tab-msg.active) { scrollbar-width: none; }
  .user-center-content.drawer-sm:has(#user-tab-msg.active)::-webkit-scrollbar { display: none; }
}
[data-meo-push-status]:empty { display: none; }
[data-meo-push-status] { margin: 8px 0 0; color: var(--muted-color); font-size: 13px; }

/* Keep artwork edge-to-edge and controls inside the physical cutout in the native app. */
:root[data-mivo-immersive] :is(body > header.header, .meo-chat-header, .footer-tabbar, .meo-detail-hero-inner) {
  border-left: var(--mivo-cutout-left) solid transparent;
  border-right: var(--mivo-cutout-right) solid transparent;
}
:root[data-mivo-immersive] .footer-tabbar { border-bottom: var(--mivo-cutout-bottom) solid transparent; }
:root[data-mivo-immersive] body.mivo-inner-page:not(.nav-fixed, .meo-chat-body):has(> main .meo-message-center, > main .user-center, > main.meo-square) {
  padding-top: var(--mivo-cutout-top);
}

@media (max-width: 768px) {
  .meo-detail-column:has(#respond.mobile-fixed.show) { z-index: auto; }
}

/* Native status bar canvas for the full-screen role editor, including the photo picker return. */
html:root[data-mivo-editor-canvas], html:root[data-mivo-editor-canvas] > body.mivo-authoring {
  background:var(--mivo-header-tint) !important;
}
html[data-mivo-crop-canvas] #mivo-app-root.role-authoring,
html[data-mivo-crop-canvas] #mivo-app-root.role-authoring > .script-header {background:var(--mivo-header-tint)}
html[data-mivo-crop-canvas],html[data-mivo-crop-canvas] > body {color-scheme:only dark !important}

/* Native Zibll notifications share the viewport centre, including multiple brief notices. */
body .notyn {inset:0;margin:auto;width:max-content;height:fit-content;max-width:min(340px,calc(100vw - 40px));pointer-events:none}
body .notyn > .noty1 {display:flex;justify-content:center}
body .notyn .notyf {min-width:0;float:none;margin:3px 0;padding:10px 16px;border-radius:10px;text-align:center;overflow-wrap:anywhere;transform:none;animation:none;pointer-events:auto}
body .notyn .notyf::before {display:none}
body .notyn .notyn-out .notyf {opacity:0;transform:none}
body .meo-call-toast {top:50%;bottom:auto;transform:translate(-50%,-50%)}
#mivo-creation-toast[popover] {inset:50% auto auto 50%;margin:0;padding:0;border:0;background:transparent}
