/* UI helpers shared across pages */
:root {
  --floating-nav-height: 4.25rem;
  --floating-nav-bottom-gap: 0px;
  --floating-nav-bottom-safe-offset: 0px;
  --floating-nav-bottom-offset: calc(var(--floating-nav-bottom-safe-offset) + var(--floating-nav-bottom-gap));
  --floating-nav-total-height: calc(var(--floating-nav-height) + var(--floating-nav-bottom-offset));
  --settings-drawer-toggle-min-top: 104px;
  --settings-drawer-footer-bottom-gap: 0px;
  --ad-banner-height: 0px;
  --mm-fixed-ad-height: clamp(56px, 8.6vh, 78px);
  --mm-fixed-ad-screen-gap: clamp(0.62rem, 2.4vw, 1.15rem);
  --mm-fixed-ad-nav-gap: clamp(0.34rem, 1.1vh, 0.72rem);
  --mm-fixed-ad-content-gap: clamp(0.45rem, 1.1vh, 0.95rem);
  --mm-fixed-ad-runtime-height: var(--mm-fixed-ad-height);
}

:root.mm-standalone {
  --floating-nav-bottom-safe-offset: env(safe-area-inset-bottom, 0px);
  --floating-nav-bottom-gap: clamp(0.55rem, 1.4vh, 0.9rem);
  --settings-drawer-footer-bottom-gap: clamp(0.12rem, 0.45vh, 0.32rem);
}

[hidden] {
  display: none !important;
}

.adblock-banner {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: block;
  padding: 0.9rem 2.1rem 0.9rem 1rem;
  background: #fff4cf;
  border: 1px solid #f59e0b;
  border-radius: 12px;
  box-shadow: none;
  z-index: 12000;
  max-width: min(1020px, calc(100vw - 2rem));
  width: min(1020px, calc(100vw - 2rem));
}

.adblock-banner p {
  margin: 0;
  color: #5a3a00;
  font-size: 0.92rem;
  line-height: 1.42;
}

.adblock-close-btn {
  position: absolute;
  top: 0.28rem;
  right: 0.38rem;
  width: 1.4rem;
  height: 1.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  outline: none;
  background: transparent;
  color: #5a3a00;
  box-shadow: none;
  border-radius: 0;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  margin: 0;
  transition: none;
}

.adblock-close-btn:hover,
.adblock-close-btn:focus,
.adblock-close-btn:focus-visible,
.adblock-close-btn:active {
  background: transparent;
  box-shadow: none;
  border: none;
  outline: none;
  color: #5a3a00;
}

html[data-theme="dark"] .adblock-banner {
  background: #2a1c00;
  border-color: #f6b93b;
}

html[data-theme="dark"] .adblock-banner p,
html[data-theme="dark"] .adblock-close-btn,
html[data-theme="dark"] .adblock-close-btn:hover,
html[data-theme="dark"] .adblock-close-btn:focus,
html[data-theme="dark"] .adblock-close-btn:focus-visible,
html[data-theme="dark"] .adblock-close-btn:active {
  color: #ffd98a;
}

@media (max-width: 640px) {
  .adblock-banner {
    border-radius: 10px;
    padding: 0.82rem 1.9rem 0.82rem 0.86rem;
  }

  .adblock-banner p {
    font-size: 0.87rem;
  }

  .adblock-close-btn {
    top: 0.23rem;
    right: 0.32rem;
  }
}

.mm-cookie-reject-notice {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem var(--mm-header-padding, 1.5rem) 0.5rem;
  background: color-mix(in srgb, #ffefef 82%, var(--bg-soft) 18%);
  border-bottom: 1px solid color-mix(in srgb, #c62828 34%, var(--surface-border));
}

.mm-cookie-reject-notice__text {
  margin: 0;
  color: #b42318;
  font-size: 0.82rem;
  line-height: 1.45;
}

.mm-cookie-reject-notice__text a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mm-cookie-reject-notice__dismiss {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: none;
  color: #b42318;
  cursor: pointer;
  font-size: 0.79rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: none;
  filter: none;
  transition: none;
  padding: 0;
}

.mm-cookie-reject-notice__dismiss:hover,
.mm-cookie-reject-notice__dismiss:focus-visible {
  background: none;
  border: 0;
  box-shadow: none;
  text-decoration: none;
  filter: none;
  outline: none;
  opacity: 1;
}

#mm-cookie-reject-notice[hidden] {
  display: none !important;
}

html[data-theme="dark"] .mm-cookie-reject-notice {
  background: color-mix(in srgb, #2a0f12 64%, var(--bg-soft) 36%);
  border-bottom-color: color-mix(in srgb, #d32f2f 36%, var(--surface-border));
}

html[data-theme="dark"] .mm-cookie-reject-notice__text,
html[data-theme="dark"] .mm-cookie-reject-notice__dismiss {
  color: #ff8f88;
}

.mm-cookie-banner {
  position: fixed;
  left: 50%;
  bottom: calc(var(--floating-nav-total-height) + 0.85rem);
  transform: translateX(-50%);
  width: min(980px, calc(100vw - 1.2rem));
  border: 1px solid color-mix(in srgb, var(--primary) 36%, var(--surface-border));
  background: color-mix(in srgb, var(--bg-soft) 92%, #0b1020 8%);
  border-radius: 16px;
  padding: 0.85rem 0.95rem;
  z-index: 12020;
  display: grid;
  gap: 0.72rem;
}

#mm-cookie-banner[hidden] {
  display: none !important;
}

.mm-cookie-banner__body h3 {
  margin: 0 0 0.3rem;
  font-size: 1.03rem;
  letter-spacing: -0.01em;
}

.mm-cookie-banner__body p {
  margin: 0.18rem 0;
  color: var(--muted);
  font-size: 0.91rem;
  line-height: 1.45;
}

.mm-cookie-banner__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
}

.mm-cookie-banner__links a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.mm-cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mm-cookie-banner__actions button {
  min-height: 36px;
}

.mm-cookie-panel {
  position: fixed;
  inset: 0;
  z-index: 12040;
  display: grid;
  place-items: center;
}

.mm-cookie-panel__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 11, 23, 0.58);
}

.mm-cookie-panel__dialog {
  position: relative;
  width: min(700px, calc(100vw - 1.3rem));
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--surface-border));
  background: var(--surface);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 22px 60px rgba(7, 10, 24, 0.34);
  z-index: 1;
}

.mm-cookie-panel__close {
  position: absolute;
  right: 0.45rem;
  top: 0.42rem;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 1.02rem;
  line-height: 1;
}

.mm-cookie-panel__dialog h3 {
  margin: 0 0 0.25rem;
  font-size: 1.12rem;
}

.mm-cookie-panel__intro {
  margin: 0 0 0.8rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.mm-cookie-panel__rows {
  display: grid;
  gap: 0.55rem;
}

.mm-cookie-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.62rem 0.74rem;
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-soft) 88%, var(--surface) 12%);
}

.mm-cookie-row__text {
  display: grid;
  gap: 0.2rem;
}

.mm-cookie-row__text small {
  color: var(--muted);
  line-height: 1.35;
}

.mm-cookie-row--required {
  opacity: 0.9;
}

.mm-cookie-row input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
}

.mm-cookie-panel__meta {
  margin: 0.62rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.mm-cookie-panel__actions {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mm-cookie-panel__actions button {
  min-height: 36px;
}

.mm-cookie-manage-btn {
  position: fixed;
  left: 0.74rem;
  bottom: calc(var(--floating-nav-total-height) + 0.74rem);
  z-index: 12010;
  border: 1px solid color-mix(in srgb, var(--primary) 42%, var(--surface-border));
  background: color-mix(in srgb, var(--surface) 88%, var(--bg-soft) 12%);
  color: var(--text);
  border-radius: 999px;
  padding: 0.4rem 0.72rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
}

@media (max-width: 740px) {
  .mm-cookie-reject-notice {
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.42rem 1rem 0.48rem;
  }

  .mm-cookie-reject-notice__text {
    font-size: 0.78rem;
    line-height: 1.38;
  }

  .mm-cookie-reject-notice__dismiss {
    font-size: 0.75rem;
  }

  .mm-cookie-banner {
    bottom: calc(var(--floating-nav-total-height) + 0.7rem);
    padding: 0.75rem 0.74rem;
    border-radius: 12px;
  }

  .mm-cookie-banner__body h3 {
    font-size: 0.98rem;
  }

  .mm-cookie-banner__body p {
    font-size: 0.86rem;
  }

  .mm-cookie-panel__dialog {
    border-radius: 12px;
    padding: 0.78rem;
  }

  .mm-cookie-manage-btn {
    bottom: calc(var(--floating-nav-total-height) + 0.6rem);
    padding: 0.35rem 0.62rem;
    font-size: 0.78rem;
  }
}

html:not([data-mm-monetization-enabled="1"]) [data-mm-monetization-only] {
  display: none !important;
}

html.mm-monetization-hidden [data-mm-ad-slot],
html.mm-monetization-hidden #page-ad-banner,
html.mm-monetization-hidden .ad-card,
html.mm-monetization-hidden .mm-sitewide-ad-slot,
html.mm-monetization-hidden .ad-banner-bar,
html.mm-monetization-hidden .badge-ads,
html.mm-monetization-hidden .adblock-banner,
html.mm-monetization-hidden [data-mm-monetization-only],
html.mm-monetization-hidden a[href$="pubblicita-responsabile.html"],
html.mm-monetization-hidden a[href*="/pubblicita-responsabile.html"] {
  display: none !important;
}

html.mm-cookie-ads-disabled [data-mm-ad-slot],
html.mm-cookie-ads-disabled #page-ad-banner,
html.mm-cookie-ads-disabled .ad-card,
html.mm-cookie-ads-disabled .mm-sitewide-ad-slot,
html.mm-cookie-ads-disabled .ad-banner-bar,
html.mm-cookie-ads-disabled .adblock-banner,
html.mm-cookie-ads-disabled .badge-ads {
  display: none !important;
}

#cookie-ads-support-box[hidden] {
  display: none !important;
}

.page-header {
  position: fixed;
  inset: 0 0 auto;
  width: 100%;
  z-index: 10000;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  --mm-header-padding: 1.5rem;
  --mm-header-logo-size: 80px;
  --mm-header-h1-size: clamp(1.55rem, 2.4vw, 2.05rem);
  --mm-header-toggle-size: 40px;
  --mm-header-eyebrow-size: 0.82rem;
  --mm-header-action-pad: 0.42rem 0.76rem;
  --mm-header-action-font-size: 0.88rem;
  padding: var(--mm-header-padding);
  background: var(--bg-soft);
  border-bottom: 1px solid var(--surface-border);
  transition: padding 220ms ease, gap 220ms ease;
  will-change: padding;
}

body.home-page .page-header {
  position: fixed;
  inset: 0 0 auto;
  width: 100%;
}

body.home-page .page-content {
  padding-top: calc(var(--mm-page-header-content-offset, var(--mm-page-header-offset, 128px)) + 1.5rem);
}

:root body.settings-page .settings-nav-bar {
  display: none;
}

:root body.settings-page .settings-header-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.04rem;
  min-width: 0;
}

:root body.settings-page .page-header {
  align-items: center;
  padding-bottom: 0.2rem;
}

:root.mm-standalone .page-header {
  top: env(safe-area-inset-top, 0px);
}

.logo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
  transition: transform 220ms ease;
  transform-origin: left top;
}

.logo-link .logo-img {
  display: inline-flex;
}

.logo-link img {
  width: var(--mm-header-logo-size);
  height: var(--mm-header-logo-size);
  border-radius: 12px;
  object-fit: contain;
  padding: 6px;
  border: none;
  box-shadow: none;
  background: transparent;
  transition: width 220ms ease, height 220ms ease;
}

:root[data-theme="dark"] .logo-link img {
  content: url("/assets/img/logo-dark.svg");
}

/* Auth pages: keep logo visible on desktop, smaller on mobile */
.auth-card .logo-link {
  gap: 0.5rem;
}

.auth-card .logo-link .logo-img {
  min-width: 64px;
  flex-shrink: 0;
}

.auth-card .logo-link img {
  width: var(--mm-auth-header-logo-size, 72px);
  height: var(--mm-auth-header-logo-size, 72px);
  padding: 4px;
  max-width: var(--mm-auth-header-logo-size, 72px);
  max-height: var(--mm-auth-header-logo-size, 72px);
  transition: width 220ms ease, height 220ms ease;
}

@media (max-width: 520px) {
  .auth-card .logo-link img {
    width: 56px !important;
    height: 56px !important;
    max-width: 56px !important;
    max-height: 56px !important;
    padding: 2px;
  }
}

.inline-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-controls {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.58rem;
}

.theme-toggle.theme-toggle-header {
  width: var(--mm-header-toggle-size);
  height: var(--mm-header-toggle-size);
  min-width: var(--mm-header-toggle-size);
  min-height: var(--mm-header-toggle-size);
  box-shadow: none;
  border-color: color-mix(in srgb, var(--surface-border) 78%, var(--text) 22%);
  transition:
    width 220ms ease,
    height 220ms ease,
    min-width 220ms ease,
    min-height 220ms ease,
    border-color 180ms ease;
}

.theme-toggle,
.theme-toggle:hover,
.theme-toggle:focus,
.theme-toggle:focus-visible,
.theme-toggle:active {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-color: color-mix(in srgb, var(--surface-border) 78%, var(--text) 22%) !important;
  box-shadow: none !important;
  transform: none !important;
  filter: none !important;
  outline: none !important;
}

.btn-block {
  width: 100%;
  display: inline-flex;
  justify-content: center;
}

.page-header h1 {
  font-size: var(--mm-header-h1-size);
  margin: 0 0 0.25rem;
  transition: font-size 220ms ease;
}

.page-header .eyebrow {
  font-size: var(--mm-header-eyebrow-size);
  transition: font-size 220ms ease;
}

.page-header .home-subtitle {
  display: block;
  margin: 0.08rem 0 0;
  font-size: 0.76rem;
  line-height: 1.2;
  color: var(--muted);
}

.page-header .header-controls,
.page-header .header-auth-actions {
  transition: gap 220ms ease;
}

.page-header .header-auth-actions a {
  padding: var(--mm-header-action-pad);
  font-size: var(--mm-header-action-font-size);
  line-height: 1.1;
  transition:
    padding 220ms ease,
    font-size 220ms ease,
    color 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease;
}

.page-header .logo-link > div > p:not(.eyebrow) {
  display: none !important;
}

.page-header.is-compact {
  --mm-header-padding: 0.9rem 1.1rem;
  --mm-header-logo-size: 54px;
  --mm-header-h1-size: clamp(1.25rem, 2.0vw, 1.65rem);
  --mm-header-toggle-size: 34px;
  --mm-header-eyebrow-size: 0.72rem;
  --mm-header-action-pad: 0.36rem 0.66rem;
  --mm-header-action-font-size: 0.82rem;
}

.page-header.is-compact .logo-link img {
  border-radius: 10px;
}

.page-content {
  padding: 1.5rem;
  padding-top: calc(var(--mm-page-header-content-offset, var(--mm-page-header-offset, 128px)) + 1.5rem);
  padding-bottom: calc(0.5rem + var(--floating-nav-total-height) + var(--ad-banner-height));
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

body.settings-page .page-content {
  padding-top: calc(var(--mm-page-header-content-offset, var(--mm-page-header-offset, 128px)) + 1.5rem);
}

body.mm-has-fixed-bottom-ad .page-content {
  padding-bottom: calc(
    var(--floating-nav-total-height) +
    var(--mm-fixed-ad-nav-gap) +
    var(--mm-fixed-ad-runtime-height) +
    var(--mm-fixed-ad-content-gap)
  );
}

html[data-mm-compose-embed="1"],
body.mm-compose-embed {
  background: transparent;
}

body.mm-compose-embed .page-header,
body.mm-compose-embed #home-guest,
body.mm-compose-embed #home-user > *:not(#post-modal),
body.mm-compose-embed .floating-nav,
body.mm-compose-embed #page-ad-banner,
body.mm-compose-embed .mm-cookie-reject-notice {
  display: none !important;
}

body.mm-compose-embed .page-content {
  max-width: none;
  padding: 0;
  margin: 0;
  background: transparent;
}

body.mm-compose-embed #home-user {
  display: block !important;
  background: transparent;
}

body.mm-compose-embed #post-modal {
  display: grid;
  visibility: visible;
  pointer-events: auto;
  background: transparent;
}

body.mm-compose-embed #post-modal .modal-backdrop {
  display: none;
}

body.mm-compose-embed #post-modal .modal-dialog {
  width: min(760px, 96vw);
  max-width: min(760px, 96vw);
  height: min(100%, 100dvh);
  max-height: 100dvh;
  margin: auto;
}

body.mm-compose-embed #post-modal .modal-content,
body.mm-compose-embed #post-modal .modal-dialog > .card,
body.mm-compose-embed #post-modal .modal-dialog > .modal-content {
  min-height: 0;
  max-height: min(100%, 100dvh);
  transform: none !important;
  opacity: 1 !important;
  transition: none !important;
  animation: none !important;
}

.mm-pull-refresh-indicator {
  --mm-pull-progress: 0;
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 0.55rem);
  left: 50%;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, calc(-130% + (var(--mm-pull-progress) * 138%)))
    scale(calc(0.88 + (var(--mm-pull-progress) * 0.12)));
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    border-color 0.18s ease,
    background-color 0.18s ease;
  z-index: 26000;
}

.mm-pull-refresh-indicator.is-visible,
.mm-pull-refresh-indicator.is-refreshing {
  opacity: 1;
}

.mm-pull-refresh-indicator.is-armed {
  border-color: transparent;
  background: transparent;
}

.mm-pull-refresh-spinner {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2.5px solid color-mix(in srgb, var(--text) 18%, transparent);
  border-top-color: var(--primary);
  transition: border-color 0.18s ease;
}

.mm-pull-refresh-indicator.is-visible .mm-pull-refresh-spinner,
.mm-pull-refresh-indicator.is-refreshing .mm-pull-refresh-spinner {
  animation: mm-pull-refresh-spin 0.75s linear infinite;
}

@keyframes mm-pull-refresh-spin {
  to {
    transform: rotate(1turn);
  }
}

.settings-nav-bar {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: calc(var(--mm-page-header-content-offset, var(--mm-page-header-offset, 128px)) + 0.4rem);
}

.settings-pill-row {
  display: none;
}

.settings-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  position: relative;
}

.settings-nav-item__label {
  display: inline-flex;
  align-items: center;
}

.settings-pill[aria-selected="true"] {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 14%, var(--surface));
  color: var(--primary);
}

.settings-pill[data-key="social"] {
  border-color: #facc15;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #facc15 46%, transparent);
}

.settings-pill[data-key="social"][aria-selected="true"] {
  border-color: #eab308;
  background: color-mix(in srgb, #fef08a 34%, var(--surface));
  color: color-mix(in srgb, var(--text) 88%, #a16207 12%);
}

.settings-pill[data-key="users-qr"] {
  border-color: #34d399;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #34d399 42%, transparent);
}

.settings-pill[data-key="users-qr"][aria-selected="true"] {
  border-color: #10b981;
  background: color-mix(in srgb, #bbf7d0 30%, var(--surface));
  color: color-mix(in srgb, var(--text) 88%, #065f46 12%);
}

.nav-hamburger {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-direction: column;
  cursor: pointer;
  padding: 8px;
  transition: background 0.12s ease, border-color 0.12s ease;
  position: fixed;
  top: calc(max(calc(var(--settings-drawer-offset, 0px) + var(--settings-drawer-top, 0px)), var(--settings-drawer-toggle-min-top)) + 8px);
  left: 12px;
  z-index: 10020;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.06);
}

:root body.settings-page .settings-header-toggle {
  position: static;
  top: auto;
  left: auto;
  z-index: auto;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  gap: 3px;
  transform: none;
  transition: none;
  align-self: flex-start;
}

:root body.settings-page .settings-header-toggle:hover,
:root body.settings-page .settings-header-toggle:focus,
:root body.settings-page .settings-header-toggle:focus-visible,
:root body.settings-page .settings-header-toggle:active {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  transform: none;
}

:root body.settings-page .settings-header-toggle .hamburger-line {
  width: 14px;
  height: 2px;
  transition: transform 180ms ease, opacity 180ms ease;
  transform-origin: center;
}

:root body.settings-page .settings-header-toggle.is-open .hamburger-line:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

:root body.settings-page .settings-header-toggle.is-open .hamburger-line:nth-child(2) {
  opacity: 0;
}

:root body.settings-page .settings-header-toggle.is-open .hamburger-line:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

:root body.settings-page .settings-header-toggle[hidden] {
  display: none !important;
}

:root body.settings-page .page-header.has-theme-toggle-only .header-controls {
  margin-left: auto;
  align-items: center;
  justify-content: flex-end;
}

.nav-hamburger:hover,
.nav-hamburger:focus,
.nav-hamburger:focus-visible,
.nav-hamburger:active {
  background: var(--surface) !important;
  border-color: var(--surface-border) !important;
  color: inherit !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.06) !important;
  outline: none;
  transform: none;
}

.nav-hamburger .hamburger-line {
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 999px;
  transition: transform 140ms ease, opacity 140ms ease;
}

.nav-hamburger.is-open .hamburger-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-hamburger.is-open .hamburger-line:nth-child(2) {
  opacity: 0;
}
.nav-hamburger.is-open .hamburger-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.settings-drawer-backdrop {
  position: fixed;
  inset: var(--settings-drawer-top, 0) 0 0 0;
  background: rgba(0, 0, 0, 0.25);
  z-index: 290;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.settings-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.settings-drawer {
  position: fixed;
  top: var(--settings-drawer-top, 0);
  left: 0;
  height: calc(100vh - var(--settings-drawer-top, 0));
  width: min(320px, 25vw);
  background: var(--surface);
  border-right: 1px solid var(--surface-border);
  box-shadow: 8px 0 28px rgba(0, 0, 0, 0.12);
  z-index: 300;
  transform: translateX(-100%);
  transition: transform 160ms ease;
  display: flex;
  flex-direction: column;
}

@supports (height: 100dvh) {
  :root.mm-standalone .settings-drawer {
    height: calc(100dvh - var(--settings-drawer-top, 0));
  }
}

.settings-drawer.is-open {
  transform: translateX(0);
}

.drawer-header {
  display: none;
}

.drawer-close {
  background: transparent;
  border: none;
  border-radius: 0;
  width: 34px;
  height: 34px;
  cursor: pointer;
  box-shadow: none;
}

.drawer-close--floating {
  position: absolute;
  top: 0.3rem;
  right: 0.45rem;
  z-index: 3;
}

.drawer-list {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0 0.6rem;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 0.25rem;
  overflow-y: auto;
}

.drawer-list button {
  width: 100%;
  text-align: left;
  padding: 0.7rem 1rem;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
  position: relative;
}

.settings-nav-badge {
  position: absolute;
  top: 0.3rem;
  right: 0.42rem;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.communications-section {
  gap: 0.75rem;
}

.communications-section__head {
  align-items: flex-start;
  gap: 0.7rem;
}

.communications-mark-all-btn {
  appearance: none;
  -webkit-appearance: none;
  align-self: flex-start;
  background: transparent !important;
  color: var(--text) !important;
  border: 1px solid var(--surface-border) !important;
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1;
  min-height: 36px;
  box-shadow: none !important;
  transform: none !important;
  transition: none !important;
}

.communications-mark-all-btn:hover,
.communications-mark-all-btn:focus,
.communications-mark-all-btn:focus-visible,
.communications-mark-all-btn:active {
  background: transparent !important;
  color: var(--text) !important;
  border-color: var(--surface-border) !important;
  box-shadow: none !important;
  transform: none !important;
}

.communications-mark-all-btn[disabled] {
  opacity: 0.55;
  cursor: default;
}

.communications-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.communications-item {
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  overflow: hidden;
}

.communications-item.is-unread {
  border-color: color-mix(in srgb, #ef4444 42%, var(--surface-border));
}

.communications-item__trigger {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.9rem 1rem;
  box-shadow: none;
  transform: none;
}

.communications-item__trigger:hover,
.communications-item__trigger:focus,
.communications-item__trigger:focus-visible,
.communications-item__trigger:active {
  background: transparent;
  box-shadow: none;
  transform: none;
}

.communications-item__title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.24rem;
  min-width: 0;
}

.communications-item__title {
  font-weight: 800;
  color: var(--text);
}

.communications-item__date {
  color: var(--muted);
  font-size: 0.82rem;
}

.communications-item__chevron {
  font-size: 1rem;
  font-weight: 800;
  color: var(--muted);
  line-height: 1;
  padding-top: 0.1rem;
}

.communications-item.is-open .communications-item__chevron {
  transform: rotate(45deg);
}

.communications-item__body {
  border-top: 1px solid color-mix(in srgb, var(--surface-border) 92%, transparent);
  padding: 0.9rem 1rem 1rem;
}

.communications-item__message {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.55;
  color: var(--text);
}

.communications-item__message p,
.communications-item__message div {
  margin: 0 0 0.65rem;
}

.communications-item__message p:last-child,
.communications-item__message div:last-child {
  margin-bottom: 0;
}

.drawer-list button[aria-current="true"] {
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
  border-color: var(--primary);
  color: var(--primary);
}

.drawer-list button[data-key="social"] {
  border-left-color: #facc15;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #facc15 52%, transparent);
  background: color-mix(in srgb, #fef3c7 40%, var(--surface));
}

.drawer-list button[data-key="social"][aria-current="true"] {
  border-left-color: #eab308;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #facc15 60%, transparent);
  background: color-mix(in srgb, #fde68a 54%, var(--surface));
  color: color-mix(in srgb, var(--text) 88%, #a16207 12%);
}

.drawer-list button[data-key="users-qr"] {
  border-left-color: #34d399;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #34d399 48%, transparent);
  background: color-mix(in srgb, #dcfce7 46%, var(--surface));
}

.drawer-list button[data-key="users-qr"][aria-current="true"] {
  border-left-color: #10b981;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #10b981 52%, transparent);
  background: color-mix(in srgb, #bbf7d0 58%, var(--surface));
  color: color-mix(in srgb, var(--text) 88%, #065f46 12%);
}

.drawer-footer {
  padding: 0.75rem 0.95rem 0.9rem;
  border-top: none;
  display: grid;
  gap: 0.28rem;
}

.drawer-install-btn,
.drawer-logout-btn {
  width: 100%;
  justify-content: center;
}

.drawer-install-message {
  margin: 0;
  min-height: 0;
  line-height: 1.2;
}

.drawer-install-message:empty {
  display: none;
}

body.settings-page:not(.settings-drawer-desktop) .drawer-footer {
  /* Keep logout clear of the fixed bottom navbar on mobile/tablet. */
  padding-bottom: calc(var(--floating-nav-height) + env(safe-area-inset-bottom, 0px) + var(--floating-nav-bottom-gap) + var(--settings-drawer-footer-bottom-gap) + 0.95rem);
}

body.settings-page.settings-drawer-desktop .drawer-footer {
  /* Keep logout above the fixed bottom navbar also on desktop settings layout. */
  padding-bottom: calc(var(--floating-nav-height) + env(safe-area-inset-bottom, 0px) + var(--floating-nav-bottom-gap) + var(--settings-drawer-footer-bottom-gap) + 0.95rem);
}

.settings-section-hidden {
  display: none !important;
}

#settings-notifications-card {
  scroll-margin-top: calc(var(--settings-drawer-top, 0px) + 1rem);
}

.settings-notify-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  column-gap: 1.25rem;
  row-gap: 0.45rem;
}

.settings-notify-grid__colhead {
  text-transform: uppercase;
  text-align: center;
}

.settings-notify-grid__colhead:first-child {
  grid-column: 2;
}

.settings-notify-grid__colhead:last-child {
  grid-column: 3;
}

.settings-notify-grid__label {
  align-self: center;
}

.settings-notify-grid__choice {
  display: flex;
  justify-content: center;
}

.settings-card-highlight {
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--primary) 44%, transparent),
    0 16px 34px color-mix(in srgb, var(--primary) 14%, transparent);
  transition: box-shadow 0.22s ease;
}

.share-section {
  display: grid;
  gap: 0.9rem;
}

.share-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.share-section__head h2 {
  margin: 0;
}

.share-subsection {
  margin-top: 0.18rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--surface-border);
  display: grid;
  gap: 0.72rem;
}

.share-subsection__title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
}

.share-copy-box {
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  padding: 0.72rem;
  background: color-mix(in srgb, var(--surface-strong) 68%, var(--surface) 32%);
}

.share-copy-label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}

.share-copy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  margin-bottom: 0.34rem;
}

.share-copy-copybtn {
  appearance: none;
  -webkit-appearance: none;
  width: 1.95rem;
  height: 1.95rem;
  border-radius: 9px;
  border: 1px solid color-mix(in srgb, var(--surface-border) 74%, var(--text) 26%);
  background: transparent !important;
  box-shadow: none !important;
  color: color-mix(in srgb, var(--text) 72%, var(--primary) 28%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  min-height: 0;
  transform: none !important;
  transition: none;
}

.share-copy-copybtn:hover,
.share-copy-copybtn:active,
.share-copy-copybtn:focus-visible {
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
  border-color: color-mix(in srgb, var(--surface-border) 64%, var(--text) 36%);
  color: color-mix(in srgb, var(--text) 80%, var(--primary) 20%);
}

.share-copy-copybtn svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
  stroke-width: 1.9;
  fill: none;
}

.share-copy-text {
  width: 100%;
  margin: 0;
  box-sizing: border-box;
  min-height: 0;
  height: auto;
  resize: none;
  overflow: hidden;
  font-size: 0.86rem;
  line-height: 1.45;
  border-radius: 11px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text);
  padding: 0.62rem 0.7rem;
}

.share-copy-msg {
  margin: 0.45rem 0 0;
  min-height: 1rem;
}

.share-admin-tools {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: nowrap;
}

.share-admin-tools[hidden] {
  display: none !important;
}

.share-admin-tools .btn-compact {
  min-height: 2rem;
  white-space: nowrap;
}

.share-admin-tools .ghost-danger[disabled] {
  opacity: 0.58;
}

.share-admin-msg {
  margin: -0.25rem 0 0;
  min-height: 1rem;
}

.share-admin-msg:empty {
  min-height: 0;
  margin: 0;
}

.share-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.72rem;
}

