:root { --v-blue: #065dfd; --v-ink: #121214; }

.header-generation-progress.is-feature-disabled,
.confetti-layer { display: none !important; }

.generator-studio,
.generator-workbench,
.brief-panel { box-shadow: none !important; }

.billing-plan-accordion {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 520ms cubic-bezier(.22,1,.36,1), opacity 220ms ease, margin 360ms cubic-bezier(.22,1,.36,1);
}
.billing-plan-accordion.is-open { max-height: 2200px; opacity: 1; overflow: visible; }
#plansList.billing-plan-accordion { margin-block: 0; }
#plansList.billing-plan-accordion.is-open { margin-block: 18px 28px; }
.desktop-billing-balance {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: 4px 16px;
  padding: 28px 32px;
  border-radius: 34px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(16,24,40,.08);
}
.desktop-billing-balance > span { grid-column: 1 / -1; color: #74777e; }
.desktop-billing-balance strong { font-size: 56px; font-weight: 400; line-height: 1; }
.desktop-billing-balance small { align-self: center; color: #74777e; }
.desktop-billing-balance button,
.m-balance-tile #mobileBalanceBuy {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  background: var(--v-ink);
  color: #fff;
  font: 700 14px Manrope, sans-serif;
}
.desktop-billing-balance button[aria-expanded="true"] .material-symbols-outlined,
.m-balance-tile #mobileBalanceBuy[aria-expanded="true"] .material-symbols-outlined { transform: rotate(180deg); }
.desktop-billing-balance .material-symbols-outlined,
.m-balance-tile #mobileBalanceBuy .material-symbols-outlined { transition: transform 260ms cubic-bezier(.22,1,.36,1); }

.project-viewer { width: 100vw; height: 100dvh; max-width: none; max-height: none; border: 0; padding: 0; background: rgba(8,10,16,.78); }
.project-viewer::backdrop { background: rgba(8,10,16,.66); backdrop-filter: blur(18px); }
.project-viewer-card { position: relative; width: 100%; height: 100%; background: transparent !important; border: 0 !important; box-shadow: none !important; }
.project-viewer-header { position: absolute; inset: 24px 24px auto 24px; z-index: 8; pointer-events: none; }
.project-viewer-close { pointer-events: auto; position: absolute; right: 0; top: 0; width: 56px; height: 56px; border: 0; border-radius: 50%; background: #111; color: #fff; }
.project-viewer-name { pointer-events: auto; position: absolute; left: 0; top: 0; max-width: min(56vw, 520px); }
.project-viewer-name button,
.project-viewer-name input { border: 0; border-radius: 999px; padding: 12px 18px; background: rgba(255,255,255,.75); backdrop-filter: blur(18px); font: 700 16px Manrope, sans-serif; }
.project-viewer-save-title { display: none !important; }
.project-viewer-media { height: 100%; display: grid; place-items: center; overflow: hidden; touch-action: pan-y; }
.project-viewer-stage { position: relative; display: grid; place-items: center; width: 100%; height: 100%; }
.project-viewer-image { display: block; max-width: min(88vw, 1180px); max-height: 88dvh; width: auto; height: auto; object-fit: contain; border-radius: 24px; box-shadow: 0 34px 90px rgba(0,0,0,.35); }
.project-viewer-actions { position: absolute; z-index: 9; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); width: max-content !important; max-width: calc(100vw - 24px); transform: translateX(-50%); display: flex !important; flex-wrap: nowrap !important; grid-template-columns: none !important; gap: 8px; padding: 8px; border: 1px solid rgba(255,255,255,.36); border-radius: 999px; background: rgba(255,255,255,.25); backdrop-filter: blur(20px) saturate(150%); }
.project-viewer-actions button { width: 50px; height: 50px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255,255,255,.82); color: #111; font-size: 0; transition: transform 160ms ease, background 160ms ease, color 160ms ease; }
.project-viewer-actions button:hover { transform: translateY(-2px); background: var(--v-blue); color: #fff; }
.project-viewer-actions button.is-danger:hover { background: #e12b43; }
.project-viewer-arrow { position: absolute; z-index: 3; top: 50%; width: 54px; height: 54px; border: 0; border-radius: 50%; background: rgba(255,255,255,.72); backdrop-filter: blur(16px); transform: translateY(-50%); }
.project-viewer-arrow.is-prev { left: 28px; }
.project-viewer-arrow.is-next { right: 28px; }
.project-viewer-dots { position: absolute; left: 50%; bottom: 100px; z-index: 4; transform: translateX(-50%); display: flex; gap: 7px; }
.project-viewer-dots button { width: 7px; height: 7px; border: 0; padding: 0; border-radius: 50%; background: rgba(255,255,255,.48); }
.project-viewer-dots button.is-active { background: var(--v-blue); transform: scale(1.35); }

.edit-source-preview { position: absolute; inset: auto 24px 24px; z-index: 4; display: flex; gap: 8px; overflow: auto; scrollbar-width: none; }
.edit-source-preview::-webkit-scrollbar { display: none; }
.edit-source-preview img { width: 64px; height: 64px; flex: 0 0 auto; object-fit: cover; border-radius: 16px; border: 2px solid #fff; box-shadow: 0 8px 20px rgba(0,0,0,.12); }

@media (min-width: 761px) {
  html, body { overflow: hidden; }
  dialog .modal-scroll-body { overflow-y: auto; }
}

@media (max-width: 760px) {
  html, body { overscroll-behavior: none; }
  .project-viewer-header { inset: max(14px, env(safe-area-inset-top)) 14px auto; }
  .project-viewer-close { width: 48px; height: 48px; }
  .project-viewer-name { max-width: calc(100vw - 90px); }
  .project-viewer-image { max-width: 100vw; max-height: 100dvh; width: 100%; height: 100%; object-fit: contain; border-radius: 0; box-shadow: none; }
  .project-viewer-arrow { display: none; }
  .project-viewer-dots { bottom: calc(max(22px, env(safe-area-inset-bottom)) + 86px); }
  .project-viewer-actions { bottom: max(14px, env(safe-area-inset-bottom)); }

  .m-field-tile { overflow: visible !important; }
  .m-field-tile input,
  .m-field-tile textarea {
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0;
    max-width: 100%;
    padding-inline: 0 !important;
    border-radius: 0 !important;
    overflow: visible;
    text-indent: 0;
  }
  .m-field-tile textarea { resize: none; }
  .m-field-tile > small { right: 18px !important; left: auto !important; }

  .m-upload-tile,
  .m-field-tile { position: relative; isolation: isolate; overflow: hidden !important; }
  .m-upload-tile::after,
  .m-field-tile::after {
    content: "";
    position: absolute;
    z-index: -1;
    left: var(--tap-x, 50%);
    top: var(--tap-y, 50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--v-blue) 16%, transparent);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    pointer-events: none;
  }
  .m-upload-tile.is-tap-rippling::after,
  .m-field-tile.is-tap-rippling::after { animation: mobileTapRipple 720ms cubic-bezier(.16,1,.3,1); }
  @keyframes mobileTapRipple {
    0% { transform: translate(-50%, -50%) scale(0); opacity: .9; }
    72% { opacity: .34; }
    100% { transform: translate(-50%, -50%) scale(34); opacity: 0; }
  }

  #mobileCreatePage::after {
    content: "";
    position: fixed;
    z-index: 20;
    inset: 72px 0 92px;
    pointer-events: none;
    opacity: 0;
    background-image: radial-gradient(circle, var(--v-blue) 0 1.6px, transparent 1.9px);
    background-size: 12px 12px;
    mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
  }
  #mobileCreatePage.is-mobile-wave::after { animation: mobileWorkbenchWave 700ms cubic-bezier(.22,1,.36,1); }
  #mobileCreatePage.is-mobile-wave .m-upload-tile,
  #mobileCreatePage.is-mobile-wave .m-field-tile,
  #mobileCreatePage.is-mobile-wave .m-setting-tile { animation: mobileCardFan 560ms cubic-bezier(.22,1,.36,1); }
  @keyframes mobileWorkbenchWave {
    0% { opacity: 0; transform: translateX(-34%) scaleX(.5); }
    38% { opacity: .32; }
    100% { opacity: 0; transform: translateX(34%) scaleX(1.2); }
  }
  @keyframes mobileCardFan {
    0%,100% { transform: translateX(0) rotate(0); }
    38% { transform: translateX(5px) rotate(.6deg); }
    72% { transform: translateX(-2px) rotate(-.22deg); }
  }

  .m-settings-sheet-card { touch-action: none; will-change: transform, opacity; }
  .m-settings-options { touch-action: pan-y; overscroll-behavior: contain; }
  #mobileSettingsClose { background: #111 !important; color: #fff !important; }
  .m-setting-option { transition: transform 140ms ease, background 180ms ease, border-color 180ms ease; }
  .m-setting-option:active { transform: scale(.98); }

  .m-template-section { overflow: visible !important; padding-bottom: 18px !important; }
  .m-template-mask { overflow: visible !important; margin-inline: calc(var(--m-edge, 16px) * -1) 0; padding-inline: 0; mask-image: linear-gradient(90deg, transparent 0, #000 8px, #000 calc(100% - 8px), transparent 100%); }
  .m-template-list { overflow-x: auto; overflow-y: visible !important; padding-block: 8px 24px !important; scroll-behavior: auto; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; touch-action: pan-x; overscroll-behavior-inline: contain; }
  .m-template-list::-webkit-scrollbar { display: none; }
  .m-template-card { box-shadow: none !important; scroll-snap-align: start; }

  .billing-plan-accordion { margin: 0 !important; }
  .billing-plan-accordion.is-open { margin-top: 12px !important; padding-bottom: 12px; }
  .m-balance-tile #mobileBalanceBuy { grid-column: 1 / -1; justify-self: stretch; justify-content: center; }
  .m-plan-list { overflow: hidden !important; }
  .m-plan-list.is-open { overflow: visible !important; }

  #mobileProjectsList.is-grid .m-project-group { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
  #mobileProjectsList.is-grid .m-project-date { grid-column: 1 / -1; }
  #mobileProjectsList.is-grid .m-project { display: grid; grid-template-columns: 1fr; align-content: start; min-width: 0; padding: 8px; }
  #mobileProjectsList.is-grid .m-project > img,
  #mobileProjectsList.is-grid .m-project > .m-project-placeholder { width: 100%; aspect-ratio: 1; height: auto; }
  #mobileProjectsList.is-grid .m-project h3 { font-size: 11px; line-height: 1.2; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #mobileProjectsList.is-grid .m-project p { display: none; }
  #mobileProjectsList.is-grid .m-project-status { position: absolute; top: 12px; right: 12px; }
  .project-view-toggle .material-symbols-outlined { transition: transform 220ms cubic-bezier(.22,1,.36,1); }
  .project-view-toggle:active .material-symbols-outlined { transform: rotate(90deg) scale(.86); }

  .m-mobile-achievements { display: flex !important; gap: 10px; overflow-x: auto; padding: 8px 4px 16px !important; scrollbar-width: none; }
  .m-mobile-achievements::-webkit-scrollbar { display: none; }
  .m-mobile-achievements button { width: 52px !important; height: 52px !important; flex: 0 0 52px; border-radius: 18px !important; }
  .m-mobile-achievements button i { font-size: 26px !important; }
  .m-mobile-achievements button.is-unlocked { color: var(--v-blue) !important; background: rgba(6,93,253,.1) !important; }
  .m-profile-content.is-editing .m-profile-cover,
  .m-profile-content.is-editing .m-profile-avatar { filter: none !important; opacity: 1 !important; }
  .m-profile-data { position: relative; z-index: 3; }
  #mobileProfileContent.is-editing .m-mobile-achievements,
  #mobileProfileContent.is-editing .m-profile-action,
  #mobileProfileContent.is-editing .m-profile-utility { opacity: .34; filter: saturate(.4); pointer-events: none; transition: opacity 220ms ease, filter 220ms ease; }
  .m-profile-utility button { display: inline-flex !important; align-items: center; justify-content: center; gap: 8px; }
  #mobileProfileQuestion .material-symbols-outlined { margin: 0 !important; transform: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
