/* Materia marketing site: signed-in header, account menu, low-end device care. */

/* Avoid a flash of "Log in / Get Started" for signed-in visitors: the header
   actions stay hidden until site.js has swapped them (set in <head>). */
html.mt-authed:not(.mt-ready) [class*="header-right-"],
html.mt-authed:not(.mt-ready) [class*="mobile-drawer-buttons-"] { visibility: hidden; }

.mt-avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 36px; height: 36px; border-radius: 999px; overflow: hidden;
  background: #eef0f6; color: #1b1d27; font: 600 14px/1 Inter, system-ui, sans-serif;
}
.mt-avatar-lg { width: 44px; height: 44px; font-size: 16px; }
.mt-avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mt-avatar-btn {
  margin-left: 10px; padding: 0; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(17, 19, 34, .14);
  transition: box-shadow .18s ease, transform .18s ease;
}
.mt-avatar-btn:hover { box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(67, 97, 238, .55); }
.mt-avatar-btn:active { transform: scale(.96); }
.mt-avatar-btn:focus-visible { outline: 2px solid #4361ee; outline-offset: 3px; }
[class*="header-right-"] { align-items: center; }
html.mt-authed [class*="header-right-"] { gap: 6px; justify-content: flex-end; }
html.mt-authed [class*="header-right-"] .mt-avatar-btn { width: 38px; height: 38px; flex: 0 0 38px; }
/* Account menu: popover on larger screens, bottom sheet on phones. */
.mt-menu-root { position: fixed; inset: 0; z-index: 2147483000; font-family: Inter, system-ui, -apple-system, sans-serif; }
.mt-menu-root[hidden] { display: none; }
.mt-menu-backdrop { position: absolute; inset: 0; background: transparent; }
.mt-menu {
  position: fixed; width: 300px; max-width: calc(100vw - 24px); padding: 6px; outline: 0;
  background: #fff; color: #1b1d27; border-radius: 16px;
  border: 1px solid rgba(17, 19, 34, .08);
  box-shadow: 0 18px 48px rgba(17, 19, 34, .16), 0 2px 6px rgba(17, 19, 34, .06);
  opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top right;
  transition: opacity .18s ease, transform .22s cubic-bezier(.2, .8, .2, 1);
}
.mt-menu-root.is-open .mt-menu { opacity: 1; transform: none; }
.mt-menu-grip { display: none; }
.mt-menu-head {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 11px;
  background: #f3f4f6; color: inherit; text-decoration: none;
}
.mt-menu-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.mt-menu-who strong { font-size: 15px; font-weight: 600; color: #111322; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-menu-who small { font-size: 13px; color: #6b7080; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-menu-list { padding: 6px 0 2px; }
.mt-menu-foot { margin-top: 4px; padding-top: 6px; border-top: 1px solid #eceef3; }
.mt-menu-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  font-size: 15px; font-weight: 500; color: #2b2e3a; text-decoration: none;
  transition: background-color .12s ease;
}
.mt-menu-item:hover, .mt-menu-item:focus-visible { background: #f3f4f6; outline: 0; color: #111322; }
.mt-ico { flex: 0 0 auto; color: #7b8090; }

@media (max-width: 749px) {
  .mt-menu-backdrop { background: rgba(10, 12, 20, .42); opacity: 0; transition: opacity .22s ease; }
  .mt-menu-root.is-open .mt-menu-backdrop { opacity: 1; }
  .mt-menu {
    left: 0 !important; right: 0 !important; top: auto !important; bottom: 0; width: auto; max-width: none;
    padding: 8px 10px calc(14px + env(safe-area-inset-bottom)); border: 0; border-radius: 20px 20px 0 0;
    transform: translateY(100%); opacity: 1; transform-origin: bottom center;
    transition: transform .28s cubic-bezier(.2, .8, .2, 1);
    max-height: 86vh; overflow-y: auto; overscroll-behavior: contain;
  }
  .mt-menu-grip { display: block; width: 40px; height: 4px; margin: 4px auto 10px; border-radius: 4px; background: #d9dce4; }
  .mt-menu-item { padding: 13px 12px; font-size: 16px; }
  html.mt-menu-open, html.mt-menu-open body { overflow: hidden; }
}

/* Phone drawer footer when signed in. */
.mt-drawer-auth { display: flex !important; flex-direction: column; gap: 10px; }
.mt-drawer-profile { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: #f3f4f6; text-decoration: none; color: inherit; }
.mt-drawer-dash { display: block; padding: 13px 16px; border-radius: 8px; background: #111322; color: #fff !important; font: 600 15px/1.2 Inter, system-ui, sans-serif; text-align: center; text-decoration: none; }
.mt-drawer-out { display: block; padding: 6px; font: 500 14px/1.2 Inter, system-ui, sans-serif; color: #6b7080 !important; text-align: center; text-decoration: none; }

/* Data-saver, slow networks, reduced motion or very little memory: keep the
   page still and light. Content and layout are unchanged. */
html.mt-lite *, html.mt-lite *::before, html.mt-lite *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) {
  .mt-menu, .mt-menu-backdrop, .mt-avatar-btn { transition: none !important; }
}

/* Theme demo password dialog: compact centered modal, bottom sheet on phones. */
.mt-demo-root .mt-menu-backdrop { background: rgba(10, 12, 20, .3); opacity: 0; transition: opacity .16s ease; }
.mt-demo-root.is-open .mt-menu-backdrop { opacity: 1; transition-duration: .22s; }
.mt-demo { position: fixed; left: 50%; top: 50%; width: 340px; max-width: calc(100vw - 32px); padding: 20px; border-radius: 20px;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .28); border: 1px solid rgba(17, 19, 34, .06);
  opacity: 0; transform: translate(-50%, calc(-50% + 6px)) scale(.97);
  transition: opacity .15s ease, transform .18s cubic-bezier(.4, 0, 1, 1); }
.mt-demo-root.is-open .mt-demo { opacity: 1; transform: translate(-50%, -50%); transition: opacity .2s ease, transform .32s cubic-bezier(.16, 1, .3, 1); }
.mt-demo-head { display: flex; align-items: center; gap: 12px; }
.mt-demo-ico { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; background: #0b0d14; color: #fff; display: flex; align-items: center; justify-content: center; }
.mt-demo-who { min-width: 0; flex: 1; }
.mt-demo-title { margin: 0; font: 600 15px/1.25 Inter, system-ui, sans-serif; color: #111322; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-demo-text { margin: 2px 0 0; font: 400 12.5px/1.25 Inter, system-ui, sans-serif; color: #6b7080; }
.mt-demo-x { width: 32px; height: 32px; flex: 0 0 32px; border: 0; border-radius: 999px; background: transparent; color: #9aa0ac; font: 400 22px/1 Inter, system-ui, sans-serif; cursor: pointer; transition: background-color .15s ease; }
.mt-demo-x:hover { background: #f3f4f6; color: #2b2e3a; }
.mt-demo-pass { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 14px; border-radius: 12px; background: #f8f9fb; box-shadow: inset 0 0 0 1px rgba(17, 19, 34, .08);
  font: 400 13px/1 Inter, system-ui, sans-serif; color: #6b7080; }
.mt-demo-pass strong { margin-left: 6px; font: 600 15px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: #111322; }
.mt-demo-copy { height: 28px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; font: 600 12px/1 Inter, system-ui, sans-serif; color: #4b5263; cursor: pointer; transition: background-color .15s ease; }
.mt-demo-copy:hover { background: #fff; color: #111322; }
.mt-demo-open { margin-top: 12px; width: 100%; height: 44px; border: 0; border-radius: 12px; background: #0b0d14; color: #fff; font: 600 14px/1 Inter, system-ui, sans-serif; cursor: pointer; transition: background-color .15s ease, transform .1s ease; }
.mt-demo-open:hover { background: #1f2330; } .mt-demo-open:active { transform: scale(.985); }
@media (max-width: 749px) {
  .mt-demo { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-width: none; padding: 6px 20px calc(20px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; border: 0;
    opacity: 1; transform: translateY(100%); transition: transform .24s cubic-bezier(.4, 0, 1, 1); }
  .mt-demo-root.is-open .mt-demo { transform: translateY(0); transition: transform .36s cubic-bezier(.32, .72, 0, 1); }
  .mt-demo .mt-menu-grip { margin: 6px auto 14px; width: 36px; }
  .mt-demo-x { display: none; }
}
@media (prefers-reduced-motion: reduce) { .mt-demo, .mt-demo-root .mt-menu-backdrop { transition: none !important; } }

/* Template cards (marketing site): same card as the app's Themes Library. */
.tabberfly-card.mt-tcard { background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; border-radius: 0 !important; overflow: visible !important; }
.tabberfly-card.mt-tcard:hover { transform: none !important; box-shadow: none !important; }
.mt-tcard .mt-tframe { position: relative !important; display: block !important; aspect-ratio: 4 / 3; height: auto !important; padding: 0 !important; overflow: hidden !important; border-radius: 15px !important; background: #f3f4f6;
  box-shadow: 0 0 0 1px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -12px rgba(16, 24, 40, .18); transition: box-shadow .3s ease; isolation: isolate; }
.mt-tcard:hover .mt-tframe { box-shadow: 0 0 0 1px rgba(16, 24, 40, .06), 0 2px 4px rgba(16, 24, 40, .05), 0 18px 40px -16px rgba(16, 24, 40, .28); }
.mt-tshot { position: absolute !important; left: 0; right: 0; top: 0; width: 100% !important; max-width: none !important; height: auto !important; margin: 0 !important; object-fit: initial !important;
  transform: translate3d(0, 0, 0); backface-visibility: hidden; will-change: transform; opacity: 0; transition: opacity .3s ease; user-select: none; }
.mt-tshot.is-loaded { opacity: 1; }
.mt-tcard .content { padding: 14px 2px 0 !important; }
.mt-tcard .card-header { align-items: center; gap: 12px; }
.mt-tcard .title { font-size: 17px !important; font-weight: 600 !important; letter-spacing: -.01em; color: #111322; }
.mt-tpill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px; border-radius: 999px; background: #f1f2f5; color: #2b2e3a; font: 600 13px/1 Inter, system-ui, sans-serif; flex: 0 0 auto; transition: background-color .2s ease; }
.mt-tcard:hover .mt-tpill { background: #e6e8ee; }