.share-gallery-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0.72rem;
  border: 1px dashed var(--surface-border);
  border-radius: 12px;
  background: var(--surface);
  font-size: 0.86rem;
}

.share-asset {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--surface-border);
  background: var(--surface-strong);
}

.share-asset.is-selected {
  border-color: color-mix(in srgb, var(--danger) 66%, var(--surface-border) 34%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--danger) 35%, transparent);
}

.share-asset__media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: color-mix(in srgb, var(--surface-strong) 76%, var(--bg) 24%);
  overflow: hidden;
}

.share-asset__viewport {
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

.share-asset__select {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  z-index: 4;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.share-asset__select input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.02rem;
  height: 1.02rem;
  border: 1px solid color-mix(in srgb, #111111 70%, var(--surface-border) 30%);
  border-radius: 2px;
  background: #ffffff;
  margin: 0;
  position: relative;
  box-shadow: none;
}

.share-asset__select input[type="checkbox"]:checked {
  border-color: #111111;
  background: #ffffff;
}

.share-asset__select input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.24rem;
  height: 0.48rem;
  border: solid #111111;
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -56%) rotate(45deg);
}

.share-asset__img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  transform-origin: center center;
  transition: transform 120ms ease-out;
  user-select: none;
  -webkit-user-drag: none;
}

.share-asset__media.is-zoomed .share-asset__img {
  cursor: grab;
  transition: none;
}

.share-asset__media.is-grabbing .share-asset__img {
  cursor: grabbing;
}

.share-asset__download {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 3;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 1rem;
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--surface-border) 74%, var(--text) 26%);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);
}

.share-asset__zoom-controls {
  position: absolute;
  right: 0.4rem;
  bottom: 0.4rem;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--surface-border) 68%, var(--text) 32%);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  overflow: hidden;
}

.share-asset__zoom-btn {
  appearance: none;
  -webkit-appearance: none;
  width: 1.7rem;
  height: 1.08rem;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.share-asset__zoom-btn + .share-asset__zoom-btn {
  border-left: 1px solid color-mix(in srgb, var(--surface-border) 68%, var(--text) 32%);
}

.share-asset__zoom-btn:disabled {
  opacity: 0.44;
  cursor: default;
}

.users-qr-section {
  display: grid;
  gap: 0.9rem;
}

.users-qr-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.72rem;
}

.users-qr-stat-card {
  margin: 0;
  padding: 0.72rem;
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-strong) 72%, var(--surface) 28%);
  display: grid;
  gap: 0.32rem;
}

.users-qr-stat-card__label {
  margin: 0;
  font-size: 0.79rem;
  font-weight: 700;
  color: var(--muted);
}

.users-qr-stat-card__value {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.users-qr-stat-card__hint {
  margin: 0;
  font-size: 0.74rem;
}

.users-qr-monthly-box {
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  background: var(--surface);
  padding: 0.6rem 0.7rem;
}

.users-qr-monthly-box summary {
  cursor: pointer;
  font-weight: 700;
}

.users-qr-monthly-list {
  margin-top: 0.6rem;
  display: grid;
  gap: 0.45rem;
}

.users-qr-monthly-row {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.5rem 0.55rem;
  border-radius: 10px;
  border: 1px solid var(--surface-border);
  background: color-mix(in srgb, var(--surface-strong) 70%, var(--surface) 30%);
}

.users-qr-create-box,
.users-qr-list-box {
  border: 1px solid var(--surface-border);
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface-strong) 74%, var(--surface) 26%);
  padding: 0.78rem;
  display: grid;
  gap: 0.62rem;
}

.users-qr-preview {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  background: var(--surface);
  padding: 0.52rem;
}

.users-qr-preview__img {
  width: 86px;
  height: 86px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--surface-border);
  background: #fff;
}

.users-qr-preview__meta {
  min-width: 0;
}

.users-qr-preview__title {
  margin: 0 0 0.35rem;
  font-weight: 700;
}

.users-qr-preview__meta a {
  display: block;
  font-size: 0.83rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.users-qr-list {
  display: grid;
  gap: 0.62rem;
}

.users-qr-item {
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  background: var(--surface);
  padding: 0.65rem;
  display: grid;
  gap: 0.5rem;
}

.users-qr-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.users-qr-item__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
}

.users-qr-item__counts {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.users-qr-item__counts .badge {
  font-size: 0.72rem;
}

.users-qr-item__link {
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.users-qr-item__meta {
  margin: 0;
  font-size: 0.75rem;
}

.users-qr-item__actions {
  gap: 0.45rem;
  flex-wrap: wrap;
}

.users-qr-item__actions button[disabled] {
  opacity: 0.58;
}

.users-qr-btn-danger {
  color: #dc2626;
  border-color: color-mix(in srgb, #dc2626 28%, var(--surface-border) 72%);
}

.users-qr-btn-danger:hover,
.users-qr-btn-danger:focus-visible {
  color: #b91c1c;
  border-color: color-mix(in srgb, #dc2626 50%, var(--surface-border) 50%);
  background: color-mix(in srgb, #dc2626 10%, var(--surface-strong) 90%);
}

@media (max-width: 820px) {
  .users-qr-stats-grid {
    grid-template-columns: 1fr;
  }

  .users-qr-preview {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
}

@media (max-width: 720px) {
  .share-copy-box {
    padding: 0.62rem;
  }

  .share-copy-text {
    font-size: 0.83rem;
  }
}

@media (max-width: 560px) {
  .share-section__head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .share-admin-tools {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
}

@media (max-width: 720px) {
  .settings-nav-bar {
    padding: 0 1rem 0.2rem;
  }
  .settings-drawer {
    width: 75vw;
    min-width: 240px;
  }
}

[data-section="access"] { order: 1; }
[data-section="profile"] { order: 2; }
[data-section="location"] { order: 3; }
[data-section="privacy"] { order: 4; }
[data-section="pro"] { order: 5; }
[data-section="social"] { order: 6; }

@media (min-width: 1024px) {
  .modal-close { display: none !important; }
  .video-menu-close { display: none !important; }
  body.settings-drawer-desktop .settings-drawer {
    width: 260px;
    min-width: 260px;
    transform: translateX(0);
    position: fixed;
    left: 0;
    top: var(--settings-drawer-top, 0);
    height: calc(100vh - var(--settings-drawer-top, 0));
    box-shadow: none;
    border-right: 1px solid var(--surface-border);
  }
  @supports (height: 100dvh) {
    :root.mm-standalone body.settings-drawer-desktop .settings-drawer {
      height: calc(100dvh - var(--settings-drawer-top, 0));
    }
  }
  body.settings-drawer-desktop .settings-drawer-backdrop {
    display: none !important;
  }
  body.settings-drawer-desktop .nav-hamburger {
    display: none;
    position: static;
    box-shadow: none;
  }
  body.settings-page .settings-header-toggle {
    display: none !important;
  }
  body.settings-drawer-desktop .drawer-close {
    display: none;
  }
  body.settings-drawer-desktop .settings-nav-bar,
  body.settings-drawer-desktop .page-content {
    padding-left: calc(260px + 1.5rem);
  }
  body.settings-drawer-desktop .settings-nav-bar {
    margin-left: 0;
  }
}
.faq-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 0.85rem 0.95rem;
  background: var(--surface);
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
  font-weight: 800;
  color: var(--text);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  background: var(--surface-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  line-height: 1;
}

.faq-item[open] summary::after {
  content: '–';
}

.faq-answer {
  margin-top: 0.65rem;
  color: var(--muted);
}

.faq-answer p {
  margin: 0 0 0.65rem;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.header-auth-actions {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}

:root[data-nav-state="logged-in"] .header-auth-actions {
  display: none !important;
}

@media (max-width: 640px) {
  .page-header {
    flex-direction: column;
    align-items: stretch;
    --mm-header-padding: 1.25rem 1.25rem 1rem;
    padding: var(--mm-header-padding);
  }
  .page-header.has-theme-toggle-only {
    flex-direction: row;
    align-items: center;
    position: fixed;
    padding-right: calc(var(--mm-header-toggle-size) + 1.35rem);
  }
  .header-controls {
    width: 100%;
    justify-content: flex-end;
    gap: 0.48rem;
  }
  .page-header.has-theme-toggle-only .header-controls {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    width: auto;
    margin-left: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
  }
  .page-header.has-theme-toggle-only .logo-link {
    min-width: 0;
  }
  .page-header.has-theme-toggle-only .logo-link > div {
    min-width: 0;
  }
  .header-auth-actions {
    width: auto;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .header-auth-actions a {
    flex: 0 0 auto;
    min-width: 96px;
    text-align: center;
  }
  :root[data-nav-state="logged-in"] .page-header {
    flex-direction: row;
    align-items: center;
  }
  :root[data-nav-state="logged-in"] .header-controls {
    width: auto;
    margin-left: auto;
    justify-content: flex-end;
    align-items: center;
  }
  :root[data-nav-state="logged-in"] .header-auth-actions {
    display: none !important;
  }
}

@media (max-width: 640px) {
  body.home-page .page-header {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.56rem;
    --mm-header-padding: 0.92rem 0.9rem;
    padding: var(--mm-header-padding);
  }

  body.home-page .page-content {
    padding-top: calc(var(--mm-page-header-content-offset, var(--mm-page-header-offset, 84px)) + 1rem);
  }

  body.home-page .logo-link {
    min-width: 0;
    flex: 1 1 auto;
    gap: 0.42rem;
  }

  body.home-page .logo-link img {
    width: 46px;
    height: 46px;
  }

  body.home-page .logo-link > div {
    min-width: 0;
  }

  body.home-page .page-header h1 {
    margin: 0;
    font-size: clamp(1rem, 5vw, 1.45rem);
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.1;
    max-width: 14ch;
  }

  body.home-page .page-header .eyebrow {
    margin: 0;
    font-size: 0.58rem;
    letter-spacing: 0.16em;
  }

  body.home-page .page-header .home-subtitle {
    font-size: 0.64rem;
    line-height: 1.15;
    margin-top: 0.06rem;
  }

  body.home-page .header-controls {
    width: auto;
    margin-left: auto;
    flex: 0 0 auto;
    justify-content: flex-end;
    align-items: center;
    gap: 0.3rem;
  }

  body.home-page .theme-toggle.theme-toggle-header {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
  }

  body.home-page .header-auth-actions {
    width: auto;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.3rem;
  }

  body.home-page .header-auth-actions a {
    min-width: 68px;
    padding: 0.3rem 0.44rem;
    font-size: 0.74rem;
    line-height: 1.05;
    border-radius: 10px;
    text-align: center;
  }

  /* Re-enable compact header animation on Home (guest + logged) */
  body.home-page .page-header.is-compact {
    gap: 0.42rem;
    --mm-header-padding: 0.62rem 0.76rem;
    padding: var(--mm-header-padding);
  }

  body.home-page .page-header.is-compact .logo-link {
    gap: 0.34rem;
  }

  body.home-page .page-header.is-compact .logo-link img {
    width: 38px;
    height: 38px;
  }

  body.home-page .page-header.is-compact h1 {
    font-size: clamp(0.9rem, 4.2vw, 1.2rem);
    line-height: 1.08;
    max-width: 13ch;
  }

  body.home-page .page-header.is-compact .eyebrow {
    font-size: 0.52rem;
    letter-spacing: 0.14em;
  }

  body.home-page .page-header.is-compact .home-subtitle {
    font-size: 0.54rem;
    margin-top: 0.03rem;
  }

  body.home-page .page-header.is-compact .header-controls {
    gap: 0.24rem;
  }

  body.home-page .page-header.is-compact .theme-toggle.theme-toggle-header {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
  }

  body.home-page .page-header.is-compact .header-auth-actions {
    gap: 0.24rem;
  }

  body.home-page .page-header.is-compact .header-auth-actions a {
    min-width: 60px;
    padding: 0.24rem 0.34rem;
    font-size: 0.68rem;
    border-radius: 9px;
  }
}

@media (max-width: 420px) {
  body.home-page .theme-toggle.theme-toggle-header {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
  }

  body.home-page .header-auth-actions a {
    min-width: 62px;
    padding: 0.28rem 0.38rem;
    font-size: 0.7rem;
  }

  body.home-page .page-header h1 {
    font-size: clamp(0.96rem, 4.7vw, 1.15rem);
    max-width: 13ch;
  }

  body.home-page .page-header .home-subtitle {
    font-size: 0.58rem;
  }

  body.home-page .page-header.is-compact {
    --mm-header-padding: 0.56rem 0.68rem;
  }

  body.home-page .page-header.is-compact .logo-link img {
    width: 34px;
    height: 34px;
  }

  body.home-page .page-header.is-compact h1 {
    font-size: clamp(0.84rem, 4.3vw, 1.02rem);
    max-width: 12ch;
  }

  body.home-page .page-header.is-compact .home-subtitle {
    font-size: 0.52rem;
  }
}

/* PWA iOS/Android: Home/Landing header must match logged pages header sizing + motion */
@media (max-width: 640px) {
  :root.mm-standalone[data-nav-state="logged-in"] body.home-page .page-header .eyebrow {
    letter-spacing: 0.12em;
  }

  :root.mm-standalone[data-nav-state="logged-in"] body.home-page .page-header h1,
  :root.mm-standalone[data-nav-state="logged-in"] body.home-page .page-header.is-compact h1 {
    line-height: normal;
  }

  :root.mm-standalone[data-nav-state="logged-in"] body.home-page .page-header.is-compact .eyebrow {
    letter-spacing: 0.12em;
  }

  :root.mm-standalone body.home-page .page-header {
    --mm-header-padding: 1.25rem 1.25rem 1rem;
    --mm-header-logo-size: 80px;
    --mm-header-h1-size: clamp(1.55rem, 2.4vw, 2.05rem);
    --mm-header-toggle-size: 40px;
    --mm-header-eyebrow-size: 0.82rem;
    --mm-header-action-pad: 0.42rem 0.76rem;
    --mm-header-action-font-size: 0.88rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 1rem;
    padding: var(--mm-header-padding);
  }

  :root.mm-standalone body.home-page .logo-link {
    width: 100%;
    gap: 0.6rem;
  }

  :root.mm-standalone body.home-page .logo-link img {
    width: var(--mm-header-logo-size);
    height: var(--mm-header-logo-size);
  }

  :root.mm-standalone body.home-page .logo-link > div {
    min-width: 0;
    flex: 1 1 auto;
  }

  :root.mm-standalone body.home-page .page-header h1 {
    font-size: var(--mm-header-h1-size);
    line-height: 1.1;
    max-width: none;
  }

  :root.mm-standalone body.home-page .page-header .eyebrow {
    font-size: var(--mm-header-eyebrow-size);
  }

  :root.mm-standalone body.home-page .page-header .home-subtitle {
    font-size: 0.76rem;
    line-height: 1.2;
    margin-top: 0.08rem;
  }

  :root.mm-standalone body.home-page .header-controls {
    width: 100%;
    margin-left: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.58rem;
  }

  :root.mm-standalone body.home-page .theme-toggle.theme-toggle-header {
    width: var(--mm-header-toggle-size);
    height: var(--mm-header-toggle-size);
    min-width: var(--mm-header-toggle-size);
    min-height: var(--mm-header-toggle-size);
  }

  :root.mm-standalone body.home-page .header-auth-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 0.55rem;
  }

  :root.mm-standalone body.home-page .header-auth-actions a {
    min-width: 0;
    width: 100%;
    padding: var(--mm-header-action-pad);
    font-size: var(--mm-header-action-font-size);
    line-height: 1.1;
    white-space: nowrap;
  }

  :root.mm-standalone[data-nav-state="logged-in"] body.home-page .page-header {
    display: flex;
    align-items: center;
  }

  :root.mm-standalone[data-nav-state="logged-in"] body.home-page .header-controls {
    width: auto;
    margin-left: auto;
    display: inline-flex;
    justify-content: flex-end;
  }

  :root.mm-standalone body.home-page .page-header.is-compact {
    --mm-header-padding: 0.9rem 1.1rem;
    --mm-header-logo-size: 54px;
    --mm-header-h1-size: clamp(1.25rem, 2.0vw, 1.65rem);
    --mm-header-toggle-size: 34px;
    --mm-header-eyebrow-size: 0.72rem;
    --mm-header-action-pad: 0.36rem 0.66rem;
    --mm-header-action-font-size: 0.82rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 1rem;
    padding: var(--mm-header-padding);
  }

  :root.mm-standalone body.home-page .page-header.is-compact .logo-link {
    gap: 0.6rem;
  }

  :root.mm-standalone body.home-page .page-header.is-compact .logo-link img {
    width: var(--mm-header-logo-size);
    height: var(--mm-header-logo-size);
  }

  :root.mm-standalone body.home-page .page-header.is-compact h1 {
    font-size: var(--mm-header-h1-size);
    line-height: 1.1;
    max-width: none;
  }

  :root.mm-standalone body.home-page .page-header.is-compact .eyebrow {
    font-size: var(--mm-header-eyebrow-size);
    letter-spacing: 0.16em;
  }

  :root.mm-standalone body.home-page .page-header.is-compact .home-subtitle {
    font-size: 0.76rem;
    line-height: 1.2;
    margin-top: 0.08rem;
  }

  :root.mm-standalone body.home-page .page-header.is-compact .header-controls {
    width: 100%;
    margin-left: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.58rem;
  }

  :root.mm-standalone body.home-page .page-header.is-compact .theme-toggle.theme-toggle-header {
    width: var(--mm-header-toggle-size);
    height: var(--mm-header-toggle-size);
    min-width: var(--mm-header-toggle-size);
    min-height: var(--mm-header-toggle-size);
  }

  :root.mm-standalone body.home-page .page-header.is-compact .header-auth-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 0.55rem;
  }

  :root.mm-standalone body.home-page .page-header.is-compact .header-auth-actions a {
    min-width: 0;
    width: 100%;
    padding: var(--mm-header-action-pad);
    font-size: var(--mm-header-action-font-size);
    line-height: 1.1;
    white-space: nowrap;
  }

  :root.mm-standalone[data-nav-state="logged-in"] body.home-page .page-header.is-compact {
    display: flex;
    align-items: center;
  }

  :root.mm-standalone[data-nav-state="logged-in"] body.home-page .page-header.is-compact .header-controls {
    width: auto;
    margin-left: auto;
    display: inline-flex;
    justify-content: flex-end;
  }
}

.card {
  background: linear-gradient(180deg, var(--surface-strong) 0%, var(--surface) 100%);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem 1.3rem;
}

.guest-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  box-shadow: none;
}

.guest-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 1rem;
  align-items: center;
}

.guest-hero-text {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.guest-title-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.guest-title-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 1.1rem;
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-strong) 92%, var(--primary) 8%);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.guest-title-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.guest-title-action:hover,
.guest-title-action:focus-visible {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--surface-strong) 88%, var(--primary) 12%);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.guest-title {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}

.guest-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.guest-actions a {
  font-size: 0.95rem;
  font-weight: 700;
}

.guest-actions-row {
  grid-column: 1 / -1;
  justify-content: center;
  padding-top: 0.2rem;
  gap: 0.5rem;
}

.guest-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.pill-quiet {
  background: color-mix(in srgb, var(--surface-strong) 92%, var(--primary) 8%);
  border: 1px solid var(--surface-border);
  box-shadow: none;
}

.guest-hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  background: transparent;
  border: none;
  border-radius: calc(var(--radius) - 4px);
  padding: 0;
  min-height: 0;
}

.guest-hero-img {
  max-width: 360px;
  width: 100%;
  height: auto;
  display: block;
}

.guest-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.85rem;
  align-items: stretch;
}

.guest-feature {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.6rem;
  border: 1px dashed var(--surface-border);
  border-radius: calc(var(--radius) - 6px);
}

.guest-feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: transparent;
  border: none;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
}

.guest-feature-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.guest-steps {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.guest-steps-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.guest-step-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.guest-step {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  border: 1px dashed var(--surface-border);
  border-radius: calc(var(--radius) - 6px);
  padding: 0.75rem 0.85rem;
  background: color-mix(in srgb, var(--surface-strong) 94%, var(--primary) 6%);
}

.guest-step-num {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--primary) 32%, var(--surface-border));
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--primary);
  flex: 0 0 auto;
  background: var(--surface);
}

.guest-home {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.guest-lp {
  border: 1px solid var(--surface-border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--surface);
  padding: clamp(1rem, 2.2vw, 1.5rem);
}

.guest-lp img {
  display: block;
  max-width: 100%;
  height: auto;
}

.guest-lp-title {
  margin: 0;
  font-size: clamp(1.48rem, 2.2vw, 2.1rem);
  letter-spacing: -0.02em;
  text-align: center;
}

.guest-lp-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: clamp(1rem, 2vw, 1.75rem);
  align-items: center;
  overflow: hidden;
}

:root[data-theme="light"] .guest-lp-hero {
  background: linear-gradient(135deg, #fffdfa 0%, #fff6e4 100%);
}

:root[data-theme="dark"] .guest-lp-hero {
  background: linear-gradient(145deg, #131a27 0%, #1a202c 100%);
}

.guest-lp-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 0.62rem;
  max-width: none;
  width: 100%;
  margin: 0;
  align-items: flex-start;
  text-align: left;
}

.guest-lp-hero-title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.62rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.guest-lp-hero-text {
  margin: 0;
  max-width: none;
  color: var(--text);
  font-size: clamp(1rem, 1.55vw, 1.26rem);
  line-height: 1.35;
}

.guest-lp-actions {
  display: flex;
  flex-direction: column;
  gap: 0.64rem;
  width: min(100%, 22rem);
  margin: 0.14rem 0 0;
}

.guest-lp-action {
  border-radius: 999px;
  width: 100%;
  text-align: center;
  min-height: 2.92rem;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-weight: 800;
  text-decoration: none;
}

.guest-lp-action.primary {
  background: #0f2f73;
  color: #ffffff;
  border-color: #0f2f73;
  box-shadow: inset 0 -2px 0 color-mix(in srgb, #091b4a 64%, transparent);
}

.guest-lp-action.primary:hover,
.guest-lp-action.primary:focus-visible {
  background: #123883;
  color: #ffffff;
  border-color: #123883;
}

.guest-lp-action-secondary {
  background: #f6c645;
  color: #1e2535;
  border: 1px solid color-mix(in srgb, #d39f20 64%, #fff 36%);
  box-shadow: inset 0 -1px 0 color-mix(in srgb, #b67f0d 72%, transparent);
}

.guest-lp-action-secondary:hover,
.guest-lp-action-secondary:focus-visible {
  background: #f9d264;
  color: #171c29;
  border-color: color-mix(in srgb, #d39f20 64%, #fff 36%);
}

:root[data-theme="dark"] .guest-lp-action-secondary {
  background: #f6c645;
  color: #1e2535;
  border-color: color-mix(in srgb, #d39f20 64%, #fff 36%);
}

:root[data-theme="dark"] .guest-lp-action-secondary:hover,
:root[data-theme="dark"] .guest-lp-action-secondary:focus-visible {
  background: #f9d264;
  color: #171c29;
  border-color: color-mix(in srgb, #d39f20 64%, #fff 36%);
}

.guest-lp-hero-media {
  margin: 0;
  justify-self: stretch;
  width: 100%;
  align-self: end;
}

.guest-lp-hero-media img {
  width: 100%;
  border-radius: 0;
}

.guest-lp-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.guest-lp-how-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.84rem;
}

.guest-lp-how-card {
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--surface-border));
  background: color-mix(in srgb, var(--surface-strong) 89%, #dceeff 11%);
  padding: 1rem 0.84rem 0.9rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.44rem;
}

:root[data-theme="dark"] .guest-lp-how-card {
  background: color-mix(in srgb, var(--surface-strong) 92%, #24364e 8%);
}

.guest-lp-how-card img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.guest-lp-how-card h4 {
  margin: 0;
  font-size: 1.6rem;
}

.guest-lp-how-card p {
  margin: 0;
  color: var(--text);
  line-height: 1.35;
  max-width: 20ch;
}

.guest-lp-feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.34rem;
}

.guest-lp-feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.48rem;
  padding: 0.25rem 0.2rem;
}

.guest-lp-feature-item img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.guest-lp-feature-item span {
  font-weight: 700;
  line-height: 1.12;
  color: var(--text);
}

.guest-lp-sos {
  display: grid;
  grid-template-columns: minmax(170px, 0.34fr) minmax(0, 1fr);
  gap: clamp(0.85rem, 1.8vw, 1.3rem);
  align-items: center;
}

.guest-lp-sos-media {
  margin: 0;
  display: flex;
  justify-content: center;
}

.guest-lp-sos-media img {
  width: min(100%, 220px);
}

.guest-lp-sos-copy {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.guest-lp-sos-copy .guest-lp-title {
  text-align: left;
}

.guest-lp-sos-lead {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.18;
}

.guest-lp-sos-text {
  margin: 0;
  color: var(--text);
  line-height: 1.38;
}

.guest-lp-sos-action {
  margin-top: 0.48rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, #d9bc81 62%, var(--surface-border));
  background: linear-gradient(180deg, #fff7e9 0%, #f8edd7 100%);
  color: #1e2533;
  text-decoration: none;
  font-weight: 800;
  min-height: 3.2rem;
  padding: 0.4rem 0.8rem;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.56rem;
  width: 100%;
  max-width: 34rem;
}

.guest-lp-sos-action img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

:root[data-theme="dark"] .guest-lp-sos-action {
  background: linear-gradient(180deg, #fff7e9 0%, #f8edd7 100%);
  color: #1e2533;
  border-color: color-mix(in srgb, #d9bc81 62%, var(--surface-border));
}

.guest-lp-example-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  align-items: start;
  padding-bottom: 0;
}

.guest-lp-example-card {
  position: relative;
  border-radius: 16px;
  border: 1px solid var(--surface-border);
  background: var(--surface-strong);
  padding: 1.04rem 0.92rem 0.92rem 1.16rem;
  display: grid;
  grid-template-columns: minmax(96px, 0.35fr) minmax(0, 1fr);
  align-items: center;
  gap: 0.84rem;
}

.guest-lp-example-card img {
  width: 100%;
  border-radius: 12px;
  align-self: start;
}

.guest-lp-example-card-stack {
  isolation: isolate;
}

.guest-lp-example-card-stack::before,
.guest-lp-example-card-stack::after {
  content: "";
  position: absolute;
  border-radius: 16px;
  z-index: -1;
  pointer-events: none;
}

.guest-lp-example-card-stack::before {
  left: 12px;
  right: 12px;
  bottom: -14px;
  height: calc(100% - 2px);
  border: 1px solid color-mix(in srgb, var(--surface-border) 72%, #ecd8a8 28%);
  background: color-mix(in srgb, #f8eed4 74%, var(--surface));
  box-shadow: 0 8px 12px rgba(15, 23, 42, 0.06);
}

.guest-lp-example-card-stack::after {
  left: 22px;
  right: 22px;
  bottom: -26px;
  height: calc(100% - 6px);
  border: 1px solid color-mix(in srgb, var(--surface-border) 76%, #d8dde7 24%);
  background: color-mix(in srgb, #eef2f7 76%, var(--surface));
  box-shadow: 0 12px 16px rgba(15, 23, 42, 0.08);
}

:root[data-theme="dark"] .guest-lp-example-card-stack::before {
  border-color: color-mix(in srgb, var(--surface-border) 84%, #5f5340 16%);
  background: color-mix(in srgb, #2f3032 62%, var(--surface));
  box-shadow: 0 10px 14px rgba(2, 6, 23, 0.34);
}

:root[data-theme="dark"] .guest-lp-example-card-stack::after {
  border-color: color-mix(in srgb, var(--surface-border) 86%, #3e4654 14%);
  background: color-mix(in srgb, #242a34 62%, var(--surface));
  box-shadow: 0 14px 20px rgba(2, 6, 23, 0.42);
}

.guest-lp-example-copy {
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
  padding-top: 0;
}

.guest-lp-example-copy h4 {
  margin: 0;
  font-size: 1.42rem;
}

.guest-lp-example-copy p {
  margin: 0;
  line-height: 1.3;
  color: var(--text);
}

.guest-lp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.26rem;
}

.guest-lp-tags span {
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, #8db6dc 52%, transparent);
  background: color-mix(in srgb, #cde5fb 72%, var(--surface));
  color: color-mix(in srgb, #2b5b83 80%, var(--text));
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.22rem 0.45rem;
}

:root[data-theme="dark"] .guest-lp-tags span {
  border-color: color-mix(in srgb, #5b6b7d 58%, transparent);
  background: color-mix(in srgb, #38485b 56%, var(--surface));
  color: #c6d6e6;
}

.guest-lp-rates .guest-lp-title {
  margin-bottom: 0.24rem;
}

.guest-lp-rates-card {
  border-radius: 16px;
  border: 1px solid var(--surface-border);
  background: color-mix(in srgb, var(--surface-strong) 90%, var(--surface));
  padding: 0.84rem 1.1rem;
}

.guest-lp-rates-card h4 {
  margin: 0 0 0.58rem;
  font-size: 1.62rem;
}

.guest-lp-rates-card table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.guest-lp-rates-card th,
.guest-lp-rates-card td {
  text-align: left;
  font-weight: 600;
  padding: 0.52rem 0;
  border-top: 1px solid color-mix(in srgb, var(--surface-border) 88%, transparent);
}

.guest-lp-rates-card tr:first-child th,
.guest-lp-rates-card tr:first-child td {
  border-top: none;
}

.guest-lp-rates-card td {
  text-align: right;
  white-space: nowrap;
}

.guest-lp-cta {
  background: linear-gradient(180deg, #082a63 0%, #051f4c 100%);
  border: 1px solid color-mix(in srgb, #1d4689 60%, transparent);
  border-radius: calc(var(--radius) - 2px);
  padding: clamp(1.2rem, 2.1vw, 1.7rem);
  color: #f6f9ff;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.72rem;
}

:root[data-theme="dark"] .guest-lp-cta {
  background: linear-gradient(180deg, #142944 0%, #101f35 100%);
  border-color: color-mix(in srgb, #2d4363 62%, transparent);
}

.guest-lp-cta h3 {
  margin: 0;
  font-size: clamp(1.75rem, 2.4vw, 2.35rem);
}

.guest-lp-cta-action {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 3.12rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  background: #f4c53f;
  color: #152033;
  border: 1px solid color-mix(in srgb, #e2b442 70%, transparent);
  box-shadow: inset 0 -2px 0 color-mix(in srgb, #b08116 68%, transparent);
  width: min(100%, 52rem);
  margin: 0 auto;
  padding: 0 1rem;
}

.guest-lp-cta-action:hover,
.guest-lp-cta-action:focus-visible {
  background: #f8d36b;
}

:root[data-theme="dark"] .guest-lp-cta-action {
  background: #f4c53f;
  color: #152033;
  border-color: color-mix(in srgb, #e2b442 70%, transparent);
  box-shadow: inset 0 -2px 0 color-mix(in srgb, #b08116 68%, transparent);
}

:root[data-theme="dark"] .guest-lp-cta-action:hover,
:root[data-theme="dark"] .guest-lp-cta-action:focus-visible {
  background: #f8d36b;
}

.guest-lp-cta p {
  margin: 0;
  color: color-mix(in srgb, #f6f9ff 84%, #cad7ef 16%);
}

@media (max-width: 1080px) {
  .guest-lp-how-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .guest-lp-feature-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 0.65rem;
  }
}

@media (max-width: 980px) {
  .guest-lp-hero {
    grid-template-columns: minmax(0, 0.84fr) minmax(0, 1.16fr);
    gap: 0.82rem;
  }

  .guest-lp-hero-copy {
    max-width: none;
    width: 100%;
    text-align: left;
  }

  .guest-lp-hero-title {
    text-align: left;
  }

  .guest-lp-hero-text {
    text-align: left;
  }

  .guest-lp-actions {
    max-width: 13.4rem;
    gap: 0.42rem;
  }

  .guest-lp-action {
    min-height: 2.68rem;
    font-size: 0.96rem;
  }

  .guest-lp-hero-media img {
    border-radius: 0;
  }

  .guest-lp-sos {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }

  .guest-lp-sos-copy .guest-lp-title {
    text-align: center;
  }

  .guest-lp-sos-copy {
    align-items: center;
    text-align: center;
  }
}

@media (max-width: 880px) {
  .guest-lp-how-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .guest-lp-example-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding-bottom: 0;
  }

  .guest-lp-hero {
    grid-template-columns: 1fr;
    gap: 0.82rem;
  }

  .guest-lp-hero-copy {
    max-width: none;
  }

  .guest-lp-hero-title {
    max-width: none;
  }

  .guest-lp-actions {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 640px) {
  .guest-lp {
    padding: 0.88rem;
  }

  .guest-lp-title {
    font-size: clamp(1.34rem, 7vw, 1.86rem);
  }

  .guest-lp-hero-title {
    font-size: clamp(1.82rem, 11vw, 2.6rem);
    max-width: none;
  }

  .guest-lp-how-grid {
    grid-template-columns: 1fr;
  }

  .guest-lp-feature-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .guest-lp-example-card {
    grid-template-columns: minmax(84px, 0.33fr) minmax(0, 1fr);
    padding: 0.96rem 0.78rem 0.84rem 1rem;
  }

  .guest-lp-example-copy h4 {
    font-size: 1.16rem;
  }

  .guest-lp-example-copy p {
    font-size: 0.92rem;
  }

  .guest-lp-rates-card {
    padding: 0.78rem 0.8rem;
  }
}

@media (max-width: 520px) {
  .guest-lp-hero-copy {
    width: 100%;
  }

  .guest-lp-hero-title {
    max-width: none;
  }

  .guest-lp-hero-text {
    max-width: none;
  }

  .guest-lp-actions {
    width: 100%;
    max-width: none;
    gap: 0.36rem;
  }

  .guest-lp-action {
    min-height: 2.2rem;
    padding-inline: 0.55rem;
    font-size: 0.82rem;
    line-height: 1.1;
  }
}

:root[data-theme="dark"] .guest-home .guest-lp {
  background: color-mix(in srgb, var(--surface) 94%, #0f1624 6%);
  border-color: color-mix(in srgb, var(--surface-border) 90%, #141d2b 10%);
}

:root[data-theme="dark"] .guest-home .guest-lp img[src$=".webp"],
:root[data-theme="dark"] .guest-home .guest-lp img[src$=".svg"] {
  filter: none !important;
}

:root[data-theme="dark"] .guest-home .guest-lp-rates-card {
  background: color-mix(in srgb, var(--surface-strong) 92%, #1a2231 8%);
}

#home-guest.guest-home > .card {
  margin-bottom: 0;
}

.guest-hero-new {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  padding: 1.6rem;
}

.guest-hero-pattern {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.18;
  pointer-events: none;
}

.guest-hero-content,
.guest-hero-media-inline {
  position: relative;
  z-index: 1;
}

.guest-hero-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.guest-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid color-mix(in srgb, var(--surface-border) 60%, transparent);
  backdrop-filter: blur(2px);
}

[data-theme="light"] .guest-hero-copy {
  background: rgba(255, 255, 255, 0.45);
}

[data-theme="dark"] .guest-hero-copy {
  background: rgba(11, 18, 32, 0.2);
}

.guest-hero-title {
  margin: 0;
  font-size: clamp(1.65rem, 2.6vw, 2.35rem);
  letter-spacing: -0.02em;
}

.guest-hero-note {
  margin-top: 0.1rem;
}

.guest-hero-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  width: 100%;
}

.guest-hero-actions .btn-block {
  width: 100%;
}

.guest-hero-media-inline {
  order: 4;
  display: flex;
  justify-content: center;
}

.guest-hero-actions {
  order: 5;
}

.guest-image-frame {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.9rem;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--surface-border);
  background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
  overflow: hidden;
}

.guest-image-frame img {
  width: 100%;
  height: auto;
  display: block;
  max-width: 420px;
}

.guest-cta-media,
.guest-profiles-media,
.guest-preview-media,
.guest-hero-media-inline {
  width: 100%;
  max-width: 100%;
}

.guest-cta-media img,
.guest-profiles-media img,
.guest-preview-media img,
.guest-hero-media-inline img {
  max-width: 100%;
}

.guest-image-frame--hero img {
  max-width: 420px;
}

.guest-image-frame--wide img {
  max-width: 520px;
}

.guest-features,
.guest-preview,
.guest-profiles,
.guest-cta {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.guest-section-header {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.guest-feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.2rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--surface-border);
  border-radius: calc(var(--radius) - 6px);
  background: color-mix(in srgb, var(--surface-strong) 94%, transparent);
}

.guest-feature-item > div {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  align-items: center;
  text-align: center;
}

.guest-feature-item img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex: 0 0 auto;
}

.guest-feature-item h4 {
  margin: 0;
}

.guest-feature-item p {
  margin: 0;
}

.guest-features .guest-feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.guest-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.guest-preview-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.9rem;
  border-radius: calc(var(--radius) - 6px);
  border: 1px solid var(--surface-border);
  background: color-mix(in srgb, var(--surface-strong) 94%, transparent);
}

.guest-preview-media {
  width: 100%;
  display: grid;
  place-items: center;
  background: var(--surface-strong);
  border-radius: calc(var(--radius) - 8px);
  overflow: hidden;
  padding: clamp(0.35rem, 1vw, 0.6rem);
  box-sizing: border-box;
}

.guest-preview-media img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  object-fit: contain;
  border-radius: calc(var(--radius) - 8px);
}

.guest-preview-card > div:not(.guest-preview-media) {
  margin-top: 0.1rem;
}

.guest-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
}

.guest-profiles-text {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.guest-cta {
  position: relative;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface-strong) 88%, transparent);
}

.guest-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 18% 20%, color-mix(in srgb, var(--brand-accent) 24%, transparent) 0%, transparent 44%),
    radial-gradient(circle at 82% 25%, color-mix(in srgb, var(--primary) 18%, transparent) 0%, transparent 46%),
    linear-gradient(120deg, color-mix(in srgb, #ffffff 16%, transparent) 0%, transparent 68%);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  opacity: 0.18;
  pointer-events: none;
}

:root[data-theme="dark"] .guest-cta::before {
  opacity: 0.14;
}

.guest-cta > * {
  position: relative;
  z-index: 1;
}

.guest-cta-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 1.2rem;
  align-items: center;
}

.guest-cta-media {
  display: flex;
  justify-content: center;
}

.guest-image-frame--plain {
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
}


.guest-profiles-media {
  display: flex;
  justify-content: center;
  align-items: center;
}

.guest-image-frame--wide {
  margin: 0 auto;
}

.guest-cta-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  width: 100%;
  margin-top: 1.2rem;
}

.guest-cta-actions a {
  width: 100%;
}

.guest-footer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.1rem 0 0.5rem;
  border-top: 1px solid var(--surface-border);
}

.guest-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
}

.guest-footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.guest-footer-links a:hover,
.guest-footer-links a:focus-visible {
  color: var(--text);
}

.guest-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.home-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.3rem;
}

#home-guest > .card {
  margin-bottom: 1.25rem;
}

#home-guest > .card:last-child {
  margin-bottom: 0;
}

.home-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 25% 20%, color-mix(in srgb, var(--primary) 22%, transparent) 0%, transparent 32%), radial-gradient(circle at 80% 0%, color-mix(in srgb, var(--accent-warm) 20%, transparent) 0%, transparent 34%);
  opacity: 0.4;
  pointer-events: none;
}

.home-hero > * {
  position: relative;
  z-index: 1;
}

.home-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.home-hero-title {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* Home logged: tighten vertical space below the fixed header and above feed cards */
body.home-user-logged .page-content {
  padding-top: calc(var(--mm-page-header-content-offset, var(--mm-page-header-offset, 128px)) + 0.62rem);
}

:root[data-nav-state="logged-in"] body.home-page .page-content {
  padding-top: calc(var(--mm-page-header-content-offset, var(--mm-page-header-offset, 128px)) + 0.62rem);
}

body.home-user-logged .home-actions.home-quick-actions {
  margin-bottom: 0.62rem;
}

:root[data-nav-state="logged-in"] .home-actions.home-quick-actions {
  margin-bottom: 0.62rem;
}

.quick-scope-explainer {
  margin: -0.36rem 0 0.26rem;
  font-size: 0.75rem;
  line-height: 1.2;
}

.home-support-reminder {
  margin: 0 0 0.62rem;
  padding: 0.62rem 0.76rem;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--surface-border));
  border-radius: calc(var(--radius) - 6px);
  background: color-mix(in srgb, var(--primary) 10%, var(--surface) 90%);
}

.home-support-reminder__text {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--text);
}

.home-support-reminder__link {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.home-support-reminder__hide {
  appearance: none;
  -webkit-appearance: none;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0;
  margin: 0 0 0 0.2rem;
  min-height: 0;
  min-width: 0;
  color: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  line-height: inherit;
  text-decoration: none;
  display: inline;
  vertical-align: baseline;
  transition: none;
}

.home-support-reminder__hide:hover,
.home-support-reminder__hide:focus,
.home-support-reminder__hide:focus-visible,
.home-support-reminder__hide:active {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none;
  color: inherit;
  opacity: 1;
  text-decoration: none;
}

.home-quick-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  --mm-quick-pill-height: 2.04rem;
  --mm-quick-row-gap: 0.16rem;
  --mm-quick-separator-gap: 0.32rem;
  --mm-quick-separator-height: var(--mm-quick-pill-height);
  gap: var(--mm-quick-row-gap);
  width: 100%;
  overflow: visible;
}

.quick-filter-fixed {
  position: relative;
  flex: 0 0 auto;
  width: calc(var(--mm-quick-pill-height) + 0.14rem);
  height: calc(var(--mm-quick-pill-height) + 0.14rem);
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--surface-border) 82%, var(--text) 18%);
  background: var(--surface);
  color: color-mix(in srgb, var(--text) 52%, #cbd5e1 48%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: none;
  transition: none;
  margin-right: 0;
  min-height: calc(var(--mm-quick-pill-height) + 0.14rem);
  -webkit-tap-highlight-color: transparent;
}

.quick-filter-fixed::after {
  content: none;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: var(--mm-quick-separator-height);
  background: color-mix(in srgb, var(--surface-border) 82%, var(--text) 18%);
}

.quick-filter-fixed__icon {
  display: inline-flex;
  width: 0.9rem;
  height: 0.9rem;
}

.quick-filter-fixed__icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.quick-pills-fixed {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.16rem;
  flex: 0 0 auto;
  min-width: 0;
}

.quick-pills-divider {
  display: block;
  flex: 0 0 1px;
  width: 1px;
  height: var(--mm-quick-separator-height);
  align-self: center;
  margin-inline: var(--mm-quick-separator-gap);
  margin-top: 0;
  background: color-mix(in srgb, var(--surface-border) 82%, var(--text) 18%);
}

.quick-filter-pill {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--surface-border) 76%, var(--text) 24%);
  background: var(--surface);
  color: color-mix(in srgb, var(--text) 52%, #cbd5e1 48%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--mm-quick-pill-height);
  padding: 0 0.58rem;
  min-height: 0;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: none !important;
  transition: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.quick-filter-pill.is-active {
  border-color: color-mix(in srgb, var(--primary) 62%, var(--surface-border) 38%);
  background: color-mix(in srgb, var(--primary) 16%, var(--surface));
  color: var(--primary);
  box-shadow: none !important;
}

.quick-filter-pill:hover,
.quick-filter-pill:active {
  border-color: color-mix(in srgb, var(--surface-border) 76%, var(--text) 24%);
  background: var(--surface);
  color: color-mix(in srgb, var(--text) 52%, #cbd5e1 48%);
  box-shadow: none !important;
}

.quick-filter-pill.is-active:hover,
.quick-filter-pill.is-active:active {
  border-color: color-mix(in srgb, var(--primary) 62%, var(--surface-border) 38%);
  background: color-mix(in srgb, var(--primary) 16%, var(--surface));
  color: var(--primary);
  box-shadow: none !important;
}

.quick-filter-fixed:hover,
.quick-filter-fixed:active {
  border-color: color-mix(in srgb, var(--surface-border) 82%, var(--text) 18%);
  background: var(--surface);
  color: color-mix(in srgb, var(--text) 52%, #cbd5e1 48%);
  box-shadow: none !important;
}

.quick-category-wrap {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
}

.quick-category-trigger {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-width: 0;
  height: var(--mm-quick-pill-height);
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--surface-border) 76%, var(--text) 24%);
  background: var(--surface);
  color: color-mix(in srgb, var(--text) 52%, #cbd5e1 48%);
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0 0.58rem;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: none !important;
  transition: none;
  -webkit-tap-highlight-color: transparent;
}

.quick-category-trigger.is-active {
  border-color: color-mix(in srgb, var(--primary) 62%, var(--surface-border) 38%);
  background: color-mix(in srgb, var(--primary) 14%, var(--surface));
  color: var(--primary);
}

.quick-category-trigger:hover,
.quick-category-trigger:active {
  border-color: color-mix(in srgb, var(--surface-border) 76%, var(--text) 24%);
  background: var(--surface);
  color: color-mix(in srgb, var(--text) 52%, #cbd5e1 48%);
  box-shadow: none !important;
}

.quick-category-trigger.is-active:hover,
.quick-category-trigger.is-active:active {
  border-color: color-mix(in srgb, var(--primary) 62%, var(--surface-border) 38%);
  background: color-mix(in srgb, var(--primary) 14%, var(--surface));
  color: var(--primary);
  box-shadow: none !important;
}

.quick-category-trigger__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.quick-category-trigger__count {
  flex: 0 0 auto;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.26rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1;
  background: color-mix(in srgb, var(--primary) 18%, var(--surface));
  color: var(--primary);
}

.quick-category-trigger__chevron {
  flex: 0 0 auto;
  font-size: 0.66rem;
  line-height: 1;
  opacity: 0.86;
  transition: transform 0.18s ease;
}

.quick-category-trigger[aria-expanded="true"] .quick-category-trigger__chevron {
  transform: rotate(180deg);
}

.quick-category-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 40;
  width: min(260px, 82vw);
  display: flex;
  flex-direction: column;
  gap: 0.34rem;
  padding: 0.32rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--surface-border) 82%, var(--text) 18%);
  background: var(--surface);
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.22);
}

.quick-category-menu[hidden] {
  display: none !important;
}

.quick-category-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.quick-category-group__title {
  margin: 0.16rem 0 0.06rem;
  padding: 0 0.5rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.quick-category-option {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: color-mix(in srgb, var(--text) 68%, #cbd5e1 32%);
  padding: 0.46rem 0.58rem;
  min-height: 2rem;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: left;
  box-shadow: none !important;
  transition: none;
}

.quick-category-option:hover,
.quick-category-option:active {
  background: var(--surface-strong);
  border-color: color-mix(in srgb, var(--surface-border) 80%, var(--text) 20%);
  color: var(--text);
}

.quick-category-option.is-active {
  background: color-mix(in srgb, var(--primary) 14%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 52%, var(--surface-border) 48%);
  color: var(--primary);
}

.quick-category-option__check {
  font-size: 0.74rem;
  line-height: 1;
  opacity: 0;
  transform: scale(0.72);
  transition: transform 0.14s ease, opacity 0.14s ease;
}

.quick-category-option.is-active .quick-category-option__check {
  opacity: 1;
  transform: scale(1);
}

.modal.quick-category-modal .modal-dialog > .card {
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.22);
}

.quick-category-modal__header {
  align-items: center;
  justify-content: space-between;
}

.quick-category-modal__hint {
  margin: 0.45rem 0 0;
}

.quick-category-modal__list {
  margin-top: 0.75rem;
  gap: 0.45rem;
}

.quick-category-modal__list .quick-category-group {
  gap: 0.34rem;
}

.quick-category-modal__list .quick-category-group__title {
  margin-top: 0;
  padding: 0 0.2rem;
}

.quick-category-modal__list .quick-category-option {
  border: 1px solid color-mix(in srgb, var(--surface-border) 82%, var(--text) 18%);
  border-radius: 12px;
  min-height: 2.55rem;
  padding: 0.64rem 0.8rem;
  background: var(--surface);
}

/* Override legacy main.css rule: .home-actions button { height: 48px / 44px } */
.home-quick-actions .quick-filter-pill,
.home-quick-actions .quick-category-trigger {
  height: var(--mm-quick-pill-height);
  min-height: var(--mm-quick-pill-height);
}

.home-quick-actions .quick-filter-fixed {
  height: calc(var(--mm-quick-pill-height) + 0.14rem);
  min-height: calc(var(--mm-quick-pill-height) + 0.14rem);
}

.quick-filter-fixed:focus-visible,
.quick-filter-pill:focus-visible,
.quick-category-trigger:focus-visible,
.quick-category-option:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--primary) 46%, transparent);
  outline-offset: 2px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.15rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 16%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--primary) 38%, var(--surface-border));
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
}

.pay-choice-row {
  gap: 0.6rem;
  flex-wrap: wrap;
  width: 100%;
  justify-content: space-between;
  align-items: stretch;
}

.pro-plan-panel {
  margin-top: 0.55rem;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--primary) 26%, var(--surface-border));
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--surface-strong) 82%, var(--primary) 18%) 0%,
    color-mix(in srgb, var(--surface) 96%, transparent) 100%
  );
  color: var(--text);
}

.pro-plan-panel h3 {
  margin: 0;
  font-size: 1.45rem;
}

.pro-plan-panel p {
  margin: 0.7rem 0 0;
  font-size: 0.98rem;
  line-height: 1.45;
  color: var(--muted-strong);
}

.pro-plan-panel ul {
  margin: 0.7rem 0 0;
  padding-left: 1.15rem;
}

.pro-plan-panel li {
  margin: 0.32rem 0;
  line-height: 1.45;
  color: var(--muted-strong);
}

.promo-payments-panel {
  margin-top: 0.75rem;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--surface-border));
  background: color-mix(in srgb, var(--surface) 95%, var(--primary) 5%);
}

.promo-payments-panel h3 {
  margin: 0;
  font-size: 1.15rem;
}

.promo-payments-panel p {
  margin: 0.45rem 0 0;
}

.promo-payments-list {
  margin-top: 0.65rem;
  display: grid;
  gap: 0.45rem;
}

.promo-payment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem 0.9rem;
  padding: 0.58rem 0.68rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--surface-border) 80%, transparent);
  background: color-mix(in srgb, var(--surface-strong) 92%, var(--surface) 8%);
}

.promo-payment-row__name {
  margin: 0;
  font-weight: 700;
  color: var(--text);
}

.promo-payment-row__meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.promo-payment-row__price {
  margin: 0;
  align-self: center;
  justify-self: end;
  font-weight: 700;
  color: var(--text);
}

.support-section {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.support-new-ticket {
  border: 1px solid color-mix(in srgb, var(--surface-border) 84%, transparent);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  border-radius: 12px;
  padding: 0.75rem;
  display: grid;
  gap: 0.55rem;
}

.support-messages-layout {
  margin-top: 0.1rem;
  min-height: 520px;
  gap: 0.65rem;
}

.support-messages-layout .threads-panel,
.support-messages-layout .chat-panel {
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 97%, transparent);
  padding: 0.7rem;
}

.support-messages-layout .chat-panel {
  gap: 0.65rem;
}

.support-chat-panel .chat-history {
  height: 340px;
  min-height: 340px;
  max-height: 340px;
  overflow-y: auto;
}

.support-ticket-item .thread-name {
  max-width: 100%;
}

.support-ticket-item .thread-header {
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.15rem;
  padding-right: 0;
}

.support-ticket-status {
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 0.18rem 0.52rem;
  line-height: 1.1;
}

.badge.support-ticket-status--open {
  color: #14532d !important;
  background: #dcfce7 !important;
  border-color: #22c55e !important;
}

.badge.support-ticket-status--closed {
  color: #7f1d1d !important;
  background: #fee2e2 !important;
  border-color: #ef4444 !important;
}

[data-theme="dark"] .badge.support-ticket-status--open {
  color: #d1fae5 !important;
  background: rgba(6, 95, 70, 0.54) !important;
  border-color: rgba(52, 211, 153, 0.9) !important;
}

[data-theme="dark"] .badge.support-ticket-status--closed {
  color: #fee2e2 !important;
  background: rgba(127, 29, 29, 0.56) !important;
  border-color: rgba(248, 113, 113, 0.9) !important;
}

.support-msg-sender {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
}

.support-chat-input button {
  width: auto;
  min-width: 92px;
  transform: none;
  height: 44px;
}

@media (max-width: 768px) {
  .home-quick-actions {
    --mm-quick-pill-height: 1.9rem;
    --mm-quick-row-gap: 0.12rem;
    --mm-quick-separator-gap: 0.24rem;
  }
  .quick-filter-fixed__icon {
    width: 0.82rem;
    height: 0.82rem;
  }
  .quick-pills-fixed {
    gap: 0.12rem;
  }
  .home-quick-actions .quick-filter-pill,
  .home-quick-actions .quick-category-trigger {
    font-size: 0.72rem;
    padding-inline: 0.5rem;
  }
  .quick-category-trigger__count {
    min-width: 1rem;
    height: 1rem;
    font-size: 0.6rem;
  }
  .quick-category-menu {
    display: none !important;
  }
  .modal.quick-category-modal {
    padding: 0;
    place-items: end stretch;
  }
  .modal.quick-category-modal .modal-dialog {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    align-items: flex-end;
    max-height: 100%;
  }
  .modal.quick-category-modal .modal-dialog > .card {
    width: 100%;
    max-height: min(72vh, calc(100vh - 70px));
    border-radius: 18px 18px 0 0;
    transform: translateY(100%);
    transition: transform 0.24s ease;
    padding-bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px));
  }
  .modal.quick-category-modal[aria-hidden="false"] .modal-dialog > .card,
  .modal.quick-category-modal.open .modal-dialog > .card {
    transform: translateY(0);
  }
  .modal.quick-category-modal.closing .modal-dialog > .card {
    transform: translateY(100%);
    opacity: 1;
  }
  .modal.quick-category-modal .modal-backdrop {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .modal.quick-category-modal .mm-modal-footer {
    margin-top: 0.9rem;
    gap: 0.45rem;
    flex-wrap: wrap;
  }
  .modal.quick-category-modal .mm-modal-footer button {
    flex: 1 1 0;
    min-width: 0;
  }
}

@media (max-width: 640px) {
  body.home-user-logged .page-content {
    padding-top: calc(var(--mm-page-header-content-offset, var(--mm-page-header-offset, 84px)) + 0.5rem);
  }

  :root[data-nav-state="logged-in"] body.home-page .page-content {
    padding-top: calc(var(--mm-page-header-content-offset, var(--mm-page-header-offset, 84px)) + 0.5rem);
  }

  body.home-user-logged .home-actions.home-quick-actions {
    margin-bottom: 0.5rem;
  }

  :root[data-nav-state="logged-in"] .home-actions.home-quick-actions {
    margin-bottom: 0.5rem;
  }

  .quick-scope-explainer {
    margin: -0.3rem 0 0.2rem;
    font-size: 0.7rem;
  }

  .home-quick-actions {
    --mm-quick-pill-height: 1.76rem;
    --mm-quick-row-gap: 0.1rem;
    --mm-quick-separator-gap: 0.18rem;
  }
  .quick-filter-fixed__icon {
    width: 0.76rem;
    height: 0.76rem;
  }
  .quick-pills-fixed {
    gap: 0.09rem;
  }
  .home-quick-actions .quick-filter-pill,
  .home-quick-actions .quick-category-trigger {
    font-size: 0.67rem;
    padding-inline: 0.42rem;
  }
  .quick-category-trigger__count {
    min-width: 0.92rem;
    height: 0.92rem;
    font-size: 0.56rem;
  }
  .pro-plan-panel {
    padding: 0.85rem 0.9rem;
  }
  .pro-plan-panel h3 {
    font-size: 1.2rem;
  }
  .pro-plan-panel p,
  .pro-plan-panel li {
    font-size: 0.92rem;
  }
  .promo-payments-panel {
    padding: 0.85rem 0.9rem;
  }
  .promo-payment-row {
    grid-template-columns: 1fr;
    gap: 0.28rem;
  }
  .promo-payment-row__price {
    justify-self: start;
  }
  .support-messages-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .support-messages-layout .threads-panel,
  .support-messages-layout .chat-panel {
    padding: 0.65rem;
  }
}

@media (max-width: 420px) {
  .home-quick-actions {
    --mm-quick-pill-height: 1.62rem;
    --mm-quick-row-gap: 0.08rem;
    --mm-quick-separator-gap: 0.14rem;
  }
  .quick-filter-fixed__icon {
    width: 0.7rem;
    height: 0.7rem;
  }
  .quick-pills-fixed {
    gap: 0.08rem;
  }
  .home-quick-actions .quick-filter-pill,
  .home-quick-actions .quick-category-trigger {
    font-size: 0.62rem;
    padding-inline: 0.34rem;
  }
  .quick-category-trigger__count {
    min-width: 0.84rem;
    height: 0.84rem;
    font-size: 0.52rem;
    padding: 0 0.18rem;
  }
}

@media (min-width: 769px) {
  .modal.quick-category-modal {
    display: none !important;
  }
}

.pay-pill {
  flex: 1 1 240px;
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 14%, var(--surface-strong)) 0%, var(--surface) 100%);
  border: 1px solid color-mix(in srgb, var(--primary) 32%, var(--surface-border));
  color: var(--text);
  text-decoration: none;
  box-shadow: none;
  min-height: 48px;
  transition: none;
}

.pay-pill:hover {
  transform: none;
  box-shadow: none;
  border-color: color-mix(in srgb, var(--primary) 32%, var(--surface-border));
}

.pay-pill:active {
  transform: none;
  box-shadow: none;
}

.pay-pill__copy {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  line-height: 1.25;
}

.pay-pill__headline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.pay-pill__logo-inline {
  height: 26px;
  width: auto;
  object-fit: contain;
}

.pay-pill__logo-secondary {
  height: 24px;
  width: 24px;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: none;
}

.pay-pill__logo-stripe {
  height: 32px;
  filter: brightness(0) invert(1);
}

#btn-stripe-pro .pay-pill__logo-secondary {
  margin-left: 0.65rem; /* aumenta distanza dal testo */
  margin-right: -0.15rem; /* avvicina al logo principale */
}

#btn-stripe-pro .pay-pill__logo-stripe {
  margin-left: -0.2rem; /* stringe lo spazio tra le due icone */
}

.pay-pill__note {
  font-size: 0.9rem;
  color: var(--muted);
}

#btn-paypal-pro,
.paypal-pill {
  background: rgb(245, 199, 87);
  border-color: rgb(245, 199, 87);
  color: #0a0a0a;
}

#btn-paypal-pro:hover,
.paypal-pill:hover {
  background: rgb(235, 186, 68);
  border-color: rgb(235, 186, 68);
  color: #0a0a0a;
}

.paypal-pill {
  position: relative;
  overflow: hidden;
}

.paypal-pill .paypal-sdk-overlay {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

.paypal-pill .paypal-sdk-overlay > span,
.paypal-pill .paypal-sdk-overlay iframe {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.paypal-pill.paypal-pill--sdk .paypal-sdk-overlay {
  pointer-events: auto;
}

.paypal-pill.paypal-pill--sdk .pay-pill__copy {
  pointer-events: none;
  position: relative;
  z-index: 1;
}

#btn-stripe-pro {
  background: rgb(21, 40, 132);
  border-color: rgb(21, 40, 132);
  color: #fff;
}

#btn-stripe-pro:hover {
  background: rgb(18, 35, 116);
  border-color: rgb(18, 35, 116);
  color: #fff;
}

.home-hero-panel {
  display: flex;
  align-items: stretch;
}

.home-panel-card {
  width: 100%;
  background: linear-gradient(160deg, color-mix(in srgb, var(--primary) 14%, var(--surface-strong)) 0%, var(--surface) 100%);
  border: 1px solid color-mix(in srgb, var(--primary) 32%, var(--surface-border));
  border-radius: calc(var(--radius) - 2px);
  padding: 1rem 1.05rem 1.1rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.home-checklist {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 0.4rem;
  display: grid;
  gap: 0.45rem;
}

.home-checklist li {
  position: relative;
  padding-left: 1.35rem;
  color: var(--muted);
  line-height: 1.5;
}

.home-checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 800;
  color: var(--primary);
}

.home-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.section-title {
  margin: 0.1rem 0 0.2rem;
  letter-spacing: -0.01em;
}

.home-feature-section {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.home-feature-grid {
  margin-top: 0.2rem;
}

.home-feature {
  background: color-mix(in srgb, var(--surface) 88%, var(--primary) 10%);
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--surface-border));
  border-radius: calc(var(--radius) - 4px);
  padding: 1rem 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.14);
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.16s ease;
}

.home-feature:hover,
.home-feature:focus-within {
  transform: translateY(-1px);
  border-color: var(--primary);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.16);
}

.home-feature-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 36%, var(--surface-border));
  border-radius: 12px;
  font-size: 1.2rem;
}

.home-steps {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.home-steps-list {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0.2rem 0 0;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.home-steps-list li {
  counter-increment: step;
  position: relative;
  padding: 0.95rem 3.1rem 0.9rem 0.9rem;
  border: 1px dashed var(--surface-border);
  border-radius: calc(var(--radius) - 6px);
  background: color-mix(in srgb, var(--surface) 86%, var(--primary) 8%);
  color: var(--muted);
  line-height: 1.45;
  min-height: 100%;
}

.home-steps-list li::before {
  content: counter(step);
  position: absolute;
  top: 0.8rem;
  right: 0.85rem;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--primary) 32%, var(--surface-border));
  background: var(--surface-strong);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.95rem;
}

.home-steps-list strong {
  color: var(--text);
  display: block;
  margin-bottom: 0.15rem;
}

@media (max-width: 900px) {
  .home-hero {
    grid-template-columns: 1fr;
  }
  .home-hero-title {
    font-size: 1.35rem;
  }
  .guest-hero {
    grid-template-columns: 1fr;
  }
  .guest-hero-visual {
    min-height: 180px;
  }
  .guest-hero-new,
  .guest-cta-grid,
  .guest-split {
    grid-template-columns: 1fr;
  }
  .guest-preview-grid {
    grid-template-columns: 1fr;
  }
  .guest-image-frame img {
    max-width: 360px;
  }
  .guest-hero-new {
    padding: 1.2rem;
  }
  .guest-features .guest-feature-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
  .guest-hero-content {
    gap: 0.7rem;
  }
  .guest-image-frame--hero img {
    max-width: 300px;
  }
}

@media (min-width: 901px) {
  .guest-hero-note {
    white-space: nowrap;
  }
}

@media (max-width: 720px) {
  .guest-feature-item img {
    width: 40px;
    height: 40px;
  }
  .guest-preview-media img {
    max-width: 100%;
  }
  .guest-image-frame img {
    max-width: 280px;
  }
}

@media (max-width: 560px) {
  .guest-preview-media img {
    object-fit: contain;
  }
}

:root[data-theme="dark"] .guest-home .guest-hero-pattern {
  opacity: 0.14;
}

:root[data-theme="dark"] .guest-home img[src$=".svg"] {
  filter: brightness(0.88) contrast(1.02) saturate(0.45);
}

:root[data-theme="dark"] .guest-home img[src$=".png"] {
  filter: none !important;
  opacity: 1;
  mix-blend-mode: normal;
}


.guest-img {
  max-width: 100%;
  height: auto;
  display: block;
}

[data-theme="light"] .guest-img--dark {
  display: none;
}

[data-theme="dark"] .guest-img--light {
  display: none;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.9rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0 0 0.35rem;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.field {
  display: flex;
  flex-direction: column;
}

.auth-layout {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.auth-card {
  width: min(480px, 100%);
  background: linear-gradient(180deg, var(--surface-strong) 0%, var(--surface) 100%);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem 1.5rem 1.6rem;
}

.auth-header {
  --mm-auth-header-logo-size: 72px;
  --mm-auth-header-h1-size: 1.92rem;
  --mm-auth-header-eyebrow-size: 0.75rem;
  --mm-auth-header-copy-size: 1rem;
}

.auth-header h1 {
  margin: 0 0 0.35rem;
  font-size: var(--mm-auth-header-h1-size);
  transition: font-size 220ms ease;
}

.auth-header .eyebrow {
  font-size: var(--mm-auth-header-eyebrow-size);
  transition: font-size 220ms ease;
}

.auth-header p {
  margin: 0;
  font-size: var(--mm-auth-header-copy-size);
  transition: font-size 220ms ease;
}

.auth-header.has-theme-toggle {
  position: relative;
  padding-right: calc(var(--mm-header-toggle-size) + 0.4rem);
  transition: padding-right 220ms ease;
}

.auth-header.is-compact {
  --mm-auth-header-logo-size: 58px;
  --mm-auth-header-h1-size: 1.6rem;
  --mm-auth-header-eyebrow-size: 0.7rem;
  --mm-auth-header-copy-size: 0.93rem;
}

.auth-header.has-theme-toggle .header-controls {
  position: absolute;
  top: 0;
  right: 0;
  margin-left: 0;
  width: auto;
}

.mm-theme-only-header {
  position: fixed;
  top: 0.72rem;
  right: 0.72rem;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

:root.mm-standalone .mm-theme-only-header {
  top: calc(env(safe-area-inset-top, 0px) + 0.72rem);
}

.mm-theme-only-header .header-controls {
  margin-left: 0;
  width: auto;
}

.auth-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.form-shell {
  gap: 1rem;
}

.form-section {
  border: 1px solid var(--surface-border);
  border-radius: calc(var(--radius) - 4px);
  background: color-mix(in srgb, var(--surface) 94%, var(--surface-strong) 8%);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.section-header {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.section-title {
  margin: 0;
  font-size: 1.05rem;
}

.section-subtitle h4 {
  margin: 0;
}

.section-subtitle p {
  margin: 0.1rem 0 0;
}

.option-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.option-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  position: relative;
}

.option-chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.option-chip span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 700;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.option-chip:hover span,
.option-chip:focus-visible span {
  border-color: var(--surface-border-strong);
  background: var(--surface-strong);
}

.option-chip:focus-within span {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}

.option-chip input:checked + span {
  border-color: var(--primary);
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.18);
}

.helper-text {
  min-height: 1.2em;
  color: var(--muted);
  margin: 0;
}

.helper-text.is-error {
  color: var(--danger);
}

.account-social-provider-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.account-social-provider-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: middle;
  flex: 0 0 auto;
}

.account-social-provider-status[hidden] {
  display: none !important;
}

.auth-password-provider-hint {
  font-size: 12px;
}

.mm-progress {
  position: relative;
  display: block;
  width: 100%;
  height: 15px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--surface-border);
  background: color-mix(in srgb, var(--surface-strong) 80%, var(--bg) 20%);
}

.mm-progress__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, var(--primary) 0%, color-mix(in srgb, var(--primary) 70%, var(--accent-warm) 30%) 100%);
  transition: width 0.18s ease;
}

.mm-progress__text {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 0.70rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text);
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  user-select: none;
}

.mm-progress--indeterminate .mm-progress__fill {
  width: 40%;
  animation: mm-progress-indeterminate 1.15s ease-in-out infinite;
}

@keyframes mm-progress-indeterminate {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(260%); }
}

.input-with-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 100%;
}

.input-with-toggle input[type="password"],
.input-with-toggle input[type="text"] {
  flex: 1 1 auto;
  padding-right: 3rem;
}

.password-toggle-btn {
  position: absolute;
  top: 50%;
  right: 0.4rem;
  transform: translateY(-56%);
  z-index: 3;
  border: none;
  background: transparent;
  box-shadow: none;
  outline: none;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  margin: 0;
  line-height: 0;
  min-height: 0;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  pointer-events: auto;
  transition: none;
  appearance: none;
}

.password-toggle-btn:hover,
.password-toggle-btn:focus-visible {
  color: var(--primary);
  background: transparent;
  outline: none;
  box-shadow: none;
  transform: translateY(-56%) !important;
}

.password-toggle-btn:focus,
.password-toggle-btn:active {
  outline: none;
  box-shadow: none;
  transform: translateY(-56%) !important;
}

.password-toggle-btn svg {
  display: block;
  pointer-events: none;
  width: 20px;
  height: 20px;
  overflow: visible;
  transform: none !important;
  transform-origin: center center;
}

.auth-footer {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--surface-border);
  box-shadow: none;
}

.ghost-secondary {
  background: var(--surface-strong);
  border-color: var(--surface-border);
  color: var(--text);
}
.ghost-secondary:hover,
.ghost-secondary:focus-visible {
  background: var(--surface);
  color: var(--text);
  border-color: var(--surface-border-strong);
}

.theme-choice-btn,
#btn-theme-light,
#btn-theme-dark {
  background: var(--surface-strong) !important;
  border-color: var(--surface-border) !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

.theme-choice-btn:hover,
.theme-choice-btn:focus-visible,
.theme-choice-btn:active,
#btn-theme-light:hover,
#btn-theme-light:focus-visible,
#btn-theme-light:active,
#btn-theme-dark:hover,
#btn-theme-dark:focus-visible,
#btn-theme-dark:active {
  background: var(--surface-strong) !important;
  border-color: var(--surface-border) !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

.theme-choice-btn.theme-choice-active,
#btn-theme-light.theme-choice-active,
#btn-theme-dark.theme-choice-active {
  background: color-mix(in srgb, var(--surface) 94%, var(--bg-soft) 6%) !important;
  border-color: var(--surface-border-strong) !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

#btn-theme-light,
#btn-theme-dark,
#btn-theme-light.ghost,
#btn-theme-dark.ghost,
#btn-theme-light.ghost-primary,
#btn-theme-dark.ghost-primary,
#btn-theme-light.ghost-secondary,
#btn-theme-dark.ghost-secondary,
#btn-theme-light:hover,
#btn-theme-light:focus,
#btn-theme-light:focus-visible,
#btn-theme-light:active,
#btn-theme-dark:hover,
#btn-theme-dark:focus,
#btn-theme-dark:focus-visible,
#btn-theme-dark:active {
  background: var(--surface-strong) !important;
  color: var(--text) !important;
  border-color: var(--surface-border) !important;
  box-shadow: none !important;
  transform: none !important;
  filter: none !important;
  outline: none !important;
}

#btn-theme-light.theme-choice-active,
#btn-theme-dark.theme-choice-active {
  background: color-mix(in srgb, var(--surface) 94%, var(--bg-soft) 6%) !important;
  border-color: var(--surface-border-strong) !important;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.6rem 1rem;
  background: var(--primary);
  color: #fff;
  border-radius: calc(var(--radius) - 6px);
  border: 1px solid var(--primary);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  min-height: 42px;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.18);
  transition: box-shadow 0.1s ease, background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.link-btn:hover {
  background: var(--primary-strong);
  color: #fff;
  border-color: var(--primary-strong);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.22);
}
.link-btn:active {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}
.link-btn:disabled {
  background: var(--primary);
  color: rgba(255, 255, 255, 0.78);
  opacity: 0.6;
  cursor: default;
  transform: none;
  box-shadow: none;
}

/* Disabilita gli effetti di movimento sui pulsanti, mantenendo highlight bordo/colori */
button:hover:not(.password-toggle-btn):not(.clear-input):not(.combo-toggle),
button:active:not(.password-toggle-btn):not(.clear-input):not(.combo-toggle),
.ghost:hover,
.ghost:active,
label.ghost:active,
.link-btn:hover,
.link-btn:active,
.theme-toggle:hover {
  transform: none !important;
}

.btn-load-more {
  min-height: 2.4rem;
  padding: 0.5rem 1rem;
  margin-top: 0.25rem;
}

.feed-sentinel {
  width: 100%;
  height: 1px;
}

.header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.post-tabs {
  display: inline-flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.post-tab {
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.post-tab:hover,
.post-tab:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
  outline: none;
}

.post-tab.active {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.18);
}

.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.6rem 1rem;
  background: var(--primary);
  color: #fff;
  border-radius: calc(var(--radius) - 6px);
  border: 1px solid var(--primary);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.18);
}

.primary-quiet {
  background: transparent;
  color: var(--text);
  border-color: var(--surface-border);
  box-shadow: none;
  font-weight: 700;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.primary-quiet:hover,
.primary-quiet:focus-visible {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.22);
  transform: translateY(-1px);
}

.primary-quiet:active {
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

.floating-nav {
  position: fixed;
  bottom: var(--floating-nav-bottom-offset);
  left: 0;
  right: 0;
  width: 100%;
  display: none;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.18rem;
  padding: 0.34rem 0.56rem 0.44rem;
  background: var(--surface);
  border-top: 1px solid var(--surface-border);
  box-shadow: none;
  z-index: 999;
  flex-wrap: nowrap;
  border-radius: 0;
  --mm-nav-active: color-mix(in srgb, var(--primary) 90%, #1d4ed8 10%);
  --mm-nav-idle: color-mix(in srgb, var(--mm-nav-active) 52%, #8fb4ff 48%);
  --mm-nav-icon-filter-idle: invert(56%) sepia(74%) saturate(1300%) hue-rotate(195deg) brightness(109%) contrast(94%);
  --mm-nav-icon-filter-active: invert(43%) sepia(5%) saturate(1532%) hue-rotate(342deg) brightness(87%) contrast(125%);
}

.floating-nav.nav-ready {
  display: flex;
}

:root[data-nav-state="logged-in"] .floating-nav {
  display: flex;
}

:root[data-nav-state="logged-out"] .floating-nav,
:root[data-nav-state="pending"] .floating-nav {
  display: none;
}

.video-upload-progress {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: calc(var(--floating-nav-total-height) + 0.9rem);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 1005;
  pointer-events: auto;
}

.video-upload-progress__bar {
  position: relative;
  flex: 1;
  min-height: 36px;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  background: color-mix(in srgb, var(--surface-strong) 90%, var(--bg) 10%);
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 0 1rem;
}

.video-upload-progress__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, var(--primary) 0%, color-mix(in srgb, var(--primary) 70%, var(--accent-warm) 30%) 100%);
  transition: width 0.2s ease;
}

.video-upload-progress__text {
  position: relative;
  z-index: 1;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.video-upload-progress__cancel {
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  min-width: 2.5rem;
}

.video-upload-progress.hidden {
  display: none;
}

.video-upload-progress[hidden] {
  display: none !important;
}

.video-upload-progress__bar:focus-visible,
.video-upload-progress__cancel:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--primary) 60%, transparent);
  outline-offset: 2px;
}

.floating-nav-fixed {
  position: fixed;
}

.floating-nav a {
  color: var(--mm-nav-idle);
  text-decoration: none;
  padding: 0.26rem 0.3rem 0.2rem;
  border-radius: 10px;
  border: 0;
  font-size: 0.72rem;
  font-weight: 600;
  transition: none;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.2rem;
  min-width: 0;
  flex: 1 1 0;
  line-height: 1.2;
  background: transparent;
  box-shadow: none;
}

.floating-nav a:hover,
.floating-nav a:focus-visible {
  color: var(--mm-nav-idle);
  border: 0;
  background: transparent;
  box-shadow: none;
}

.floating-nav a.active {
  border: 0;
  background: transparent;
  color: var(--mm-nav-active);
}

.floating-nav .nav-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.floating-nav .nav-icon img {
  width: 22px;
  height: 22px;
  display: block;
  filter: var(--mm-nav-icon-filter-idle);
  opacity: 1;
}

.floating-nav a.active .nav-icon img {
  filter: var(--mm-nav-icon-filter-active);
  opacity: 1;
}

.floating-nav .nav-label {
  font-size: 0.72rem;
  line-height: 1.2;
}

.floating-nav a.active .nav-label {
  font-weight: 800;
}

:root[data-theme="light"] .floating-nav a:not(.active) .nav-label,
:root:not([data-theme="dark"]) .floating-nav a:not(.active) .nav-label {
  color: #6b7280;
}

.floating-nav .nav-create-post-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 999px;
  background: var(--mm-nav-active);
  color: #ffffff;
  width: 2.9rem;
  height: 2.9rem;
  flex: 0 0 auto;
  align-self: center;
  margin-top: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: none;
  transform: none;
  transition: none;
  text-decoration: none;
}

.floating-nav .nav-create-post-btn__plus {
  position: relative;
  display: inline-block;
  width: 1.38rem;
  height: 1.38rem;
}

.floating-nav .nav-create-post-btn__plus::before,
.floating-nav .nav-create-post-btn__plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.floating-nav .nav-create-post-btn__plus::before {
  width: 0.26rem;
  height: 1.02rem;
}

.floating-nav .nav-create-post-btn__plus::after {
  width: 1.02rem;
  height: 0.26rem;
}

.floating-nav .nav-create-post-btn:hover,
.floating-nav .nav-create-post-btn:focus-visible,
.floating-nav .nav-create-post-btn:active {
  border: 0;
  background: var(--mm-nav-active);
  color: #ffffff;
  box-shadow: none;
  transform: none;
}

:root[data-theme="dark"] .floating-nav {
  --mm-nav-idle: color-mix(in srgb, #94a3b8 74%, var(--text) 26%);
  --mm-nav-active: color-mix(in srgb, var(--primary) 88%, #93c5fd 12%);
  --mm-nav-icon-filter-idle: grayscale(1) saturate(0) brightness(0.88) contrast(1.01);
  --mm-nav-icon-filter-active: invert(66%) sepia(67%) saturate(2535%) hue-rotate(191deg) brightness(97%) contrast(93%);
}

:root[data-theme="dark"] .floating-nav .nav-create-post-btn,
:root[data-theme="dark"] .floating-nav .nav-create-post-btn:hover,
:root[data-theme="dark"] .floating-nav .nav-create-post-btn:focus-visible,
:root[data-theme="dark"] .floating-nav .nav-create-post-btn:active {
  background: color-mix(in srgb, var(--primary) 74%, #1e293b 26%);
  color: #ffffff;
}

:root[data-theme="dark"] img[src*="assets/icons/"],
:root[data-theme="dark"] .guest-feature-icon img,
:root[data-theme="dark"] .home-feature-icon img {
  filter: brightness(1.35) contrast(1.25) saturate(1.2);
}

.floating-nav .theme-toggle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-width: 50px;
  height: 50px;
  border-radius: 16px;
}

.mm-global-compose-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  background: rgba(2, 6, 23, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.24s ease,
    background-color 0.24s ease,
    backdrop-filter 0.24s ease,
    -webkit-backdrop-filter 0.24s ease,
    visibility 0s linear 0.24s;
  z-index: 25050;
}

.mm-global-compose-overlay[aria-hidden="false"],
.mm-global-compose-overlay.is-closing {
  visibility: visible;
  transition:
    opacity 0.24s ease,
    background-color 0.24s ease,
    backdrop-filter 0.24s ease,
    -webkit-backdrop-filter 0.24s ease;
}

.mm-global-compose-overlay[aria-hidden="false"] {
  opacity: 0;
  pointer-events: auto;
  background: rgba(2, 6, 23, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
}

.mm-global-compose-overlay[aria-hidden="false"].is-ready {
  opacity: 1;
  pointer-events: auto;
  background: rgba(2, 6, 23, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.mm-global-compose-overlay.is-closing {
  opacity: 0;
  pointer-events: none;
  background: rgba(2, 6, 23, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
}

.mm-global-compose-shell {
  position: relative;
  width: 100vw;
  height: 100dvh;
  min-height: 100vh;
  border-radius: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  box-shadow: none;
  transform: scale(0.92);
  will-change: transform;
  transition: transform 0.24s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.mm-global-compose-overlay[aria-hidden="false"].is-ready .mm-global-compose-shell {
  transform: scale(1);
}

.mm-global-compose-overlay.is-closing .mm-global-compose-shell {
  transform: scale(0.92);
}

.mm-global-compose-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--surface-border) 74%, #0f172a 26%);
  background: color-mix(in srgb, var(--surface) 92%, #0f172a 8%);
  color: var(--text);
  z-index: 2;
  box-shadow: none;
}

.mm-global-compose-close:hover,
.mm-global-compose-close:focus-visible,
.mm-global-compose-close:active {
  border-color: color-mix(in srgb, var(--primary) 64%, var(--surface-border) 36%);
  background: color-mix(in srgb, var(--surface) 90%, var(--primary) 10%);
  color: var(--text);
  box-shadow: none;
}

.mm-global-compose-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  opacity: 1;
}

.mm-global-compose-loading {
  display: none;
}

body.mm-global-compose-open {
  overflow: hidden;
}

.nav-badge {
  position: absolute;
  top: 6px;
  left: 53%;
  transform: translate(34%, -42%);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

/* Bio modal trigger */
.bio-button-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  margin: 0.35rem 0 0.2rem;
}

.bio-cta-btn {
  grid-area: bio;
  display: none;
  min-height: 44px;
}

.profile-cta-row .bio-cta-btn {
  width: 100%;
}

.bio-open-btn {
  background: transparent;
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  padding: 0.45rem 1rem;
  box-shadow: none;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.bio-open-btn:hover,
.bio-open-btn:focus-visible {
  border-color: var(--primary);
  transform: translateY(-1px);
}

#bio-modal .modal-dialog {
  max-width: 520px;
}

.bio-modal-body {
  text-align: left;
  gap: 0.6rem;
}

#bio-modal p {
  text-align: left;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.floating-nav::before,
.floating-nav::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  display: none;
  pointer-events: none;
}

:root.mm-standalone .floating-nav::after {
  display: block;
  top: 100%;
  height: var(--floating-nav-bottom-offset);
  background: var(--surface);
}

.floating-nav.nav-dragging {
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

:root[data-nav-state="logged-in"] #nav-auth {
  display: none !important;
}
:root[data-nav-state="logged-in"] .floating-nav .nav-create-post-btn {
  display: inline-flex !important;
}
:root[data-nav-state="logged-in"] #nav-profile,
:root[data-nav-state="logged-in"] #nav-settings {
  display: inline-flex !important;
}
:root[data-nav-state="logged-out"] .floating-nav .nav-create-post-btn,
:root[data-nav-state="logged-out"] #nav-profile,
:root[data-nav-state="logged-out"] #nav-settings {
  display: none !important;
}
:root[data-nav-state="logged-out"] #nav-auth {
  display: inline-flex !important;
}

.top-nav {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.top-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.top-nav a:hover {
  border-color: var(--surface-border);
  background: var(--surface-strong);
}

.top-nav-inline {
  align-items: center;
}

.result-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  align-items: stretch;
  position: relative;
  background: linear-gradient(180deg, var(--surface-strong) 0%, var(--surface) 100%);
  border: 1px solid var(--surface-border);
  border-radius: calc(var(--radius) - 2px);
  padding: 0.85rem 1rem 0.95rem;
  box-shadow: var(--shadow);
  overflow: visible;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.18s ease;
}

.result-card:hover,
.result-card:focus-within {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

.result-card.result-card-guest-preview:hover,
.result-card.result-card-guest-preview:focus-within {
  border-color: var(--surface-border);
  transform: none;
  box-shadow: var(--shadow);
}

.demo-post-flag {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #92400e;
}

.mm-feed-social-note {
  display: block;
  padding: 0.72rem 0.82rem;
  border: 1px solid color-mix(in srgb, #f59e0b 34%, var(--surface-border));
  border-radius: calc(var(--radius) - 4px);
  background: color-mix(in srgb, #fff4cf 86%, var(--surface) 14%);
}

.mm-feed-social-note__text {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.4;
  color: #7c2d12;
}

.mm-feed-social-note__link {
  color: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mm-feed-social-note__hide-link {
  appearance: none;
  -webkit-appearance: none;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0;
  margin: 0;
  min-height: 0;
  min-width: 0;
  color: #7c2d12;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
  line-height: inherit;
  transition: none;
  display: inline;
  vertical-align: baseline;
  text-decoration: none;
}

.mm-feed-social-note__hide-link:hover,
.mm-feed-social-note__hide-link:focus,
.mm-feed-social-note__hide-link:focus-visible,
.mm-feed-social-note__hide-link:active {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none;
  color: #7c2d12;
  opacity: 1;
  text-decoration: none;
}

[data-theme="dark"] .demo-post-flag {
  color: #fbbf24;
}

[data-theme="dark"] .mm-feed-social-note {
  border-color: color-mix(in srgb, #f59e0b 44%, var(--surface-border));
  background: color-mix(in srgb, #3b2b0f 64%, var(--surface) 36%);
}

[data-theme="dark"] .mm-feed-social-note__text,
[data-theme="dark"] .mm-feed-social-note__hide-link {
  color: #fcd34d;
}

@media (max-width: 700px) {
  .mm-feed-social-note {
    padding: 0.66rem 0.72rem;
  }

  .mm-feed-social-note__text {
    font-size: 0.82rem;
  }

  .mm-feed-social-note__hide-link {
    font-size: 0.82rem;
  }
}

.result-card.ad-card {
  gap: 0.35rem;
  padding: 0.6rem 0.9rem 0.7rem;
  border-color: #7c3aed;
  background: linear-gradient(180deg, color-mix(in srgb, #7c3aed 10%, var(--surface-strong)) 0%, var(--surface) 100%);
  min-height: 140px;
}

.result-card.ad-card:hover,
.result-card.ad-card:focus-within {
  border-color: #6d28d9;
  box-shadow: 0 10px 28px rgba(124, 58, 237, 0.16);
}

.ad-card .ad-header {
  align-items: center;
  gap: 0.4rem;
  padding-right: 2rem;
}

.ad-card .ad-title {
  font-weight: 700;
  font-size: 0.98rem;
}

.ad-card .ad-meta {
  margin: 0;
}

.ad-card .card-menu-wrapper {
  position: absolute;
  top: 0.15rem;
  right: 0;
}

.ad-card .ad-body {
  min-height: 80px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  justify-content: center;
  overflow: hidden;
}

.ad-card .adsbygoogle {
  display: block;
  min-height: 80px;
  max-height: 100px;
  width: 100%;
  overflow: hidden;
}

.ad-card .ad-placeholder {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.3rem 0.25rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.result-card.ad-card.ad-card-inline-feed {
  min-height: 92px;
  padding: 0.5rem 0.78rem 0.56rem;
  gap: 0.3rem;
}

.ad-card-inline-feed .ad-body {
  min-height: 74px;
  margin-top: 0;
  padding-top: 0.1rem;
}

.ad-card-inline-feed .badge-floating {
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  z-index: 40;
}

.ad-card-inline-feed .card-menu-wrapper {
  position: absolute;
  top: 0.12rem;
  right: 0;
  z-index: 45;
}

.ad-card-inline-feed .card-menu {
  z-index: 55;
}

.ad-card-inline-feed .mm-home-inline-ad-slot,
.ad-card-inline-feed .mm-ad-slot-host {
  min-height: 72px;
  border: 0;
  background: transparent;
  border-radius: 10px;
}

#page-ad-banner.mm-sitewide-ad-slot {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--floating-nav-total-height) + var(--mm-fixed-ad-nav-gap));
  width: min(
    calc(100vw - (var(--mm-fixed-ad-screen-gap) * 2)),
    var(--mm-fixed-ad-content-width, 1100px)
  );
  margin: 0;
  z-index: 1004;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

:root[data-nav-state="logged-in"] #page-ad-banner.mm-sitewide-ad-slot {
  bottom: calc(var(--floating-nav-total-height) + 0.12rem);
}

#page-ad-banner.mm-sitewide-ad-slot.result-card.ad-card.ad-card-inline-feed {
  min-height: 0;
  height: auto;
  max-height: none;
  padding: 0;
  gap: 0;
  overflow: hidden;
}

#page-ad-banner.mm-sitewide-ad-slot .ad-body {
  min-height: 0;
  height: auto;
  max-height: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: stretch;
}

#page-ad-banner.mm-sitewide-ad-slot .mm-home-inline-ad-slot,
#page-ad-banner.mm-sitewide-ad-slot .mm-ad-slot-host,
#page-ad-banner.mm-sitewide-ad-slot .mm-ad-network-slot,
#page-ad-banner.mm-sitewide-ad-slot .mm-ad-house-card {
  min-height: 0;
  height: auto;
  max-height: none;
  width: 100%;
}

#page-ad-banner.mm-sitewide-ad-slot .mm-ad-slot-host {
  border: 0;
  border-radius: 0;
  background: transparent;
}

#page-ad-banner.mm-sitewide-ad-slot .mm-ad-network-slot-adsterra-banner {
  justify-content: flex-start;
  align-items: stretch;
  line-height: 0;
}

#page-ad-banner.mm-sitewide-ad-slot .mm-ad-network-slot-adsterra-banner iframe {
  width: 100% !important;
  height: auto !important;
  max-width: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  display: block;
  border: 0;
}

.ad-banner-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--floating-nav-total-height) + 0.35rem);
  padding: 0 0.9rem;
  z-index: 998;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

:root[data-nav-state="logged-in"] .ad-banner-bar {
  bottom: calc(var(--floating-nav-total-height) + 0.12rem);
}

.ad-banner-card {
  width: min(720px, 100%);
  pointer-events: auto;
}

.ad-banner-thin {
  height: 70px !important;
  min-height: 70px !important;
  padding: 0 !important;
  position: relative;
  overflow: visible;
}

.ad-banner-thin.result-card.ad-card {
  gap: 0.2rem;
  padding: 0.45rem 0.85rem 0.55rem;
}

.ad-banner-thin .ad-header {
  display: none;
}

.ad-banner-thin .ad-title {
  font-size: 0.9rem;
}

.ad-banner-thin .ad-body {
  min-height: 70px;
  height: 70px;
  gap: 0.15rem;
  padding: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.ad-banner-thin .adsbygoogle {
  min-height: 70px !important;
  height: 70px !important;
  width: 100% !important;
  overflow: hidden !important;
}

.ad-banner-thin .ad-placeholder {
  min-height: 70px !important;
}

.ad-banner-thin .adsbygoogle iframe {
  height: 70px !important;
  min-height: 70px !important;
  width: 100% !important;
  display: block !important;
  overflow: hidden !important;
  max-height: 70px !important;
}

.badge-ads {
  display: none !important;
}

.result-card .inline-header {
  align-items: flex-start;
}

.post-header-row {
  position: relative;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 0.85rem;
  flex-wrap: wrap;
  padding-right: 2.6rem;
  z-index: 1;
}

.post-header-row > div:nth-child(1) {
  min-width: 0;
}

.post-header-row .card-menu-wrapper {
  position: absolute;
  top: 0.05rem;
  right: 0;
  margin: 0;
  z-index: 20000;
}

.post-author {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  position: relative;
  z-index: 3;
}

.post-avatar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  position: relative;
  z-index: 4;
  pointer-events: auto;
}

.post-author-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  position: relative;
  z-index: 3;
}

.post-author-name-row {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.post-author-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  position: relative;
  z-index: 1;
  flex: 1;
}

.post-author-name {
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  margin: 0;
  letter-spacing: -0.01em;
}

.post-author-name-link {
  color: inherit;
  text-decoration: none;
  display: inline-block;
  width: fit-content;
  flex: 0 1 auto;
  position: relative;
  z-index: 4;
  pointer-events: auto;
}

.post-author-name:hover {
  text-decoration: underline;
}

.post-author-city {
  margin: 0;
  color: var(--muted);
}

.post-avatar {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: 1px solid var(--surface-border);
  background: var(--surface-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  text-decoration: none;
}

.post-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-avatar .avatar-fallback {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 800;
  font-size: 1rem;
  background: color-mix(in srgb, var(--primary) 12%, var(--surface-strong));
}

.result-title {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.result-title:hover {
  text-decoration: underline;
}

.result-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.result-info-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: center;
}

.result-title-top {
  margin: 0 0 0.4rem;
}

.avatar-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--surface-strong);
  border: 1px solid var(--surface-border);
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 1.4rem;
}

.avatar-placeholder img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-avatar-link {
  display: inline-flex;
  align-items: center;
}

.result-avatar-link-static {
  cursor: default;
}

.result-title {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 0.25rem;
}

.result-title:hover {
  text-decoration: underline;
}

.result-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.result-main-instrument {
  font-weight: 700;
  color: var(--text);
}

.result-instruments {
  color: var(--muted);
}

.profile-header {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 1.1rem;
  row-gap: 0.2rem;
}

.avatar-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 84px;
  flex-shrink: 0;
}

.profile-top-block {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 1rem;
  row-gap: 0.2rem;
  width: 100%;
  grid-column: 1 / -1;
}

.profile-cta-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas:
    "rates video"
    "bio message";
  align-items: stretch;
  justify-content: space-between;
  gap: 0.5rem;
  grid-auto-rows: 44px;
  margin-top: 0.55rem;
  margin-bottom: 0.35rem;
  width: 100%;
}

.profile-cta-row button {
  width: 100%;
  padding: 0 1rem;
  display: grid;
  place-items: center;
  line-height: 1.1;
  box-sizing: border-box;
}

.profile-cta-row .bio-cta-btn {
  grid-area: bio;
  display: none;
  justify-self: stretch;
}

.profile-cta-row .rates-btn {
  grid-area: rates;
  margin-top: 0;
  min-height: 44px;
  grid-column: 1 / 2;
  align-self: center;
}

.profile-cta-row #video-open-modal {
  grid-area: video;
}

.profile-cta-row .cta-half {
  max-width: 100%;
  grid-column: auto;
}

.profile-cta-row .cta-full {
  max-width: 100%;
}

.profile-details-btn {
  grid-area: details;
  display: none;
  grid-column: 1 / 2;
  grid-row: 2 / 3;
  justify-self: stretch;
  width: 100%;
  grid-column: 1 / 2 !important;
  grid-row: 2 / 3 !important;
}

.profile-cta-row.own-profile .profile-details-btn {
  grid-column: 1 / -1 !important;
  grid-row: 2 / 3 !important;
}

.profile-cta-row .message-btn {
  grid-area: message;
}

.profile-cta-row.no-message {
  grid-template-areas:
    "rates video"
    "bio bio";
}

.profile-cta-row.no-message .bio-cta-btn {
  grid-column: 1 / -1;
}

@media (min-width: 769px) {
  .profile-cta-row {
    grid-template-areas:
      "rates video"
      "bio message";
  }
  .profile-cta-row .bio-cta-btn {
    display: flex;
    justify-content: center;
    align-items: center;
  }
}

.profile-name-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-self: center;
  align-items: flex-start;
  gap: 0.35rem;
  min-height: 84px;
}

@media (max-width: 768px) {
  .profile-cta-row {
    gap: 0.4rem;
    grid-template-areas:
      "rates video"
      "details message";
  }
  .profile-cta-row .bio-cta-btn {
    display: none !important;
  }
  .profile-cta-row .rates-btn {
    grid-column: 1 / 2;
    align-self: stretch;
  }
  .profile-cta-row .profile-details-btn {
    display: flex;
    grid-column: 1 / -1;
    height: 44px;
    align-self: center;
  }
  .profile-cta-row #video-open-modal {
    grid-column: 2 / 3;
    align-self: center;
  }
  .bio-button-row {
    justify-content: flex-start;
  }
  #profile-details-shell {
    min-height: 0;
  }
  #profile-details-shell .profile-details-grid {
    grid-template-columns: 1fr 1fr;
  }
  #profile-details-modal-body .profile-details-grid {
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  .profile-cta-row.no-message {
    grid-template-areas:
      "rates video"
      "details details";
  }
}

@media (max-width: 540px) {
  #profile-details-shell .profile-details-grid,
  #profile-details-modal-body .profile-details-grid {
    grid-template-columns: 1fr;
  }
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
}

.profile-title-group {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.profile-title-group #profile-title {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-admin-mode {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  flex: 0 0 auto;
  align-self: center;
}

html:not([data-admin-account="true"]) #profile-admin-mode-wrap {
  display: none !important;
}

.profile-admin-mode__label {
  font-size: 0.71rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1;
}

.profile-admin-mode__select {
  height: 2rem;
  padding: 0 1.45rem 0 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  margin: 0;
  display: block;
}

.profile-admin-mode__select:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--primary) 54%, transparent);
  outline-offset: 1px;
}

.profile-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin-left: auto;
}

@media (max-width: 640px) {
  .profile-name-row {
    flex-wrap: wrap;
    column-gap: 0.45rem;
    row-gap: 0.38rem;
  }

  .profile-title-group {
    flex: 1 1 auto;
    min-width: 0;
  }

  .profile-actions {
    margin-left: auto;
    flex: 0 0 auto;
    max-width: 100%;
  }

  html[data-admin-account="true"] #profile-admin-mode-wrap {
    order: 3;
    flex: 0 0 100%;
    justify-content: flex-start;
  }

  .profile-admin-mode__label {
    display: none;
  }

  .profile-admin-mode__select {
    min-width: 5.8rem;
    font-size: 0.76rem;
  }

  .profile-meta {
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 0.08rem;
    overflow: hidden;
    white-space: nowrap;
    min-width: 0;
    max-width: 100%;
    font-size: var(--mm-profile-meta-font-size, clamp(0.7rem, 2.8vw, 0.9rem));
  }
  .profile-meta .meta-item {
    flex: 0 0 auto;
    min-width: 0;
    white-space: nowrap;
  }
  .profile-meta .meta-item.with-sep::before {
    margin: 0 0.2em;
  }
}

@media (max-width: 560px) {
  .profile-top-block {
    grid-template-columns: 1fr;
    grid-template-areas:
      "name"
      "avatar"
      "meta";
    row-gap: 0.65rem;
  }
  .profile-name-block {
    display: contents;
  }
  .profile-name-row {
    grid-area: name;
  }
  html[data-admin-account="true"] #profile-admin-mode-wrap {
    margin-top: 0.02rem;
  }
  .avatar-block {
    grid-area: avatar;
    justify-self: center;
    width: 96px;
  }
  .profile-meta {
    grid-area: meta;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-align: center;
    min-width: 0;
    font-size: var(--mm-profile-meta-font-size, clamp(0.62rem, 2.7vw, 0.86rem));
  }
  .profile-meta .meta-item {
    min-width: 0;
    white-space: nowrap;
    font-size: 1em;
  }
  .profile-meta .meta-item.with-sep::before {
    margin: 0 0.16em;
  }
}

.profile-pro-badge {
  display: none;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
}

.profile-pro-badge.visible {
  display: inline-flex;
}

.profile-pro-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pro-badge-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 0.2rem;
}

.pro-badge-inline img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Allinea leggermente più in basso l'icona Pro nei titoli delle schede (ricerca). */
.result-title-top .pro-badge-inline {
  position: relative;
  top: 4px;
}

/* Bottone "Attiva Pro" con riga prova */
#btn-pro-activate.btn-pro-trial {
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

#btn-pro-activate .btn-pro-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.05;
}

#btn-pro-activate .btn-pro-stack .xsmall {
  margin-top: 0.12rem;
}

.profile-settings-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  padding: 4px;
  box-shadow: none;
  transition: none;
  position: relative;
}

.profile-settings-badge {
  top: 4px;
  right: 1px;
  left: auto;
  transform: translate(20%, -32%);
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  line-height: 14px;
  font-size: 9px;
}

.profile-admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 0.55rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--primary) 48%, var(--surface-border));
  background: color-mix(in srgb, var(--primary) 16%, var(--surface));
  color: var(--primary);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1;
  box-shadow: none;
  transition: none;
  margin-right: 0.2rem;
}

.profile-fav-toggle,
.profile-fav-open,
.profile-liked-open,
.profile-like-toggle {
  padding: 0.3rem;
  border-radius: 8px;
  border: none !important;
  background: transparent !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none !important;
  transition: none;
  vertical-align: middle;
  margin-top: -2px;
  outline: none;
}

.profile-fav-toggle.is-active,
.profile-like-toggle.is-active {
  background: transparent !important;
}

.profile-settings-link:hover,
.profile-settings-link:focus-visible {
  background: transparent !important;
  color: inherit !important;
  border-color: transparent !important;
  transform: none;
  box-shadow: none;
  outline: none;
}

.profile-fav-toggle:hover,
.profile-fav-toggle:focus-visible,
.profile-like-toggle:hover,
.profile-like-toggle:focus-visible,
.profile-fav-open:hover,
.profile-fav-open:focus-visible,
.profile-admin-link:hover,
.profile-admin-link:focus-visible {
  transform: none;
  outline: none;
  box-shadow: none;
}

.profile-fav-toggle img,
.profile-like-toggle img,
.profile-fav-open img {
  display: block;
}

.profile-like-toggle img,
.likes-icon img {
  opacity: 1;
  transition: transform 0.2s ease;
}

.profile-fav-open img,
.profile-liked-open img,
.profile-fav-toggle img,
.profile-like-toggle img,
.likes-icon img {
  filter: none !important;
}

.profile-fav-toggle.fav-bounce,
.profile-fav-toggle.fav-bounce img,
.profile-fav-open.fav-bounce,
.profile-fav-open.fav-bounce img,
.profile-liked-open.fav-bounce,
.profile-liked-open.fav-bounce img,
.profile-settings-link.fav-bounce,
.profile-settings-link.fav-bounce img,
.profile-admin-link.fav-bounce {
  animation: fav-bounce 320ms ease;
  transform-origin: center;
}

.profile-like-toggle.like-bounce,
.profile-like-toggle.like-bounce img,
.likes-icon.like-bounce img {
  animation: fav-bounce 320ms ease;
  transform-origin: center;
}

.fav-toast {
  position: fixed;
  padding: 0.4rem 0.7rem;
  background: var(--surface-strong);
  color: var(--text);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.18);
  font-size: 0.86rem;
  line-height: 1.3;
  z-index: 9999;
  transform: translate(-50%, -4px) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.fav-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 6px) scale(1);
}

.fav-toast::after {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 7px solid var(--surface-strong);
}

.admin-test-page .card h2 {
  font-size: 1.1rem;
}

.admin-access-card {
  gap: 0.45rem;
}

.admin-access-line {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.admin-access-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.admin-inline-help-link {
  font-weight: 700;
  text-decoration: none;
  color: var(--primary);
}

.admin-inline-help-link:hover,
.admin-inline-help-link:focus-visible {
  text-decoration: underline;
}

.admin-controls-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.12rem;
  scrollbar-width: thin;
}

.admin-controls-row > .ghost {
  flex: 0 0 auto;
}

.admin-category-buttons {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.3rem;
  flex: 0 1 auto;
  min-width: 0;
}

.admin-category-buttons .ghost {
  white-space: nowrap;
  min-height: 42px;
  padding: 0.5rem 1rem;
  border-radius: calc(var(--radius) - 6px);
  font-size: inherit;
  line-height: 1.2;
}

.admin-history-disclosure {
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  padding: 0.2rem 0.65rem;
}

.admin-history-disclosure[open] {
  padding-bottom: 0.6rem;
}

.admin-history-summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  user-select: none;
  list-style: none;
  padding: 0.45rem 0;
}

.admin-history-summary::-webkit-details-marker {
  display: none;
}

.admin-history-summary-title {
  font-size: 1rem;
  font-weight: 800;
}

.admin-history-summary-subtitle {
  margin-left: auto;
  text-align: right;
}

.admin-history-summary::after {
  content: '▾';
  font-size: 0.9rem;
  color: var(--muted);
  transition: transform 160ms ease;
}

.admin-history-disclosure[open] .admin-history-summary::after {
  transform: rotate(180deg);
}

.admin-history-panel {
  padding-top: 0.35rem;
}

.admin-target-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.55rem;
}

.admin-target-select {
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text);
  padding: 0 0.7rem;
  font-weight: 700;
}

.admin-options-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
}

.admin-runtime-grid {
  margin-top: 0.7rem;
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-runtime-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.admin-badge--info {
  background: color-mix(in srgb, var(--primary) 16%, var(--surface));
  color: var(--primary);
}

.admin-badge--pass {
  background: color-mix(in srgb, #16a34a 20%, var(--surface));
  color: #166534;
}

.admin-badge--warn {
  background: color-mix(in srgb, #f59e0b 18%, var(--surface));
  color: #92400e;
}

.admin-badge--fail {
  background: color-mix(in srgb, #ef4444 18%, var(--surface));
  color: #991b1b;
}

.admin-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-card-title-main {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-card-title-row #admin-clear-report {
  margin-left: auto;
}

.admin-summary-spinner {
  position: relative;
  width: 18px;
  height: 18px;
  animation: adminSummarySpin 0.9s linear infinite;
}

.admin-summary-spinner[hidden] {
  display: none !important;
}

.admin-summary-spinner__dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  margin: -2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 72%, #ffffff 28%);
  transform: rotate(calc(var(--dot-index) * 45deg)) translateY(-7px);
  opacity: calc(0.18 + (var(--dot-index) * 0.1));
}

.admin-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

@keyframes adminSummarySpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.admin-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.admin-pill--pass {
  background: color-mix(in srgb, #16a34a 18%, var(--surface));
  color: #166534;
}

.admin-pill--warn {
  background: color-mix(in srgb, #f59e0b 18%, var(--surface));
  color: #92400e;
}

.admin-pill--skip {
  background: color-mix(in srgb, #64748b 20%, var(--surface));
  color: #334155;
}

.admin-pill--fail {
  background: color-mix(in srgb, #ef4444 18%, var(--surface));
  color: #991b1b;
}

.admin-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 24px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.015em;
}

.admin-status--pass {
  background: color-mix(in srgb, #16a34a 20%, var(--surface));
  color: #166534;
}

.admin-status--warn {
  background: color-mix(in srgb, #f59e0b 20%, var(--surface));
  color: #92400e;
}

.admin-status--skip {
  background: color-mix(in srgb, #64748b 20%, var(--surface));
  color: #334155;
}

.admin-status--fail {
  background: color-mix(in srgb, #ef4444 20%, var(--surface));
  color: #991b1b;
}

.admin-results-table th,
.admin-results-table td {
  vertical-align: top;
}

.admin-history-table th,
.admin-history-table td {
  vertical-align: top;
}

.admin-history-open {
  min-height: 30px;
  min-width: 86px;
}

.admin-history-open.is-active {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--surface-border));
  background: color-mix(in srgb, var(--primary) 14%, var(--surface));
}

.admin-log {
  margin: 0.6rem 0 0;
  min-height: 200px;
  max-height: 360px;
  overflow: auto;
  padding: 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--surface-border);
  background: color-mix(in srgb, var(--surface-strong) 96%, transparent);
  font-size: 0.78rem;
  line-height: 1.42;
}

.admin-tabs-card {
  padding: 0.75rem 0.9rem;
}

.admin-tab-pill-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.1rem;
}

.admin-tab-pill {
  white-space: nowrap;
  min-height: 38px;
  flex: 0 0 auto;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
  outline: none !important;
}

.admin-tab-pill:hover,
.admin-tab-pill:focus,
.admin-tab-pill:focus-visible,
.admin-tab-pill:active {
  border-color: var(--surface-border) !important;
  background: var(--surface) !important;
  color: var(--text) !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
  outline: none !important;
}

.admin-tab-pill.is-active,
.admin-tab-pill[aria-selected="true"] {
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
  outline: none !important;
}

.admin-tab-pill.is-active,
.admin-tab-pill[aria-selected="true"] {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 16%, var(--surface));
  color: var(--primary);
}

.admin-tab-panel[hidden] {
  display: none !important;
}

.admin-snippets-head {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.7rem;
}

.admin-snippets-grid {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
  gap: 0.8rem;
}

.admin-snippets-menu {
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  padding: 0.65rem;
  max-height: 68vh;
  overflow: auto;
}

.admin-snippet-group + .admin-snippet-group {
  margin-top: 0.8rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--surface-border);
}

.admin-snippet-group-title {
  margin: 0 0 0.45rem;
  font-size: 0.84rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
}

.admin-snippet-group-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-snippet-btn {
  justify-content: flex-start;
  text-align: left;
  min-height: 36px;
  padding: 0.45rem 0.7rem;
}

.admin-snippet-btn.is-active {
  border-color: color-mix(in srgb, var(--primary) 50%, var(--surface-border));
  background: color-mix(in srgb, var(--primary) 14%, var(--surface));
  color: var(--primary);
}

.admin-snippets-detail {
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  padding: 0.8rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.admin-snippet-category {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 800;
}

.admin-snippet-title {
  margin: 0;
  font-size: 1.05rem;
}

.admin-snippet-description {
  margin: 0;
}

.admin-snippet-hint {
  margin: 0;
}

.admin-snippet-params {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.55rem;
}

.admin-snippet-param {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.admin-snippet-param-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
}

.admin-snippet-param input {
  min-height: 34px;
  border-radius: 10px;
}

.admin-snippet-param select,
.admin-snippet-param .admin-snippet-param-select {
  min-height: 34px;
  border-radius: 10px;
}

.admin-snippet-code {
  margin: 0;
  min-height: 120px;
  max-height: 280px;
  overflow: auto;
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--surface-border);
  background: color-mix(in srgb, var(--surface-strong) 96%, transparent);
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text);
}

.admin-snippet-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.admin-snippet-actions .admin-summary-spinner {
  margin-left: 0.2rem;
}

.admin-snippet-feedback {
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
}

.admin-snippet-feedback[data-status="ok"] {
  border-color: color-mix(in srgb, #16a34a 38%, var(--surface-border));
  background: color-mix(in srgb, #16a34a 12%, var(--surface));
}

.admin-snippet-feedback[data-status="error"] {
  border-color: color-mix(in srgb, #ef4444 44%, var(--surface-border));
  background: color-mix(in srgb, #ef4444 11%, var(--surface));
}

.admin-snippet-feedback-title {
  font-size: 0.84rem;
}

.admin-snippet-feedback pre {
  margin: 0.4rem 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.78rem;
  line-height: 1.42;
}

.admin-ads-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.admin-ads-switch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 0.75rem;
  gap: 0.75rem;
}

.admin-ads-switch-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.admin-ads-switch-label {
  font-size: 0.95rem;
  font-weight: 800;
}

.admin-ads-switch-note {
  margin: 0;
}

.admin-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 88px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  background: color-mix(in srgb, #ef4444 28%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #ef4444 22%, transparent);
  cursor: pointer;
  transition: background 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  justify-self: end;
}

.admin-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.admin-switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
}

.admin-switch-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.26);
  transition: transform 190ms ease;
}

.admin-switch-state {
  position: absolute;
  right: 10px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #7f1d1d;
  text-transform: uppercase;
}

.admin-switch input:checked + .admin-switch-track + .admin-switch-thumb {
  transform: translateX(46px);
}

.admin-switch input:checked ~ .admin-switch-state {
  right: auto;
  left: 11px;
  color: #14532d;
}

.admin-switch.is-on {
  background: color-mix(in srgb, #22c55e 30%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #22c55e 26%, transparent);
  border-color: color-mix(in srgb, #22c55e 46%, var(--surface-border));
}

.admin-switch:focus-within {
  outline: 2px solid color-mix(in srgb, var(--primary) 44%, transparent);
  outline-offset: 2px;
}

.admin-ads-dashboard {
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  padding: 0.7rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.admin-communications-card {
  width: 100%;
  overflow: hidden;
}

.admin-communications-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.8rem;
  margin-top: 0.75rem;
}

.admin-communications-fieldset {
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 0.75rem 0.8rem 0.8rem;
  min-width: 0;
}

.admin-communications-fieldset legend {
  padding: 0 0.2rem;
}

.admin-communications-field-full {
  grid-column: 1 / -1;
}

.admin-communications-editor-shell {
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  overflow: hidden;
}

.admin-communications-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 0.1rem;
}

.admin-communications-check-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  min-height: 34px;
  padding: 0.32rem 0.05rem;
  border-bottom: 1px solid color-mix(in srgb, var(--surface-border) 88%, transparent);
}

.admin-communications-check-row:last-child {
  border-bottom: 0;
}

.admin-communications-check-label {
  color: color-mix(in srgb, var(--text) 82%, var(--muted));
  font-size: 0.82rem;
  font-weight: 560;
  line-height: 1.3;
}

.admin-communications-check-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
}

.admin-communications-toolbar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid color-mix(in srgb, var(--surface-border) 92%, transparent);
  background: color-mix(in srgb, var(--surface-strong) 94%, transparent);
}

.admin-communications-toolbar-group {
  display: inline-flex;
  align-items: center;
}

.admin-communications-toolbar select {
  min-height: 34px;
  border-radius: 10px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text);
  padding: 0.42rem 0.7rem;
  font-size: 0.88rem;
}

.admin-editor-btn {
  min-height: 34px;
  padding-inline: 0.8rem;
}

.admin-editor-btn[aria-pressed="true"],
.admin-editor-btn.is-active {
  border-color: var(--primary) !important;
  background: color-mix(in srgb, var(--primary) 14%, var(--surface)) !important;
  color: var(--primary) !important;
}

.admin-communications-editor {
  min-height: 180px;
  padding: 0.9rem 0.85rem 1rem;
  outline: none;
  line-height: 1.6;
  color: var(--text);
  white-space: normal;
  overflow-wrap: anywhere;
}

.admin-communications-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
}

.admin-communications-editor div,
.admin-communications-editor p {
  margin: 0 0 0.55rem;
}

.admin-communications-editor div:last-child,
.admin-communications-editor p:last-child {
  margin-bottom: 0;
}

.admin-communications-editor s,
.admin-communications-editor strike {
  text-decoration-line: line-through;
  text-decoration-thickness: 0.08em;
  text-decoration-skip-ink: none;
}

.admin-communications-history {
  margin-top: 1rem;
  border-top: 1px solid color-mix(in srgb, var(--surface-border) 92%, transparent);
  padding-top: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.admin-communications-history__head {
  align-items: flex-start;
  gap: 0.7rem;
}

.admin-communications-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.admin-communications-history-item {
  border: 1px solid color-mix(in srgb, var(--surface-border) 92%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  padding: 0.8rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.admin-communications-history-item__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
}

.admin-communications-history-item__title-wrap {
  min-width: 0;
}

.admin-communications-history-item__title {
  margin: 0;
  font-size: 0.98rem;
}

.admin-communications-history-item__meta {
  margin: 0.18rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.admin-communications-history-item__metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  color: var(--muted);
  font-size: 0.83rem;
}

.admin-communications-history-item__metrics strong {
  color: var(--text);
}

.admin-ads-stats-card {
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 0.75rem 0.8rem;
  background: color-mix(in srgb, var(--surface-strong) 94%, transparent);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.admin-ads-stats-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-ads-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.65rem;
}

.admin-ads-stat-tile {
  border: 1px solid color-mix(in srgb, var(--surface-border) 92%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  padding: 0.7rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-ads-stat-title {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 800;
}

.admin-ads-stat-metrics {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

.admin-ads-stat-row {
  margin: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  font-size: 0.9rem;
}

.admin-ads-stat-row span {
  color: var(--muted);
}

.admin-ads-stat-row strong {
  font-size: 1rem;
  font-weight: 800;
}

.admin-users-qr-card {
  width: 100%;
  overflow: hidden;
}

.admin-users-qr-card .grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.admin-users-qr-card .users-qr-monthly-row,
.admin-users-qr-card .users-qr-item__head {
  min-width: 0;
}

.admin-users-qr-card .users-qr-item__title,
.admin-users-qr-card .users-qr-item__meta,
.admin-users-qr-card .users-qr-item__link,
.admin-users-qr-card .users-qr-preview__meta a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.admin-support-card {
  width: 100%;
  overflow: hidden;
}

.admin-support-layout {
  margin-top: 0.35rem;
  min-height: 560px;
  gap: 0.7rem;
}

.admin-support-layout .threads-panel,
.admin-support-layout .chat-panel {
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 97%, transparent);
  padding: 0.7rem;
}

.admin-support-chat {
  gap: 0.65rem;
}

.admin-support-chat .chat-history {
  height: 340px;
  min-height: 340px;
  max-height: 340px;
  overflow-y: auto;
}

.admin-support-chat-input button {
  width: auto;
  min-width: 92px;
  transform: none;
  height: 44px;
}

@media (max-width: 900px) {
  .admin-runtime-grid {
    grid-template-columns: 1fr;
  }
  .admin-target-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .admin-controls-row {
    gap: 0.35rem;
  }
  .admin-category-buttons {
    gap: 0.22rem;
  }
  .admin-history-summary {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .admin-history-summary-subtitle {
    margin-left: 0;
    text-align: left;
  }
  .admin-snippets-grid {
    grid-template-columns: 1fr;
  }
  .admin-snippets-menu {
    max-height: none;
  }
  .admin-snippet-params {
    grid-template-columns: 1fr;
  }
  .admin-switch {
    width: 70px;
    height: 32px;
  }
  .admin-switch-thumb {
    top: 4px;
    left: 4px;
    width: 24px;
    height: 24px;
  }
  .admin-switch input:checked + .admin-switch-track + .admin-switch-thumb {
    transform: translateX(38px);
  }
  .admin-switch-state {
    font-size: 0.62rem;
    right: 7px;
  }
  .admin-switch input:checked ~ .admin-switch-state {
    left: 7px;
  }
  .admin-users-qr-card .grid {
    grid-template-columns: 1fr;
  }
  .admin-users-qr-card .users-qr-monthly-row,
  .admin-users-qr-card .users-qr-item__head {
    flex-direction: column;
    align-items: flex-start;
  }
  .admin-support-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .admin-support-layout .threads-panel,
  .admin-support-layout .chat-panel {
    padding: 0.65rem;
  }
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.6rem;
  margin-top: 0.9rem;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 0.2rem;
}

#liked-videos-list.video-grid {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

#liked-videos-list .video-card header,
#liked-videos-list .liked-owner-slot,
#liked-videos-list .liked-owner {
  background: transparent !important;
}

#liked-videos-list .liked-owner {
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.video-card {
  background: transparent;
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.video-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  font-weight: 700;
  padding: 0.15rem 0;
}

.video-title-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.28rem 0.55rem;
  font-weight: 700;
  background: transparent;
  background-color: transparent !important;
  appearance: none;
  -webkit-appearance: none;
  min-height: 36px;
  box-shadow: none;
  outline: none;
}

.video-title-input[readonly] {
  cursor: default;
  border-color: transparent !important;
}

.video-card.is-editing .video-title-input {
  border-color: var(--surface-border);
}

.video-card.is-editing .video-title-input:focus {
  border-color: var(--primary);
}

.video-actions-icons {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.video-icon-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.video-icon-btn:hover,
.video-icon-btn:active,
.video-icon-btn:focus,
.video-icon-btn:focus-visible {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.video-icon-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--primary) 55%, transparent);
  outline-offset: 2px;
}

.video-icon-btn img {
  width: 18px;
  height: 18px;
  display: block;
}

.video-card video {
  width: 100%;
  max-height: min(320px, 50vh);
  border-radius: 10px;
  background: #000;
  object-fit: contain;
  display: block;
  position: relative;
}

#vd-preview-video {
  width: 100%;
  max-height: min(70vh, 560px);
  border-radius: 10px;
  background: #000;
  object-fit: contain;
  display: block;
}

.video-frame {
  position: relative;
  width: 100%;
  --mm-title-fade-width: 0px;
  border-radius: 10px;
  overflow: hidden;
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  padding: 0.35rem 0.4rem;
  min-height: 55px;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  background: transparent;
  opacity: 1;
  transition: opacity 500ms ease;
  pointer-events: auto;
  overflow: hidden;
  z-index: 2;
}

.video-overlay::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 55px;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.28) 50%,
    rgba(0, 0, 0, 0.12) 80%,
    rgba(0, 0, 0, 0) 100%
  );
  pointer-events: none;
}

.video-frame.is-overlay-hidden .video-overlay {
  opacity: 0;
  pointer-events: none;
}

.video-download-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 3;
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.video-download-badge::before {
  content: '';
  width: 14px;
  height: 14px;
  mask: url('../assets/icons/download.svg') center/contain no-repeat;
  -webkit-mask: url('../assets/icons/download.svg') center/contain no-repeat;
  background: currentColor;
  display: inline-block;
}

.video-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0.18rem 0.4rem 0.18rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.62) 60%, rgba(0, 0, 0, 0.8) 100%);
  color: #fff;
  z-index: 2;
  opacity: 1;
  transition: opacity 500ms ease;
  pointer-events: auto;
}

.video-frame.is-overlay-hidden .video-controls {
  opacity: 0;
  pointer-events: none;
}

.video-progress-wrap {
  flex: 1 1 100%;
  min-width: 0;
  margin-bottom: -0.1rem;
}

.video-ctrl-btn {
  background: transparent;
  color: #fff;
  border: none;
  border-radius: 0;
  padding: 0.12rem 0.16rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  cursor: pointer;
}

.video-ctrl-btn:hover,
.video-ctrl-btn:focus-visible {
  background: transparent;
  outline: none;
}

.video-ctrl-btn span {
  line-height: 1;
  font-size: 14px;
}

.video-progress {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  height: 6px;
  border-radius: 999px;
  --mm-progress: 0%;
  border: none;
  box-shadow: none;
  outline: none;
  padding: 0;
}
.video-progress::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary) var(--mm-progress, 0%), rgba(255,255,255,0.12) var(--mm-progress, 0%), rgba(255,255,255,0.12) 100%);
  border: none;
  box-shadow: none;
}
.video-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: -4px; /* centra il thumb sul track */
  border: none;
}
.video-progress::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary) var(--mm-progress, 0%), rgba(255,255,255,0.12) var(--mm-progress, 0%), rgba(255,255,255,0.12) 100%);
  border: none;
  box-shadow: none;
}
.video-progress::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
}

.video-time {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.78rem;
  min-width: 74px;
  text-align: left;
  line-height: 1;
}

.video-volume-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  position: relative;
}

.video-volume {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-52%) translateY(-152%) rotate(-90deg);
  transform-origin: center;
  width: 110px;
  accent-color: #fff;
  background: rgba(255, 255, 255, 0.25);
  padding: 0;
}

.video-volume-wrap.is-open .video-volume {
  display: block;
}

.video-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: -0.2rem;
}

.video-controls-left {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1 1 auto;
  min-width: 180px;
}

.video-controls-right {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
}

.video-info-chip,
.info-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  line-height: 20px;
  border-radius: 50%;
  box-sizing: border-box;
  flex-shrink: 0;
  border: 1px solid rgba(148, 163, 184, 0.9);
  background: transparent;
  color: rgba(71, 85, 105, 0.95);
  font-weight: 800;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  box-shadow: none;
  transition: none;
  pointer-events: auto;
}

.video-info-chip:focus-visible,
.info-chip:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--primary) 40%, transparent);
  outline-offset: 2px;
}

.video-info-chip:hover,
.video-info-chip:active,
.info-chip:hover,
.info-chip:active {
  background: transparent;
  box-shadow: none;
  transform: none;
  outline: none;
}

.video-info-popover,
.info-popover {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.3rem;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.18);
  border: 1px solid var(--surface-border);
  font-size: 0.8rem;
  line-height: 1.3;
  min-width: 260px;
  max-width: min(320px, 80vw);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.video-info-popover.is-open,
.info-popover.is-open {
  opacity: 1;
  pointer-events: auto;
}

.info-with-popover {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  pointer-events: auto;
}


@media (max-width: 540px) {
  .video-controls-left {
    flex-wrap: wrap;
    min-width: 140px;
  }
  .video-volume {
    width: 64px;
  }
}

.video-like-overlay {
  position: absolute;
  right: 10px;
  bottom: 92px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  opacity: 1;
  transition: opacity 500ms ease;
  pointer-events: auto;
}

.video-frame.is-overlay-hidden .video-like-overlay {
  opacity: 0;
  pointer-events: none;
}

.video-like-btn {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.96);
}

.video-like-btn:hover,
.video-like-btn:active,
.video-like-btn:focus {
  background: transparent;
}

.video-like-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, #fff 70%, transparent);
  outline-offset: 2px;
}

.video-like-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.video-like-btn path {
  fill: transparent;
  stroke: rgba(255, 255, 255, 0.96);
  stroke-width: 2px;
}

.video-like-btn.is-liked path {
  fill: #ff2b55;
  stroke: #ff2b55;
}

.video-like-count {
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.6rem;
  line-height: 1;
  margin-top: -6px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  user-select: none;
  -webkit-user-select: none;
}

.video-overlay-title {
  flex: 1;
  min-width: 0;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  padding: 0.15rem 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
  z-index: 1;
}

.video-overlay .video-title-input {
  flex: 1 1 auto;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  padding: 0.15rem 0.35rem;
  min-height: 30px;
  font-weight: 800;
  position: relative;
  z-index: 1;
}

.video-frame.has-menu-open .video-overlay-title,
.video-frame.has-menu-open .video-title-input {
  -webkit-mask-image: linear-gradient(
    to right,
    #000 0,
    #000 calc(100% - var(--mm-title-fade-width)),
    rgba(0, 0, 0, 0.55) calc(100% - var(--mm-title-fade-width) + 18px),
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    #000 0,
    #000 calc(100% - var(--mm-title-fade-width)),
    rgba(0, 0, 0, 0.55) calc(100% - var(--mm-title-fade-width) + 18px),
    transparent 100%
  );
}

.video-overlay .video-title-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.video-frame.is-title-editing .video-title-input,
.video-frame.is-title-editing .video-overlay-title {
  -webkit-mask-image: none;
  mask-image: none;
}

.video-frame.is-title-editing .video-title-input {
  padding-right: 2.4rem;
}

.video-overlay .video-menu-trigger,
.video-overlay .video-menu-close {
  color: rgba(255, 255, 255, 0.9);
  position: relative;
  z-index: 1;
}

.video-overlay .video-menu-trigger:hover,
.video-overlay .video-menu-trigger:active,
.video-overlay .video-menu-trigger:focus,
.video-overlay .video-menu-close:hover,
.video-overlay .video-menu-close:active,
.video-overlay .video-menu-close:focus {
  background: transparent;
}

.video-overlay .video-menu {
  margin-left: auto;
  align-self: flex-start;
}

.video-overlay .video-menu-popover {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  gap: 0.05rem;
  backdrop-filter: none;
  position: absolute;
  top: 50%;
  right: 0;
  z-index: 1;
  display: inline-flex;
  justify-content: flex-end;
  flex-direction: row;
  transform: translateY(-50%);
}

.video-overlay .video-menu.is-open .video-menu-popover {
  transform: translateY(-50%);
}

/* During title editing, keep the menu actions from overlapping the input field.
   (Otherwise clicks intended for the caret can hit the confirm button.) */
.video-frame.is-title-editing .video-menu.is-open .video-menu-popover {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
}

.video-overlay .video-menu-trigger span {
  display: block;
  line-height: 1;
}

.video-overlay .video-icon-btn {
  width: 30px;
  height: 30px;
}

.video-overlay .video-icon-btn img {
  width: 13px;
  height: 13px;
}

.video-overlay .video-icon-btn img[src$="download.svg"],
.video-overlay .video-icon-btn img[src$="edit.svg"] {
  filter: invert(1);
}

.video-empty {
  grid-column: 1 / -1;
  margin: 0.25rem 0;
}

.video-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
  gap: 0.5rem;
  position: sticky;
  bottom: 0;
  padding: 0.3rem 0 0.1rem;
  background: var(--surface);
}

.video-menu {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
}

.video-menu-trigger {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 10px;
  opacity: 1;
  transition: opacity 160ms ease;
}

.video-menu-trigger:hover,
.video-menu-trigger:active,
.video-menu-trigger:focus {
  background: transparent;
  border: none;
  box-shadow: none;
}

.video-menu-trigger:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--primary) 55%, transparent);
  outline-offset: 2px;
}

.video-menu-trigger span {
  font-size: 20px;
  line-height: 1;
}

.video-menu-popover {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-direction: row;
  gap: 0.25rem;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 5;
}

.video-menu.is-open .video-menu-trigger {
  opacity: 0;
  pointer-events: none;
}

.video-menu.is-open .video-menu-popover {
  opacity: 1;
  transform: translateY(-50%);
  pointer-events: auto;
}

.video-frame.is-title-editing .video-menu .video-icon-btn.is-confirm {
  position: absolute;
  right: 3rem;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15, 23, 42, 0.45);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  padding: 0;
}

.video-menu-close {
  display: none !important;
}

.video-menu-close span {
  font-size: 18px;
  line-height: 1;
}

.video-menu-close:hover,
.video-menu-close:active,
.video-menu-close:focus {
  background: transparent;
  border: none;
  box-shadow: none;
}

.video-menu-close:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--primary) 55%, transparent);
  outline-offset: 2px;
}

.mm-confirm-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.45);
  z-index: 23200;
}

.mm-confirm-card {
  width: min(420px, calc(100vw - 40px));
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  padding: 1rem 1rem 0.9rem;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.18);
}

.mm-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

/* Rates modal: keep footer button bottom-right */
#rates-modal .modal-dialog > .card {
  display: flex;
  flex-direction: column;
}

#rates-modal .table-wrapper {
  flex: 1 1 auto;
  min-height: 0;
}

#rates-modal .mm-modal-footer {
  margin-top: auto;
  justify-content: flex-end;
}

@media (max-width: 768px) {
  /* Video modal: title + hints at top, list starts from top */
  #video-modal .modal-dialog > .card {
    display: flex;
    flex-direction: column;
  }

  #video-modal .inline-header {
    flex-grow: 0 !important;
  }

  #video-modal #video-owner-hint {
    margin-top: 0.55rem !important;
  }

  #video-modal .video-grid {
    margin-top: 0.65rem;
    max-height: none;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    align-content: start;
  }

  #video-modal .mm-modal-footer {
    margin-top: auto;
  }
}

.likes-icon {
  padding: 0.2rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

@keyframes fav-bounce {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.15);
  }
  70% {
    transform: scale(0.92);
  }
  100% {
    transform: scale(1);
  }
}

@media (max-width: 640px) {
  .profile-header {
    grid-template-columns: 1fr;
    justify-items: start;
  }
  .profile-name-block {
    align-items: flex-start;
    min-height: auto;
  }
}

.profile-avatar {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--surface-border);
  background: var(--surface-strong);
  display: grid;
  place-items: center;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-fallback {
  font-size: 2rem;
  color: var(--muted);
}

.avatar-menu-toggle {
  position: absolute;
  bottom: -6px;
  right: -6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 1rem;
  text-shadow: 0 0 6px rgba(0,0,0,0.35);
}
.avatar-menu-toggle:hover,
.avatar-menu-toggle:focus {
  background: transparent;
}

.avatar-change-link {
  display: block;
  width: 100%;
  font-size: 0.7rem;
  line-height: 1.1;
  color: var(--muted);
  text-align: center;
  margin-top: 0.3rem;
  padding: 0.1rem 0.2rem;
  border: none;
  background: transparent;
  box-shadow: none;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.avatar-change-link:hover,
.avatar-change-link:focus-visible {
  color: var(--text);
  text-decoration: underline;
  outline: none;
}

.avatar-settings {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: nowrap;
  width: 100%;
}

.profile-avatar.small {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  flex-shrink: 0;
}

.avatar-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  justify-content: center;
  flex: 1;
  min-width: 0;
}

.avatar-helpers {
  width: 100%;
  margin-top: 0.35rem;
}

.avatar-helpers p {
  margin: 0;
}

@media (max-width: 640px) {
  .avatar-settings {
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex-wrap: wrap;
  }
  .avatar-actions,
  .avatar-buttons {
    width: 100%;
    align-items: center;
  }
  .avatar-buttons {
    flex-direction: column;
  }
  .avatar-helpers {
    text-align: center;
  }
}

@media (min-width: 641px) {
  .avatar-settings {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
  }
  .avatar-actions {
    align-items: flex-start;
    justify-content: center;
  }
}

.avatar-buttons {
  display: flex;
  gap: 0.5rem;
  flex-direction: column;
  width: 100%;
}

.avatar-buttons > * {
  width: 100%;
}

.danger-text {
  color: #ef4444;
  border-color: #ef4444;
}

.success-text {
  color: #16a34a;
  border-color: #16a34a;
}

.btn-block {
  width: 100%;
  display: inline-flex;
  justify-content: center;
}
.autocomplete.with-clear input {
  padding-right: 2rem;
}

.autocomplete-list {
  position: absolute;
  top: calc(100% - 14px);
  left: 0;
  width: 100%;
  background: var(--surface-strong);
  border: 1px solid var(--surface-border);
  border-top: none;
  border-radius: 10px 10px 10px 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  z-index: 5;
  max-height: 240px;
  overflow-y: auto;
}

.clear-input {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translate3d(0, -50%, 0);
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  padding: 0;
  margin: 0;
  line-height: 1;
  width: 1.6rem;
  height: 1.6rem;
  min-height: 0;
  border-radius: 999px;
  box-shadow: none;
  transition: none;
}
.clear-input:hover,
.clear-input:focus-visible,
.clear-input:active {
  color: var(--muted);
  background: transparent;
  transform: translateY(-50%) !important;
  box-shadow: none;
}

.combo-toggle:hover,
.combo-toggle:focus,
.combo-toggle:focus-visible,
.combo-toggle:active {
  transform: translateY(-50%) !important;
}

/* Promo page tweaks */
.promo-container {
  padding: 1.1rem;
  padding-bottom: calc(var(--floating-nav-height) + env(safe-area-inset-bottom, 0px) + var(--floating-nav-bottom-gap) + 1.25rem);
}

.promo-card {
  gap: 1rem;
}

.promo-section-title-row {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  justify-self: start;
  width: fit-content;
}

.promo-section-title {
  margin: 0;
  font-size: 1.5rem;
}

.promo-help-btn {
  width: 1.38rem;
  height: 1.38rem;
  min-height: 0;
  padding: 0;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--primary) 72%, var(--surface-border) 28%);
  background: color-mix(in srgb, var(--surface) 78%, var(--bg-soft) 22%);
  color: color-mix(in srgb, var(--primary) 85%, var(--text) 15%);
  box-shadow: none;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
}

.promo-help-btn:hover,
.promo-help-btn:focus-visible,
.promo-help-btn:active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--surface-strong);
  box-shadow: none;
  transform: none !important;
}

.promo-help-pop {
  position: absolute;
  left: calc(100% + 0.2rem);
  top: 50%;
  width: min(320px, calc(100vw - 2.2rem));
  padding: 0.55rem 0.62rem;
  border-radius: 10px;
  border: 1px solid var(--surface-border-strong);
  background: var(--surface-strong);
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.38;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
  opacity: 0;
  visibility: hidden;
  transform: translate(4px, -50%);
  transition: opacity 0.14s ease, transform 0.14s ease;
  z-index: 20;
}

.promo-help-pop.is-open {
  opacity: 1;
  visibility: visible;
  transform: translate(0, -50%);
}

.promo-email-filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

.promo-email-filters .field {
  flex: 1 1 100%;
  width: 100%;
  min-width: 0;
}

.compact-field {
  margin-bottom: 0;
}
.compact-field .field-label {
  margin-bottom: 0;
}
.compact-field .autocomplete.with-clear {
  margin-bottom: 0;
}

.info-link-compact {
  padding: 0.35rem 0.6rem;
  font-size: 0.9rem;
}

.promo-floating-info-link {
  position: fixed;
  top: 5.5rem;
  left: 0;
  right: auto;
  z-index: 9990;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.promo-email-radius-note {
  margin: 0.05rem 0 0.2rem;
  color: var(--muted);
  line-height: 1.45;
}

.promo-email-preview-wrap {
  display: flex;
  justify-content: flex-start;
}

.promo-email-preview-btn {
  min-height: 34px;
  padding: 0.3rem 0.62rem;
  font-size: 0.8rem;
  font-weight: 600;
}

#promo-pay-btn,
#promo-paypal-btn {
  min-height: 44px;
  height: 44px;
}

#promo-paypal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#promo-email-preview-modal .modal-dialog {
  width: min(740px, calc(100vw - 90px));
  max-width: calc(100vw - 90px);
}

.promo-email-preview-card {
  gap: 0.85rem;
  max-height: calc(100vh - 5.5rem);
  overflow: hidden;
}

.promo-email-preview-header {
  justify-content: space-between;
  align-items: center;
}

.promo-email-preview-close {
  width: 1.95rem;
  height: 1.95rem;
  min-height: 0;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
  box-shadow: none;
}

.promo-email-preview-close:hover,
.promo-email-preview-close:focus-visible,
.promo-email-preview-close:active {
  background: var(--surface-strong);
  border-color: var(--surface-border-strong);
  box-shadow: none;
  transform: none !important;
}

.promo-email-preview-body {
  border: 1px dashed var(--surface-border-strong);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 82%, var(--bg-soft) 18%);
  padding: 0.75rem 0.82rem;
  display: grid;
  gap: 0.5rem;
  overflow: auto;
}

.promo-email-preview-subject {
  margin: 0;
  color: var(--text);
}

.promo-email-preview-text {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  white-space: pre-wrap;
  font: 500 0.86rem/1.48 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color: var(--text);
}

@media (max-width: 768px) {
  .promo-card {
    padding: 1rem;
  }
  .promo-container {
    padding: 0.9rem;
    padding-bottom: calc(var(--floating-nav-height) + env(safe-area-inset-bottom, 0px) + var(--floating-nav-bottom-gap) + 1.05rem);
  }
  .promo-floating-info-link {
    max-width: calc(100vw - 1.2rem);
  }
  #promo-email-preview-modal .modal-dialog {
    width: min(100%, calc(100vw - 1.4rem));
    max-width: calc(100vw - 1.4rem);
  }
  .promo-email-preview-card {
    max-height: calc(100vh - 2.2rem);
  }
}


.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text);
}

.badge-success {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

.badge-promo {
  width: 12px;
  height: 12px;
  padding: 0;
  font-size: 0;
  line-height: 0;
  letter-spacing: 0;
  gap: 0;
}

.badge-danger {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}

.badge-warning {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #111827;
}

.badge-floating {
  position: absolute;
  top: -0.16rem;
  left: -0.16rem;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
  pointer-events: none;
  transform-origin: center;
}

.result-card .badge-success.badge-floating {
  top: -0.4rem;
  left: -0.4rem;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 12px;
  padding: 0;
  justify-content: center;
}

.result-card.post-sponsored {
  border-color: #ef4444;
  background: var(--surface);
}

.result-card.post-sponsored:hover,
.result-card.post-sponsored:focus-within {
  border-color: #dc2626;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

.pro-expiry-warning {
  margin: 0.4rem 0 0.9rem;
  border: 1px solid #ef4444;
  background: color-mix(in srgb, #ef4444 10%, var(--surface));
  border-radius: 12px;
}

.pro-expiry-warning__body {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
}

.pro-expiry-warning__text {
  margin: 0;
  color: #991b1b;
  font-weight: 400;
  font-size: 0.82rem;
  line-height: 1.15rem;
  flex: 1;
}

.pro-expiry-warning__close {
  appearance: none;
  border: 1px solid color-mix(in srgb, #ef4444 35%, var(--surface-border));
  background: var(--surface);
  color: #991b1b;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 800;
  flex: 0 0 auto;
}

.pro-expiry-warning__close:hover {
  background: color-mix(in srgb, #ef4444 8%, var(--surface));
}

.result-card.post-pinned {
  border-color: #f59e0b;
  background: var(--surface);
}

.result-card.post-pinned:hover,
.result-card.post-pinned:focus-within {
  border-color: #d97706;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

.card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 1.4rem;
  position: relative;
}

.badge-type {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  border: 1px solid var(--surface-border);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
  vertical-align: middle;
}

.badge-type.badge-seeking {
  background: #facc15;
  border-color: #eab308;
  color: #7a5c00;
}

.badge-type.badge-offering {
  background: #fb923c;
  border-color: #f97316;
  color: #5f2a00;
}

.badge-type.badge-lessons {
  background: #dbeafe;
  border-color: #60a5fa;
  color: #0f172a;
}

.badge-anim-in {
  animation: badge-bounce-in 440ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.badge-anim-out {
  animation: badge-bounce-out 360ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

@keyframes badge-bounce-in {
  0% {
    opacity: 0;
    transform: scale(0.35);
  }
  55% {
    opacity: 1;
    transform: scale(1.18);
  }
  75% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes badge-bounce-out {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  35% {
    transform: scale(1.08);
  }
  100% {
    opacity: 0;
    transform: scale(0.35);
  }
}

.kebab-btn,
.fav-menu-btn,
.thread-menu-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 0.2rem 0.35rem;
  margin: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: color 0.12s ease, transform 0.12s ease;
  box-shadow: none;
  appearance: none;
}

.kebab-btn:hover,
.kebab-btn:focus-visible,
.fav-menu-btn:hover,
.fav-menu-btn:focus-visible,
.thread-menu-btn:hover,
.thread-menu-btn:focus-visible {
  color: var(--text);
  background: transparent !important;
  box-shadow: none !important;
  outline: none;
  transform: none !important;
}

.card-menu-wrapper,
.thread-menu-wrapper,
.fav-menu-wrapper {
  position: relative;
  margin-left: auto;
  z-index: 20000;
}

.card-menu,
.thread-menu,
.fav-menu {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 150px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
  display: none;
  z-index: 20010;
  padding: 0.1rem 0;
  flex-direction: column;
}

.card-menu.open,
.thread-menu.open,
.fav-menu.open {
  display: block;
}

.card-menu button,
.thread-menu button,
.fav-menu button {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 0.45rem 0.65rem;
  text-align: left;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
}

.card-menu button:hover,
.card-menu button:focus-visible,
.thread-menu button:hover,
.thread-menu button:focus-visible,
.fav-menu button:hover,
.fav-menu button:focus-visible {
  background: color-mix(in srgb, var(--primary) 10%, transparent);
}

.card-menu button:disabled,
.thread-menu button:disabled,
.fav-menu button:disabled {
  color: var(--muted);
  cursor: default;
}

.card-menu .menu-label {
  padding: 0.4rem 0.65rem 0.2rem;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.card-menu .stripe-promo-btn {
  font-weight: 600;
}

.stripe-pay-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.55rem 1rem;
}
.stripe-pay-btn .stripe-logo {
  height: 35px;
  width: auto;
  display: inline-block;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.modal-open .fav-menu-wrapper {
  display: none !important;
}

.post-resolved {
  border-color: color-mix(in srgb, #16a34a 35%, var(--surface-border));
}

.field-hint {
  margin: 0.1rem 0 0.2rem;
}

.xsmall {
  font-size: 0.8rem;
}

.avatar-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  box-shadow: none;
  padding: 0.35rem 0.45rem;
  display: none;
  flex-direction: column;
  gap: 0.15rem;
}

.avatar-menu button {
  background: transparent;
  color: var(--text);
  border: none;
  padding: 0.2rem 0.3rem;
  text-align: left;
  font-size: 0.9rem;
}

.avatar-menu button:hover {
  background: var(--surface-strong);
}

.modal {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 23000;
  display: grid;
  place-items: center;
  padding: clamp(1.25rem, 4vw, 2.75rem) 50px;
  overflow: hidden;
  pointer-events: none;
}

.modal[aria-hidden="false"],
.modal.open {
  pointer-events: auto;
}

.modal .modal-dialog {
  width: min(600px, calc(100vw - 100px));
  max-width: calc(100vw - 100px);
  max-height: calc(100vh - clamp(3rem, 10vw, 5rem));
  margin: 0 auto;
  position: relative;
  z-index: 23100;
  display: flex;
  align-items: stretch;
  pointer-events: auto;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: block;
  z-index: 22900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

/* Mantieni blur intenso sul popup avatar */
#avatar-modal .modal-backdrop {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal[aria-hidden="false"] .modal-backdrop,
.modal.open .modal-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal .modal-backdrop {
  display: block;
  position: fixed;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 22900;
  pointer-events: auto;
}

.modal-content {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 0.4rem 0.45rem;
  max-width: calc(100vw - 100px);
  max-height: calc(100vh - clamp(3rem, 10vw, 5rem));
  transform: scale(0.92);
  opacity: 0;
  transition: transform 0.26s ease, opacity 0.26s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-content img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 12px;
  object-fit: contain;
}

.modal.closing .modal-content,
.modal.closing .modal-dialog > .card,
.modal.closing .modal-dialog > .modal-content {
  transform: scale(0.9);
  opacity: 0;
}

#filter-modal .modal-dialog > .card {
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.22);
}

#notify-modal .modal-dialog {
  padding: 0;
  border-radius: 20px;
  overflow: visible;
}

#notify-modal .modal-content {
  border-radius: 20px !important;
  overflow: hidden;
  padding: 1.8rem 1.7rem 1.5rem;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.18);
  transform: scale(0.92);
  opacity: 0;
  transition: transform 0.26s ease, opacity 0.26s ease;
  background: var(--surface);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

#notify-modal .stack {
  gap: 1.2rem;
}

#mm-pwa-push-onboarding .modal-dialog {
  max-width: min(25rem, calc(100vw - 1rem));
  padding: 0.45rem;
}

.mm-pwa-push-onboarding__card {
  gap: 0.72rem;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18);
}

.mm-pwa-push-onboarding__eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.mm-pwa-push-onboarding__title {
  margin: 0;
  font-size: clamp(1.12rem, 1.8vw, 1.38rem);
}

.mm-pwa-push-onboarding__copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.mm-pwa-push-onboarding__status {
  margin: 0;
  font-size: 0.85rem;
}

.mm-pwa-push-onboarding__status.is-error {
  color: var(--danger);
}

.mm-pwa-push-onboarding__actions {
  margin-top: 0.1rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-wrap: nowrap;
}

.mm-pwa-push-onboarding__actions .btn-compact {
  white-space: nowrap;
  min-width: 0;
  padding-inline: 0.8rem;
}

@media (max-width: 480px) {
  #mm-pwa-push-onboarding .modal-dialog {
    max-width: calc(100vw - 0.8rem);
    padding: 0.35rem;
  }

  .mm-pwa-push-onboarding__card {
    padding: 0.85rem 0.9rem;
    border-radius: 16px;
  }

  .mm-pwa-push-onboarding__copy {
    font-size: 0.88rem;
  }
}

#notify-modal.open .modal-content {
  transform: scale(1.04);
  opacity: 1;
}

.modal-close {
  display: none !important;
}

.modal-close:hover,
.modal-close:focus,
.modal-close:focus-visible,
.modal-close:active {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none;
  color: var(--text);
}

.modal-backdrop.active .modal-content {
  transform: scale(1.04);
  opacity: 1;
}

.modal[aria-hidden="false"] .modal-content,
.modal.open .modal-content {
  transform: scale(1.04);
  opacity: 1;
}

.modal .modal-dialog > .card,
.modal .modal-dialog > .modal-content {
  max-height: calc(100vh - clamp(3rem, 10vw, 5rem));
  width: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal .modal-dialog > .card .stack,
.modal .modal-dialog > .modal-content .stack {
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#profile-details-modal {
  padding: 0.75rem 50px;
}

#profile-details-modal .modal-content,
#profile-details-modal .card {
  max-width: calc(100vw - 100px);
  width: min(1500px, calc(100vw - 100px));
  font-size: 0.95rem;
}

#profile-details-modal .modal-dialog {
  width: min(1650px, calc(100vw - 100px));
  max-width: calc(100vw - 100px);
}

@media (max-width: 600px) {
  #profile-details-modal .modal-content,
  #profile-details-modal .card {
    width: calc(100vw - 100px);
    max-width: calc(100vw - 100px);
    font-size: 0.9rem;
  }
  #profile-details-modal .modal-dialog {
    width: calc(100vw - 100px);
    max-width: calc(100vw - 100px);
  }
}

@media (max-width: 768px) {
  #profile-details-modal .modal-dialog {
    width: calc(100vw - 100px);
    max-width: calc(100vw - 100px);
  }
  #profile-details-modal .modal-content,
  #profile-details-modal .card {
    width: 100%;
    max-width: 100%;
  }
}

#avatar-modal .modal-content {
  border-radius: 16px;
  overflow: hidden;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

#avatar-modal .modal-dialog {
  width: min(900px, calc(100vw - 100px));
  max-width: calc(100vw - 100px);
  overflow: hidden;
}

#avatar-modal .modal-content img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  max-height: calc(100vh - 120px);
  object-fit: contain;
}

#fav-message-modal .modal-dialog {
  width: min(880px, calc(100vw - 100px));
  max-width: calc(100vw - 100px);
  border-radius: 16px;
  overflow: hidden;
}

#fav-message-modal .modal-content {
  padding: 1.4rem 1.6rem 1.2rem;
  border-radius: 16px;
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

#fav-message-modal .modal-close {
  top: 10px;
  right: 10px;
  transform: none;
}

#fav-message-modal h3 {
  margin-top: 0;
}

.filter-stack {
  gap: 1rem;
}

.filter-section {
  border: 1px solid var(--surface-border);
  border-radius: calc(var(--radius) - 4px);
  padding: 0.75rem 0.85rem;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
}

.filter-grid {
  gap: 0.9rem 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.filter-type-btn {
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.filter-type-btn.active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 15%, transparent);
  color: var(--primary);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.15);
}

.filter-level-btn {
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.filter-level-btn.active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 15%, transparent);
  color: var(--primary);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.15);
}

.filter-profile-btn {
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.filter-profile-btn.active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 15%, transparent);
  color: var(--primary);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.15);
}

.section-label {
  margin: 0 0 0.4rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.range-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0.6rem;
  align-items: center;
}

.range-row input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

/* ============================================================
   Messaggi
   ============================================================ */
body.messages-page {
  min-height: 100vh;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: hidden;
}

@supports (height: 100dvh) {
  body.messages-page {
    min-height: 100dvh;
    height: 100dvh;
  }
}

body.messages-page .page-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: visible;
  width: 100%;
}

.messages-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1rem;
  align-items: stretch;
  height: 100%;
  min-height: 0;
}

.threads-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
}

.threads-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: visible;
  padding-top: 0.35rem;
}

.thread-item {
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.7rem 0.5rem;
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  color: var(--text);
  cursor: pointer;
  transition: none;
  box-shadow: none;
  position: relative;
  flex: 0 0 auto;
}

.thread-item:hover,
.thread-item:focus-visible {
  border: 1px solid var(--surface-border);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: none;
}

.thread-item.active {
  border: 1px solid var(--surface-border);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: none;
}

.thread-name {
  margin: 0 0 0.12rem 0;
  font-weight: 700;
  line-height: 1.2;
}

.thread-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  margin-bottom: 0.08rem;
}

.thread-menu-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  align-self: center;
  margin-left: 0.4rem;
  transform: translateY(4px);
  touch-action: manipulation;
}

@media (min-width: 641px) {
  .thread-header {
    align-items: flex-start;
    padding-right: 1.6rem;
  }
  .thread-menu-wrapper {
    position: absolute;
    top: 50%;
    right: 0.55rem;
    transform: translateY(-50%);
    margin-left: 0;
  }
  .thread-menu {
    top: 50%;
    transform: translateY(-50%);
    right: 0.3rem;
  }
}

@media (max-width: 640px) {
  .thread-header {
    align-items: flex-start;
    padding-right: 1.6rem;
  }
  .thread-menu-wrapper {
    position: absolute;
    top: 50%;
    right: 0.55rem;
    transform: translateY(-50%);
    margin-left: 0;
  }
  .thread-menu {
    top: 50%;
    transform: translateY(-50%);
    right: 0.3rem;
  }
}

.thread-menu-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  transform: none;
  box-shadow: none;
  transition: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.thread-menu-btn:hover,
.thread-menu-btn:focus-visible {
  color: var(--primary);
  transform: none;
}

.thread-menu {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: 0;
  width: max-content;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  box-shadow: none;
  display: none;
  z-index: 200;
  padding: 0;
  overflow: hidden;
}

.thread-menu.open {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
}

.thread-menu button {
  width: auto;
  display: block;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 8px 12px;
  line-height: 1.15;
  font-size: 0.82rem;
  height: auto;
  min-height: 36px;
  white-space: nowrap;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.thread-menu button:hover,
.thread-menu button:focus-visible {
  background: color-mix(in srgb, var(--primary) 10%, transparent);
}

.thread-name {
  margin: 0 0 0.12rem 0;
  font-weight: 700;
  font-size: 0.96rem;
  line-height: 1.18;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 26px);
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-back-btn {
  display: none;
  border: 1px solid var(--surface-border);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  color: var(--text);
  border-radius: 10px;
  padding: 0.35rem 0.7rem;
  font-weight: 600;
  cursor: pointer;
}

.thread-preview {
  margin: 0 0 0.05rem 0;
  font-size: 0.83rem;
  font-weight: 400;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  max-width: calc(100% - 2.2rem);
}

.thread-unread-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f05252;
  display: inline-block;
  margin-left: 0.4rem;
}

.thread-meta {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0.8rem;
  min-height: 0;
  height: 100%;
  min-height: 0;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.chat-history {
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: color-mix(in srgb, var(--surface) 98%, transparent);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
}

/* Layout messaggi */
body.messages-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  height: auto;
  width: 100%;
}

body.messages-page .page-header {
  flex-shrink: 0;
}

body.messages-page .page-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

body.messages-page .messages-layout {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

body.messages-page .messages-layout > .card {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.messages-page .threads-panel,
body.messages-page .chat-panel {
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

body.messages-page .threads-panel {
  overflow: hidden;
}

body.messages-page .threads-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: visible;
  padding-top: 0.35rem;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

body.messages-page .chat-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

body.messages-page .chat-history {
  min-height: 0;
  overflow-y: auto;
  max-height: none;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

body.messages-page .chat-input {
  flex-shrink: 0;
}

.msg-row {
  display: flex;
}

.msg-row.incoming {
  justify-content: flex-start;
}

.msg-row.outgoing {
  justify-content: flex-end;
}

.msg-bubble {
  max-width: min(440px, 80%);
  padding: 0.55rem 0.75rem;
  border-radius: 14px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.msg-in {
  background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
  border: 1px solid var(--surface-border);
}

.msg-out {
  background: color-mix(in srgb, var(--primary) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--primary) 50%, var(--surface-border));
}

.msg-text {
  margin: 0;
  white-space: pre-wrap;
  font-size: 0.82rem;
  line-height: 1.25;
}

.msg-time {
  align-self: flex-end;
  font-size: 0.60rem;
  color: var(--muted);
}

.chat-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
  align-items: center;
}

.chat-input textarea {
  flex: 1;
  min-height: 70px;
  max-height: 160px;
  box-sizing: border-box;
  border-radius: 10px;
  border: 1px solid var(--surface-border);
  padding: 0.55rem 0.85rem;
  line-height: 1.35;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  resize: vertical;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.chat-input button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  width: 46px;
  padding: 0;
  border-radius: 12px;
  white-space: nowrap;
  align-self: center;
  transform: translateY(-5px);
}

/* Messaggi: il pulsante Invia deve restare fisso senza animazioni */
body.messages-page .chat-input button,
body.messages-page .chat-input button:hover,
body.messages-page .chat-input button:focus,
body.messages-page .chat-input button:focus-visible,
body.messages-page .chat-input button:active {
  transform: none !important;
  transition: none !important;
  box-shadow: none !important;
  filter: none !important;
  outline: none !important;
}

/* Assistenza (utente/admin): nessun movimento, ombra o effetto sfocato sul pulsante Invia */
.support-chat-input.chat-input button,
.admin-support-chat-input.chat-input button,
.support-chat-input.chat-input button:hover,
.support-chat-input.chat-input button:focus,
.support-chat-input.chat-input button:focus-visible,
.support-chat-input.chat-input button:active,
.admin-support-chat-input.chat-input button:hover,
.admin-support-chat-input.chat-input button:focus,
.admin-support-chat-input.chat-input button:focus-visible,
.admin-support-chat-input.chat-input button:active {
  transform: none !important;
  box-shadow: none !important;
  outline: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* ============================================================
   Preferiti
   ============================================================ */
.favorites-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.favorite-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.favorite-section-title {
  margin: 0;
  font-size: 1.05rem;
}

.favorite-table {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.favorite-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 0.6rem 0.95rem;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  position: relative;
}

.favorite-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1 1 0;
  min-width: 0;
}

.favorite-avatar {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--surface-border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.favorite-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.favorite-avatar-link {
  display: inline-flex;
}

.favorite-info {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  justify-content: center;
  line-height: 1.2;
}

.favorite-name {
  margin: 0;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  line-height: 1.15;
}

.fav-msg-to {
  margin: 0.1rem 0 0.4rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.favorite-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.2;
}

.favorite-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}

.favorite-actions .ghost {
  padding: 0.45rem 0.75rem;
}

.chat-name-link {
  cursor: pointer;
  color: var(--primary);
}

.chat-name-link:hover,
.chat-name-link:focus-visible {
  text-decoration: underline;
}

@media (max-width: 720px) {
  .favorite-row {
    flex-direction: column;
    align-items: flex-start;
    padding-right: 2.6rem;
    gap: 0.65rem;
  }
  .favorite-actions {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-left: 0;
    flex-shrink: 0;
  }
  .favorite-actions .ghost {
    width: 100%;
    justify-content: center;
  }
  .fav-menu-wrapper {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
  }
  .favorite-left {
    width: 100%;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.75rem;
  }
}

@media (max-width: 900px) {
  body.messages-page {
    min-height: 100vh;
    height: 100vh;
  }
  @supports (height: 100dvh) {
    body.messages-page {
      min-height: 100dvh;
      height: 100dvh;
    }
  }
  body.messages-page .page-content {
    overflow: hidden;
  }
  body.messages-page .messages-layout,
  body.messages-page .messages-layout > .card,
  body.messages-page .threads-panel {
    height: 100%;
    min-height: 0;
  }
  body.messages-page .threads-list {
    overflow-y: auto;
  }
  .messages-layout {
    grid-template-columns: 1fr;
    max-height: 100%;
    overflow: hidden;
    width: 100%;
  }
  .messages-layout .threads-panel {
    display: block;
  }
  .messages-layout .chat-panel {
    display: none !important;
  }
  .messages-layout.mobile-list .threads-panel {
    display: block;
  }
  .messages-layout.mobile-list .chat-panel {
    display: none !important;
  }
  .messages-layout.mobile-chat .threads-panel {
    display: none !important;
  }
  .messages-layout.mobile-chat .chat-panel {
    display: grid !important;
    grid-template-rows: auto 1fr auto;
    gap: 0.8rem;
    width: 100%;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
  }
  .support-messages-layout .threads-panel,
  .admin-support-layout .threads-panel {
    display: block !important;
  }
  .support-messages-layout .chat-panel,
  .admin-support-layout .chat-panel {
    display: grid !important;
    grid-template-rows: auto 1fr auto;
    gap: 0.8rem;
    width: 100%;
  }
  .support-chat-panel .chat-history,
  .admin-support-chat .chat-history {
    height: 300px;
    min-height: 300px;
    max-height: 300px;
  }
  .chat-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .chat-history {
    max-height: none;
    min-height: 0;
  }
}

@media (max-width: 640px) {
  html {
    font-size: 15px;
  }
  body {
    font-size: 0.95rem;
  }
  .messages-layout {
    grid-template-columns: 1fr;
  }
  .chat-history {
    max-height: none;
  }
  body.messages-page .chat-history {
    min-height: 0;
  }
  .support-chat-panel .chat-history,
  .admin-support-chat .chat-history {
    height: 260px;
    min-height: 260px;
    max-height: 260px;
  }
  h1 {
    font-size: 1.85rem;
  }
  h2 {
    font-size: 1.2rem;
  }
  h3 {
    font-size: 1.05rem;
  }
  .page-header {
    padding: var(--mm-header-padding, 1.1rem);
  }
  .page-content {
    padding: 1.05rem;
    padding-top: calc(var(--mm-page-header-content-offset, var(--mm-page-header-offset, 96px)) + 1.05rem);
    padding-bottom: calc(1.05rem + var(--floating-nav-total-height) + var(--ad-banner-height));
  }
  body.settings-page .page-content {
    padding-top: calc(var(--mm-page-header-content-offset, var(--mm-page-header-offset, 96px)) + 1.05rem);
  }
  body.mm-has-fixed-bottom-ad .page-content {
    padding-bottom: calc(
      var(--floating-nav-total-height) +
      var(--mm-fixed-ad-nav-gap) +
      var(--mm-fixed-ad-runtime-height) +
      var(--mm-fixed-ad-content-gap)
    );
  }
  .card {
    padding: 1rem 1.05rem;
  }
  .floating-nav {
    bottom: var(--floating-nav-bottom-offset);
    gap: 0.14rem;
    padding: 0.28rem 0.42rem 0.38rem;
  }
  .floating-nav a {
    padding: 0.24rem 0.25rem 0.18rem;
    font-size: 0.7rem;
    min-width: 0;
  }
  .floating-nav .nav-create-post-btn {
    width: 2.72rem;
    height: 2.72rem;
    margin-top: 0;
  }
  .floating-nav .nav-create-post-btn__plus {
    width: 1.26rem;
    height: 1.26rem;
  }
  .floating-nav .nav-create-post-btn__plus::before {
    width: 0.24rem;
    height: 0.94rem;
  }
  .floating-nav .nav-create-post-btn__plus::after {
    width: 0.94rem;
    height: 0.24rem;
  }
  .theme-toggle {
    padding: 0.22rem 0.3rem;
    width: auto;
    height: 44px;
  }
}

@media (max-width: 720px) {
  .floating-nav {
    right: 0;
    bottom: var(--floating-nav-bottom-offset);
    gap: 0.12rem;
    padding: 0.24rem 0.34rem 0.32rem;
    max-width: 100%;
    flex-wrap: nowrap;
  }
  .floating-nav a {
    padding: 0.2rem 0.22rem 0.16rem;
    font-size: 0.67rem;
    min-width: 0;
  }
  .floating-nav .nav-create-post-btn {
    width: 2.6rem;
    height: 2.6rem;
    margin-top: 0;
  }
  .floating-nav .nav-create-post-btn__plus {
    width: 1.2rem;
    height: 1.2rem;
  }
  .floating-nav .nav-create-post-btn__plus::before {
    width: 0.22rem;
    height: 0.88rem;
  }
  .floating-nav .nav-create-post-btn__plus::after {
    width: 0.88rem;
    height: 0.22rem;
  }
  .floating-nav .theme-toggle {
    padding: 0.24rem 0.3rem;
    width: auto;
    height: 42px;
  }
}

@media (max-width: 520px) {
  .modal {
    padding: 0.75rem 50px;
  }

  .modal .modal-dialog {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
  }

  .modal .modal-dialog > .card,
  .modal .modal-dialog > .modal-content,
  .modal-content {
    width: 100%;
    max-width: 100%;
    margin: 0;
    flex: 1 1 auto;
  }
}

.mm-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

#post-modal .mm-modal-footer {
  position: relative;
  z-index: 1;
  margin-top: 0;
  padding-top: 0.9rem;
  padding-bottom: calc(0.8rem + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0) 0%,
    color-mix(in srgb, var(--surface) 72%, transparent) 16%,
    var(--surface) 58%
  );
}

/* More breathing room inside modals (all sizes) */
.modal .modal-dialog > .card,
.modal .modal-dialog > .modal-content,
.modal > .modal-dialog > .modal-content {
  padding: 1.4rem 1.35rem;
}

/* Keep avatar modal edge-to-edge media */
#avatar-modal .modal-content {
  padding: 0;
}

@media (max-width: 768px) {
  /* Mobile full-screen modals (no blur, animations) */
  .modal.mm-fs {
    padding: 0;
    place-items: stretch;
  }

  /* Override id-specific sizing for profile details modal on mobile */
  #profile-details-modal.mm-fs {
    padding: 0;
  }

  #profile-details-modal.mm-fs .modal-dialog {
    width: 100%;
    max-width: 100%;
  }

  .modal.mm-fs .modal-dialog {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0;
  }

  .modal.mm-fs .modal-dialog > .card,
  .modal.mm-fs .modal-dialog > .modal-content {
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }

  #post-modal .mm-modal-footer {
    position: sticky;
    bottom: 0;
    margin-top: auto;
    padding-bottom: calc(0.95rem + env(safe-area-inset-bottom, 0px));
  }

  .modal.mm-fs .modal-backdrop {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  /* Close "X" always top-right on mobile */
  .modal.mm-fs .modal-close {
    position: fixed;
    top: 14px;
    right: 14px;
    left: auto;
    bottom: auto;
    z-index: 2300;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 85%, transparent);
    border: 1px solid var(--surface-border);
  }

  /* Zoom full-screen modals */
  .modal.mm-mobile-zoom .modal-dialog > .card,
  .modal.mm-mobile-zoom .modal-dialog > .modal-content {
    transform: scale(0.96);
    opacity: 0;
    transform-origin: center center;
    transition: transform 0.26s ease, opacity 0.22s ease;
  }

  .modal.mm-mobile-zoom[aria-hidden="false"] .modal-dialog > .card,
  .modal.mm-mobile-zoom.open .modal-dialog > .card,
  .modal.mm-mobile-zoom[aria-hidden="false"] .modal-dialog > .modal-content,
  .modal.mm-mobile-zoom.open .modal-dialog > .modal-content {
    transform: scale(1);
    opacity: 1;
  }

  /* Slide full-screen panels (right->left open, left->right close) */
  .modal.mm-mobile-slide .modal-dialog > .card,
  .modal.mm-mobile-slide .modal-dialog > .modal-content {
    transform: translateX(100%);
    opacity: 1;
    transition: transform 0.28s ease;
    will-change: transform;
  }

  .modal.mm-mobile-slide[aria-hidden="false"] .modal-dialog > .card,
  .modal.mm-mobile-slide.open .modal-dialog > .card,
  .modal.mm-mobile-slide[aria-hidden="false"] .modal-dialog > .modal-content,
  .modal.mm-mobile-slide.open .modal-dialog > .modal-content {
    transform: translateX(0);
  }
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  .modal.mm-mobile-zoom .modal-dialog > .card,
  .modal.mm-mobile-zoom .modal-dialog > .modal-content,
  .modal.mm-mobile-slide .modal-dialog > .card,
  .modal.mm-mobile-slide .modal-dialog > .modal-content {
    transition: none;
  }
}

.modal[aria-hidden="false"] ~ .floating-nav,
.modal.open ~ .floating-nav,
.modal-backdrop[aria-hidden="false"] ~ .floating-nav,
.modal-backdrop.active ~ .floating-nav {
  pointer-events: none;
}


.modal-open .floating-nav {
  pointer-events: none;
}

/* ──────────────────────────────────────── */
/*   Mobile bottom sheet (post menus)       */
/* ──────────────────────────────────────── */

.mm-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 24000;
  display: flex;
  align-items: flex-end;
  justify-content: stretch;
  background: rgba(15, 23, 42, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.mm-sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.mm-sheet {
  width: 100%;
  background: var(--surface);
  border-radius: 18px 18px 0 0;
  border-top: 1px solid var(--surface-border);
  padding: 0.35rem 0 calc(0.8rem + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform 220ms ease;
}

.mm-sheet-backdrop.open .mm-sheet {
  transform: translateY(0);
}

.mm-sheet-content {
  width: 100%;
  max-height: min(70vh, calc(100vh - 140px));
  overflow: auto;
  padding: 0.25rem 0;
}

@media (max-width: 768px) {
  /* Re-style existing dropdown menus when used inside bottom sheet */
  .mm-sheet .card-menu,
  .mm-sheet .thread-menu,
  .mm-sheet .fav-menu {
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 !important;
  }

  .mm-sheet .card-menu button,
  .mm-sheet .thread-menu button,
  .mm-sheet .fav-menu button {
    width: 100%;
    justify-content: flex-start;
    padding: 0.95rem 1.1rem;
    border-radius: 0;
  }
}

.settings-footer {
  background: var(--surface-strong);
  padding: 0.4rem 1rem 0.6rem;
  margin-top: 0.2rem;
  margin-bottom: 6px;
  position: relative;
  z-index: 60;
  border-top: 1px solid var(--surface-border);
}

.settings-footer-links {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  color: var(--muted-strong);
  font-size: 0.95rem;
}

.settings-footer-links a {
  color: var(--text);
  opacity: 0.94;
  text-decoration: none;
  font-weight: 600;
}

.settings-footer-links a:hover {
  text-decoration: underline;
  opacity: 1;
}

[data-theme="light"] .settings-footer {
  background: var(--bg-soft);
}

/* Settings page layout tweaks */
body.settings-page .page-content {
  padding: calc(var(--mm-page-header-content-offset, var(--mm-page-header-offset, 128px)) + 1.15rem) 1.05rem 0.55rem;
  gap: 1rem;
  margin-top: 0.35rem;
}

@media (max-width: 960px) {
  body.settings-page .page-content {
    padding: calc(var(--mm-page-header-content-offset, var(--mm-page-header-offset, 128px)) + 1rem) 0.95rem 0.45rem;
    gap: 0.95rem;
  }
}

@media (max-width: 600px) {
  body.settings-page .page-content {
    padding: calc(var(--mm-page-header-content-offset, var(--mm-page-header-offset, 96px)) + 0.9rem) 0.85rem 0.35rem;
    gap: 0.9rem;
  }
}

body.settings-page.settings-drawer-desktop .page-content {
  padding-left: calc(260px + 1.05rem);
  padding-right: 1.05rem;
}

body.settings-page .settings-footer {
  padding: 0.3rem 0.9rem 0.4rem;
  margin: 0.3rem auto 0;
}

body.settings-page .settings-footer-links {
  gap: 0.85rem;
  font-size: 0.9rem;
}

body.settings-page .settings-footer-links a {
  padding: 0.1rem 0.05rem;
}

body.settings-page::after {
  content: '';
  display: block;
  height: calc(var(--floating-nav-total-height) + var(--ad-banner-height) + 0.35rem);
}
.guest-copy-panel {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid color-mix(in srgb, var(--surface-border) 60%, transparent);
  backdrop-filter: blur(2px);
}

[data-theme="light"] .guest-copy-panel {
  background: rgba(255, 255, 255, 0.45);
}

[data-theme="dark"] .guest-copy-panel {
  background: rgba(11, 18, 32, 0.16);
}

/* Ads provider abstraction slots (Adsterra/Infolinks/House) */
.mm-ad-slot-host {
  width: 100%;
  min-height: 250px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--surface-border) 82%, transparent);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  overflow: hidden;
}

.mm-ad-slot-host.mm-ad-slot-host-compact,
.ad-card-inline-feed .mm-ad-slot-host,
.ad-card-inline-feed .mm-ad-network-slot,
.ad-card-inline-feed .mm-ad-house-card {
  min-height: 72px;
}

.mm-ad-slot-host[hidden] {
  display: none !important;
}

.mm-ad-network-slot,
.mm-ad-house-card {
  min-height: 250px;
  height: 100%;
}

.mm-ad-network-slot-adsterra {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.mm-ad-network-slot-adsterra .mm-adsterra-container {
  width: 100%;
  min-height: inherit;
}

.mm-ad-network-slot-adsterra-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.mm-ad-network-slot-adsterra-banner[data-mm-ad-load-state="pending"] {
  opacity: 0;
  pointer-events: none;
}

.mm-ad-network-slot-adsterra-banner iframe {
  max-width: 100%;
}

.mm-ad-network-slot-adsterra iframe {
  width: 100% !important;
  max-width: 100% !important;
  border: 0 !important;
  display: block;
}

#page-ad-banner.mm-sitewide-ad-slot .mm-ad-network-slot-adsterra-banner iframe.mm-adsterra-sandbox-frame,
.mm-ad-network-slot-adsterra iframe.mm-adsterra-sandbox-frame {
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  max-height: 100% !important;
  border: 0 !important;
  display: block;
  overflow: hidden;
}

.mm-ad-house-card {
  position: relative;
  display: grid;
  align-content: center;
  gap: 0.45rem;
  padding: 0.85rem 0.95rem;
}

.mm-ad-house-card.mm-ad-house-card-image {
  display: block;
  gap: 0;
  padding: 0;
  min-height: 0;
  margin-inline: auto;
  line-height: 0;
  overflow: hidden;
  background: transparent;
  text-decoration: none;
}

.mm-ad-house-card.mm-ad-house-card-image img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  border: 0;
}

.mm-ad-house-card.mm-ad-house-card-compact {
  gap: 0.3rem;
  padding: 0.45rem 0.65rem;
}

.mm-ad-house-card.mm-ad-house-card-image.mm-ad-house-card-compact {
  gap: 0;
  padding: 0;
}

.mm-ad-house-card.mm-ad-house-card-placeholder {
  padding: 0;
  border-radius: 10px;
  background: transparent;
}

.mm-ad-house-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.15rem;
}

.mm-ad-house-links a {
  font-size: 0.8rem;
  text-decoration: none;
}

.mm-ad-house-links a:hover {
  text-decoration: underline;
}

html.mm-block-external-cmp .cky-consent-container,
html.mm-block-external-cmp .cky-notice,
html.mm-block-external-cmp .cky-modal,
html.mm-block-external-cmp .cky-preference-wrapper,
html.mm-block-external-cmp .cky-preference-center,
html.mm-block-external-cmp .cky-preference-content-wrapper,
html.mm-block-external-cmp .cky-overlay,
html.mm-block-external-cmp .cky-btn-revisit-wrapper,
html.mm-block-external-cmp .cky-revisit-wrapper,
html.mm-block-external-cmp .cky-revisit-bottom-left,
html.mm-block-external-cmp .cky-revisit-bottom-right,
html.mm-block-external-cmp [data-cky-tag],
html.mm-block-external-cmp [data-cky-exp],
html.mm-block-external-cmp [data-cookieyes],
html.mm-block-external-cmp iframe[src*="cookieyes"],
html.mm-block-external-cmp iframe[src*="cookie-law"],
html.mm-block-external-cmp [id^="cky"],
html.mm-block-external-cmp [class^="cky-"],
html.mm-block-external-cmp [class*=" cky-"],
html.mm-block-external-cmp [class^="cookieyes"],
html.mm-block-external-cmp [class*=" cookieyes"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

html.mm-block-external-cmp,
html.mm-block-external-cmp body,
html.mm-block-external-cmp.cky-consent-page,
html.mm-block-external-cmp.cky-modal-open,
html.mm-block-external-cmp.cky-lockbody,
html.mm-block-external-cmp body.cky-consent-page,
html.mm-block-external-cmp body.cky-modal-open,
html.mm-block-external-cmp body.cky-lockbody,
html.mm-block-external-cmp body[class*=" cky-"] {
  overflow: auto !important;
  position: static !important;
  inset: auto !important;
  width: auto !important;
  height: auto !important;
}

:root.mm-pwa-boot-active,
:root.mm-pwa-boot-active body {
  background:
    radial-gradient(circle at 20% 20%, rgba(212, 167, 58, 0.18), transparent 38%),
    radial-gradient(circle at 78% 16%, rgba(15, 23, 42, 0.08), transparent 34%),
    linear-gradient(180deg, #f7f3e9 0%, #eef3fb 100%);
}

.mm-pwa-boot {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 24px max(36px, env(safe-area-inset-bottom) + 12px);
  background:
    radial-gradient(circle at 50% 38%, rgba(212, 167, 58, 0.2), transparent 26%),
    radial-gradient(circle at 18% 18%, rgba(212, 167, 58, 0.16), transparent 30%),
    radial-gradient(circle at 82% 14%, rgba(15, 23, 42, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(247, 243, 233, 0.98) 0%, rgba(238, 243, 251, 0.98) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 1;
  transition: opacity 220ms ease, visibility 220ms ease;
  visibility: visible;
  overflow: hidden;
}

.mm-pwa-boot.is-hiding {
  opacity: 0;
  visibility: hidden;
}

.mm-pwa-boot__stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: min(100%, 320px);
  text-align: center;
}

.mm-pwa-boot__halo {
  position: absolute;
  inset: 10px auto auto 50%;
  width: 170px;
  height: 170px;
  border-radius: 999px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.2) 58%, transparent 74%);
  filter: blur(3px);
  opacity: 0.92;
  pointer-events: none;
}

.mm-pwa-boot__logo-wrap {
  position: relative;
  width: 128px;
  height: 128px;
  display: grid;
  place-items: center;
}

.mm-pwa-boot__ring {
  position: absolute;
  inset: 6px;
  border-radius: 999px;
  border: 2px solid rgba(15, 23, 42, 0.08);
  border-top-color: rgba(212, 167, 58, 0.9);
  border-right-color: rgba(22, 45, 96, 0.52);
  animation: mm-pwa-boot-spin 1.2s linear infinite;
}

.mm-pwa-boot__logo {
  position: relative;
  width: 96px;
  height: 96px;
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(15, 23, 42, 0.12));
}

.mm-pwa-boot__brand {
  position: relative;
  font-size: clamp(2rem, 4vw, 2.35rem);
  font-weight: 800;
  letter-spacing: 0.2em;
  color: #162d60;
  text-transform: uppercase;
  text-indent: 0.2em;
}

.mm-pwa-boot__motto {
  position: absolute;
  left: 50%;
  bottom: max(26px, env(safe-area-inset-bottom) + 10px);
  width: min(100% - 32px, 360px);
  margin: 0;
  transform: translateX(-50%);
  text-align: center;
  font-size: 0.98rem;
  line-height: 1.45;
  font-weight: 600;
  color: rgba(15, 23, 42, 0.72);
  letter-spacing: 0.01em;
}

@keyframes mm-pwa-boot-spin {
  to {
    transform: rotate(1turn);
  }
}
