/*
 * Mesier mobile responsiveness
 * Capa estrictamente móvil. Mantiene intacta la composición de escritorio y
 * reorganiza la aplicación para pantallas táctiles de hasta 720 px.
 */

.mobile-shell-toggle {
  display: none;
}

.prompt-voice {
  position: relative;
  display: grid;
  width: 62px;
  height: 62px;
  min-height: 62px;
  flex: 0 0 62px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(31, 92, 203, 0.28);
  border-radius: 50%;
  background: rgba(239, 246, 255, 0.72);
  color: #2563eb;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.prompt-voice svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.prompt-voice:hover,
.prompt-voice:focus-visible {
  border-color: rgba(37, 99, 235, 0.58);
  background: #eff6ff;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.10), 0 8px 22px rgba(37, 99, 235, 0.16);
  outline: none;
  transform: translateY(-1px);
}

.prompt-voice.is-listening {
  border-color: rgba(37, 99, 235, 0.78);
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 0 0 7px rgba(59, 130, 246, 0.13), 0 0 28px rgba(37, 99, 235, 0.42);
  animation: mesierVoicePulse 1.35s ease-in-out infinite;
}

.prompt-voice:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
}

.prompt-voice-status {
  position: absolute;
  right: 24px;
  bottom: -30px;
  z-index: 3;
  max-width: min(420px, calc(100vw - 40px));
  overflow: hidden;
  padding: 6px 10px;
  border: 1px solid rgba(147, 197, 253, 0.48);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #31547e;
  font: 600 11px/1.2 "Segoe UI", Arial, sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 7px 18px rgba(37, 99, 235, 0.10);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-3px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.prompt-voice-status.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.prompt-voice-status[data-state="error"] {
  border-color: rgba(239, 68, 68, 0.28);
  color: #b91c1c;
}

@keyframes mesierVoicePulse {
  50% { box-shadow: 0 0 0 12px rgba(59, 130, 246, 0.05), 0 0 34px rgba(37, 99, 235, 0.52); }
}

@media (max-width: 720px) {
  :root {
    --mesier-mobile-gutter: clamp(14px, 4vw, 20px);
    --mesier-mobile-header: 58px;
    --mesier-mobile-footer: 82px;
  }

  html,
  body {
    width: 100%;
    max-width: 100%;
    min-width: 0 !important;
    overflow-x: hidden !important;
    -webkit-text-size-adjust: 100%;
  }

  img,
  svg,
  video,
  canvas,
  iframe {
    max-width: 100%;
  }

  button,
  [role="button"],
  input,
  select,
  textarea {
    touch-action: manipulation;
  }

  button,
  [role="button"] {
    min-height: 42px;
  }

  input,
  select,
  textarea {
    max-width: 100%;
    font-size: 16px;
  }

  .logo-only-header,
  .site-header {
    height: var(--mesier-mobile-header) !important;
    padding: 0 var(--mesier-mobile-gutter) !important;
  }

  .logo-only-header-image,
  .site-header img {
    width: auto !important;
    max-width: min(52vw, 210px) !important;
    height: 19px !important;
  }

  /* Navegación principal accesible con el pulgar. */
  .mobile-shell-toggle {
    position: fixed;
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    z-index: 360;
    display: grid;
    width: 52px;
    height: 52px;
    min-height: 52px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(96, 165, 250, 0.42);
    border-radius: 17px;
    background: rgba(255, 255, 255, 0.88);
    color: #1d4ed8;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
  }

  .mobile-shell-toggle svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
  }

  .mobile-shell-toggle[aria-expanded="true"] {
    color: #ffffff;
    background: #1d4ed8;
  }

  .side-menu-backdrop[data-app-shell] {
    inset: 0;
    z-index: 369;
  }

  .side-drawer[data-app-shell] {
    z-index: 370;
    width: min(78vw, 286px);
    height: 100dvh;
    clip-path: none;
    border-radius: 0 24px 24px 0;
    overflow-y: auto;
  }

  .side-drawer[data-app-shell] .side-drawer-accent {
    display: none;
  }

  .side-drawer[data-app-shell] .side-drawer-body {
    gap: 10px;
    padding: max(24px, env(safe-area-inset-top)) 14px 28px;
  }

  .side-drawer[data-app-shell] .side-drawer-item {
    min-height: 58px;
    gap: 12px;
    padding: 9px 13px;
    text-align: left;
  }

  .side-drawer[data-app-shell] .side-drawer-label {
    font-size: 14px;
  }

  body.menu-drawer-open .mobile-shell-toggle {
    opacity: 0;
    pointer-events: none;
  }

  /* Home */
  body:has(.home-main) {
    height: auto;
    min-height: 100dvh;
    padding-top: var(--mesier-mobile-header);
    overflow-y: auto;
  }

  .home-main {
    display: block !important;
    min-height: calc(100dvh - var(--mesier-mobile-header));
    padding: clamp(58px, 11vh, 90px) var(--mesier-mobile-gutter) 96px !important;
  }

  .home-title {
    position: relative;
    top: auto !important;
    width: 100%;
    font-size: clamp(1.75rem, 8vw, 2.45rem) !important;
    line-height: 1.08 !important;
  }

  .home-title::before {
    inset: 20% 4% -32%;
    filter: blur(20px);
  }

  .home-field {
    width: 100%;
    margin: 32px auto 0 !important;
    transform: none !important;
  }

  .prompt-inner {
    min-height: 78px !important;
    gap: 9px !important;
    padding: 11px 12px 11px 16px !important;
  }

  .prompt-editor {
    min-width: 0;
  }

  .prompt-text {
    height: 48px !important;
    padding: 6px 2px !important;
    font-size: 17px !important;
    line-height: 24px !important;
  }

  .prompt-voice,
  .send {
    width: 48px !important;
    height: 48px !important;
    min-height: 48px;
    flex-basis: 48px !important;
  }

  .prompt-voice-status {
    right: 0;
    bottom: -34px;
    max-width: calc(100vw - 40px);
  }

  .home-field::after {
    inset: -58px -36px;
    filter: blur(70px);
  }

  .home-projects-status,
  .last-opened-project,
  .continue-working,
  .home-main.has-last-opened .continue-working {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    transform: none !important;
  }

  .home-projects-status {
    margin: 50px 0 18px;
  }

  .last-opened-project {
    margin: 24px 0 34px;
  }

  .continue-working {
    margin-top: 30px;
    padding: 0 !important;
  }

  .last-opened-card {
    grid-template-columns: 1fr !important;
    height: auto !important;
    border-radius: 22px !important;
  }

  .last-opened-preview {
    height: clamp(180px, 48vw, 230px) !important;
    margin: 10px !important;
    border-radius: 16px !important;
  }

  .last-opened-content {
    padding: 24px 20px !important;
  }

  .last-opened-heading {
    font-size: clamp(1.65rem, 8vw, 2.25rem) !important;
  }

  .last-opened-description {
    font-size: 15px !important;
  }

  .last-opened-actions {
    width: 100%;
    gap: 10px !important;
  }

  .last-opened-action,
  .last-opened-secondary-action {
    flex: 1 1 100% !important;
    width: 100%;
    min-width: 0 !important;
    min-height: 52px !important;
  }

  .continue-working-header {
    align-items: center;
  }

  .continue-working-list {
    margin-inline: calc(var(--mesier-mobile-gutter) * -1);
    padding-inline: var(--mesier-mobile-gutter);
    scroll-padding-inline: var(--mesier-mobile-gutter);
  }

  .continue-working-card {
    flex-basis: min(82vw, 300px) !important;
    min-width: min(82vw, 300px) !important;
  }

  /* Conversación inicial a pantalla completa y con controles siempre visibles. */
  .home-setup-overlay {
    padding: 0 !important;
  }

  .home-setup-dialog {
    width: 100% !important;
    height: 100dvh !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 0 !important;
  }

  .home-setup-header {
    grid-template-columns: 54px minmax(0, 1fr) 44px !important;
    gap: 10px !important;
    padding: max(14px, env(safe-area-inset-top)) var(--mesier-mobile-gutter) 12px !important;
  }

  .home-setup-orbital-progress {
    width: 52px !important;
    height: 52px !important;
    flex-basis: 52px !important;
  }

  .home-setup-heading .home-setup-title {
    font-size: clamp(1.05rem, 5vw, 1.35rem) !important;
  }

  .home-setup-progress {
    overflow-x: auto;
    padding: 10px var(--mesier-mobile-gutter) 5px !important;
    scrollbar-width: none;
  }

  .home-setup-progress-step {
    flex: 0 0 auto;
  }

  .home-setup-body {
    padding: 18px var(--mesier-mobile-gutter) 22px !important;
    overflow-x: hidden;
  }

  .home-setup-step > .home-setup-step-title,
  .home-setup-step > .home-setup-step-copy,
  .home-setup-step > .home-setup-label,
  .home-setup-step > .home-setup-field-hint,
  .home-setup-step > .home-setup-plan,
  .home-setup-body > .home-setup-status,
  .home-setup-kind-heading {
    margin-left: 0 !important;
  }

  .home-setup-step > .home-setup-step-title::before,
  .home-setup-kind-heading h3::before {
    display: none;
  }

  .home-setup-step > .home-setup-name,
  .home-setup-step > .home-setup-style,
  .home-setup-social-grid,
  .home-setup-step > .home-setup-upload,
  .home-setup-step > .home-logo-ai,
  .home-setup-step > .home-setup-logo-preview,
  .home-setup-step > .home-setup-image-grid,
  .home-setup-step > .home-setup-image-empty,
  .home-setup-kind-grid,
  .home-store-fields-grid,
  .home-store-products-heading,
  .home-store-products {
    width: 100% !important;
    max-width: 100% !important;
  }

  .home-setup-image-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .home-setup-footer {
    gap: 8px;
    padding: 12px var(--mesier-mobile-gutter) max(14px, env(safe-area-inset-bottom)) !important;
  }

  .home-setup-primary,
  .home-setup-secondary {
    min-width: 0 !important;
    padding-inline: 15px !important;
  }

  /* Proyectos */
  body:has(.projects-page) {
    padding-top: var(--mesier-mobile-header);
  }

  .layout {
    padding: 14px var(--mesier-mobile-gutter) 92px !important;
  }

  .projects-page,
  .projects-viewer {
    width: 100% !important;
    min-width: 0 !important;
  }

  .section-head-main,
  .section-head-actions,
  .project-tools,
  .project-selection-toolbar,
  .trash-selection-toolbar {
    align-items: stretch !important;
    flex-direction: column !important;
  }

  .section-title {
    font-size: clamp(1.7rem, 8vw, 2.35rem) !important;
  }

  .project-tools > *,
  .section-head-actions > * {
    width: 100%;
    min-width: 0 !important;
  }

  .project-list {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
    padding: 14px 0 !important;
  }

  .project-card {
    min-width: 0 !important;
  }

  .project-card-actions {
    max-width: calc(100% - 18px) !important;
  }

  .full-preview-bar,
  .trash-dialog-header,
  .preview-asset-gallery-header {
    align-items: flex-start !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
  }

  .full-preview-stage {
    padding: 8px !important;
  }

  /* Cuenta y plantillas */
  body:has(.account-page),
  body:has(.templates-page) {
    padding-top: var(--mesier-mobile-header);
  }

  .account-page,
  .templates-page {
    width: 100% !important;
    padding: 34px var(--mesier-mobile-gutter) 96px !important;
    box-sizing: border-box;
  }

  .account-layout,
  .template-feature {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .profile-card,
  .account-side,
  .template-feature-info,
  .template-feature-visual {
    min-width: 0 !important;
  }

  .template-feature-info {
    padding: 24px 20px !important;
  }

  .profile-info,
  .account-section-heading {
    align-items: flex-start !important;
    flex-direction: column !important;
  }

  /* Editor: generación apilada; edición con lienzo y herramientas inferiores. */
  body:has(.preview-panel) {
    height: auto !important;
    min-height: 100dvh;
    padding-top: var(--mesier-mobile-header);
    overflow-y: auto !important;
  }

  body:has(.preview-panel) .header-actions {
    width: 182px;
    min-width: 182px;
    max-width: 182px;
    flex: 0 0 182px;
    justify-content: flex-end;
    gap: 5px !important;
  }

  body:has(.preview-panel) .logo-only-header-image {
    max-width: 30vw !important;
    height: 16px !important;
  }

  body:has(.preview-panel) .history-btn {
    display: none;
  }

  body:has(.preview-panel) .history-capsule {
    display: none;
  }

  body:has(.preview-panel) .header-preview-btn,
  body:has(.preview-panel) .publish-btn {
    min-width: 0 !important;
    height: 38px !important;
    min-height: 38px !important;
    padding-inline: 8px !important;
    font-size: 9px !important;
  }

  body:has(.preview-panel) .publish-btn {
    width: 72px !important;
    flex: 0 0 72px;
    overflow: hidden !important;
    padding-inline: 0 !important;
    transform: none !important;
  }

  body:has(.preview-panel) .publish-btn .wrapper {
    width: 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;
    padding: 10px 0 !important;
  }

  body:has(.preview-panel) .publish-btn .wrapper span {
    display: block;
    max-width: 100%;
    overflow: hidden;
    padding-inline: 5px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .chat,
  .preview-panel {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    width: calc(100% - (var(--mesier-mobile-gutter) * 2)) !important;
    min-width: 0 !important;
    margin: 12px var(--mesier-mobile-gutter) 0 !important;
    border-radius: 18px !important;
  }

  .chat {
    height: min(48dvh, 470px) !important;
  }

  .preview-panel {
    height: max(54dvh, 440px) !important;
    margin-bottom: 92px !important;
  }

  .composer-field {
    padding-bottom: max(10px, env(safe-area-inset-bottom)) !important;
  }

  .preview-style-toolbar {
    position: fixed !important;
    z-index: 420 !important;
    width: min(324px, calc(100vw - 20px));
    max-width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    border-radius: 20px !important;
  }

  .preview-edit-tabs,
  .simple-edit-tabs {
    overflow-x: auto;
    grid-template-columns: repeat(4, minmax(92px, 1fr)) !important;
    scrollbar-width: none;
  }

  body[data-edit-mode="simple"] .preview-panel {
    position: fixed !important;
    top: var(--mesier-mobile-header) !important;
    right: 0 !important;
    bottom: 43dvh !important;
    left: 0 !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }

  .simple-edit-panel,
  body[data-edit-mode="simple"] .simple-edit-panel {
    top: auto !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 43dvh !important;
    padding: 12px var(--mesier-mobile-gutter) max(12px, env(safe-area-inset-bottom)) !important;
    border-radius: 22px 22px 0 0 !important;
  }

  .full-preview-bar {
    min-height: 58px !important;
    padding: 8px 10px !important;
  }

  .full-preview-copy span {
    display: none !important;
  }

  .full-preview-actions {
    gap: 5px !important;
  }

  .full-preview-device-button,
  .full-preview-close {
    min-height: 38px !important;
    padding: 7px 9px !important;
  }

  .full-preview-stage {
    padding: 0 !important;
  }

  /* Panel de una web */
  body:has(.footer-shell) {
    min-height: 100dvh;
    overflow: hidden !important;
  }

  .header-shell {
    height: 68px !important;
  }

  .header-outline {
    width: 100% !important;
    height: 62px !important;
  }

  .page-title {
    max-width: 42vw !important;
  }

  .back-to-projects {
    top: 12px !important;
    left: 12px !important;
  }

  body[data-panel-view="resumen"] .summary-overview {
    top: 72px !important;
    left: var(--mesier-mobile-gutter) !important;
    width: calc(100vw - (var(--mesier-mobile-gutter) * 2)) !important;
    box-sizing: border-box;
    max-height: 170px;
    overflow-y: auto;
  }

  body[data-panel-view="resumen"] .metrics-panel {
    top: 258px !important;
    right: var(--mesier-mobile-gutter) !important;
    bottom: calc(var(--mesier-mobile-footer) + 8px) !important;
    left: var(--mesier-mobile-gutter) !important;
    width: auto !important;
    grid-template-columns: 1fr !important;
    overflow-y: auto;
    padding-bottom: 12px;
  }

  .storage-view,
  .site-view,
  .gallery-view,
  .analytics-view {
    inset: 72px var(--mesier-mobile-gutter) calc(var(--mesier-mobile-footer) + 8px) !important;
    width: auto !important;
    min-width: 0 !important;
    overflow-y: auto !important;
  }

  .storage-view {
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 14px !important;
  }

  .storage-connections {
    display: none;
  }

  .storage-side,
  .storage-center,
  .storage-side.is-left {
    width: 100% !important;
    min-width: 0 !important;
  }

  .gallery-hud-header,
  .gallery-upload-panel,
  .gallery-selection-toolbar,
  .site-page-manager-header,
  .site-page-row,
  .site-publish-header,
  .site-publish-row,
  .analytics-hero {
    align-items: stretch !important;
    flex-direction: column !important;
  }

  .gallery-upload-actions,
  .site-page-manager-header-actions,
  .site-page-row-actions,
  .site-publish-actions,
  .site-publish-url-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .site-page-manager,
  .site-preview-launch-card,
  .site-publish-card {
    width: 100% !important;
    min-width: 0 !important;
    padding: 16px !important;
  }

  .analytics-view {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto !important;
  }

  .analytics-traffic-details,
  .analytics-conversions-metrics,
  .analytics-traffic-metrics {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .footer-shell {
    z-index: 180;
    height: var(--mesier-mobile-footer) !important;
    background: rgba(255, 255, 255, 0.94);
    border-top: 1px solid rgba(148, 163, 184, 0.24);
    box-shadow: 0 -12px 32px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  .footer-outline {
    display: none;
  }

  .footer-nav {
    position: absolute !important;
    inset: auto 0 0 !important;
    width: auto;
    box-sizing: border-box;
    justify-content: flex-start !important;
    gap: 4px !important;
    overflow-x: auto;
    padding: 8px 10px max(8px, env(safe-area-inset-bottom));
    scrollbar-width: none;
  }

  .footer-item {
    flex: 0 0 72px;
    color: #334155 !important;
  }

  .footer-button {
    width: 100%;
    min-height: 58px;
    gap: 3px !important;
  }

  .footer-icon-wrap {
    width: 26px !important;
    height: 26px !important;
  }

  .footer-label {
    font-size: 9px !important;
  }

  .site-full-preview-bar {
    min-height: 58px;
    padding: 8px 10px !important;
  }

  .site-full-preview-title {
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .site-full-preview-device span:last-child {
    display: none;
  }

  /* Panel de tienda */
  body:has(.sidebar + .shell) {
    min-height: 100dvh;
    overflow-x: hidden;
  }

  .sidebar {
    position: sticky !important;
    top: 0;
    z-index: 80 !important;
    display: grid;
    width: 100% !important;
    height: auto !important;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: 48px 54px;
    align-items: center;
    padding: max(6px, env(safe-area-inset-top)) 10px 7px !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--line);
    overflow: hidden !important;
  }

  .sidebar .logo {
    grid-column: 1 / -1;
    grid-row: 1;
    width: 126px !important;
    margin: 0 auto !important;
  }

  .sidebar-back {
    top: 11px !important;
    left: 10px !important;
    z-index: 2;
    width: 40px !important;
    height: 40px !important;
  }

  .sidebar .nav {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex !important;
    gap: 7px !important;
    overflow-x: auto;
    padding: 3px 0;
    scrollbar-width: none;
  }

  .sidebar .nav button {
    flex: 0 0 auto;
    width: auto !important;
    min-height: 44px;
    padding: 0 11px !important;
  }

  .sidebar .nav-icon {
    width: 30px !important;
    height: 30px !important;
    flex-basis: 30px !important;
  }

  .shell {
    width: 100%;
    min-width: 0 !important;
    margin-left: 0 !important;
  }

  .top {
    top: 0 !important;
    align-items: flex-start !important;
    flex-direction: column !important;
    gap: 12px;
    padding: 14px var(--mesier-mobile-gutter) !important;
  }

  .top .actions {
    width: 100%;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .top .actions .btn {
    min-width: 0;
    padding-inline: 8px;
    font-size: 12px;
  }

  .main {
    padding: 24px var(--mesier-mobile-gutter) 92px !important;
  }

  .head {
    align-items: stretch !important;
    flex-direction: column !important;
  }

  .kpis,
  .dash,
  .analytics,
  .formgrid,
  .design-layout,
  .storage-breakdown,
  .storage-hero {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .tiles,
  .customers,
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr)) !important;
  }

  .tablebox {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .toolbar .search,
  .gallery-tools .search {
    width: 100%;
    min-width: 0 !important;
  }

  .dialog {
    width: 100% !important;
    max-height: calc(100dvh - 20px) !important;
    padding: 20px var(--mesier-mobile-gutter) !important;
    border-radius: 20px !important;
  }

  .modal {
    align-items: end !important;
    padding: 10px !important;
  }

  .store-preview-bar {
    align-items: flex-start !important;
    flex-wrap: wrap;
    padding: 8px 10px !important;
  }

  .store-preview-actions {
    width: 100%;
    justify-content: space-between;
  }

  .store-preview-stage {
    padding: 6px !important;
  }

  .store-preview-overlay.mobile .store-preview-shell {
    width: min(390px, 100%) !important;
  }

  /* Acceso */
  body:has(> main > .login-avatar) {
    height: auto;
    min-height: 100dvh;
    overflow-y: auto;
    padding: 58px var(--mesier-mobile-gutter) 28px !important;
  }

  main:has(> .login-avatar) {
    width: 100% !important;
    max-width: 390px;
  }
}

/*
 * Home y Proyectos: en una pantalla pequeña no se debe perder la lectura
 * horizontal de una aplicación de escritorio. Las fichas conservan siempre
 * miniatura + información lateral; cuando hay ancho real (tableta u
 * horizontal), Home pasa a dos zonas en vez de hacerse una columna larga.
 */
@media (max-width: 720px) {
  body:has(.home-main) .last-opened-card {
    grid-template-columns: minmax(132px, 42%) minmax(0, 1fr) !important;
    height: 204px !important;
    min-height: 204px !important;
  }

  body:has(.home-main) .last-opened-preview {
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border-right: 1px solid rgba(148, 163, 184, 0.2);
  }

  body:has(.home-main) .last-opened-preview-frame {
    height: calc(204px / 0.32) !important;
  }

  body:has(.home-main) .last-opened-content {
    min-width: 0;
    padding: 16px 14px !important;
  }

  body:has(.home-main) .last-opened-kicker { margin-bottom: 5px !important; }

  body:has(.home-main) .last-opened-heading {
    font-size: clamp(1.1rem, 5.3vw, 1.45rem) !important;
    line-height: 1.12 !important;
  }

  body:has(.home-main) .last-opened-description {
    display: -webkit-box;
    margin: 6px 0 10px !important;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  body:has(.home-main) .last-opened-meta { gap: 8px !important; }

  body:has(.home-main) .last-opened-actions {
    flex-wrap: wrap;
    gap: 7px !important;
  }

  body:has(.home-main) .last-opened-action,
  body:has(.home-main) .last-opened-secondary-action {
    flex: 1 1 112px !important;
    width: auto !important;
    min-height: 38px !important;
    padding-inline: 10px !important;
  }

  body:has(.home-main) .continue-working-card {
    display: grid;
    grid-template-columns: 43% minmax(0, 1fr);
    flex-basis: min(92vw, 360px) !important;
    min-width: min(92vw, 360px) !important;
    min-height: 150px;
  }

  body:has(.home-main) .continue-working-preview {
    width: 100%;
    height: 100% !important;
    min-height: 150px;
    border-right: 1px solid rgba(148, 163, 184, 0.16);
    border-bottom: 0;
  }

  body:has(.home-main) .continue-working-preview-frame {
    width: calc(100% / 0.32);
    height: calc(150px / 0.32);
  }

  body:has(.home-main) .continue-working-copy {
    align-content: center;
    min-height: 0;
    padding: 12px !important;
  }

}

@media (max-width: 900px) and (orientation: landscape),
       (min-width: 721px) and (max-width: 1100px) {
  body:has(.home-main) {
    --mesier-mobile-header: 64px;
    height: auto !important;
    min-height: 100dvh;
    overflow-y: auto !important;
  }

  body:has(.home-main) .home-main {
    display: grid !important;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    grid-template-areas:
      "title status"
      "field recent"
      "projects projects";
    align-content: start;
    column-gap: clamp(18px, 3vw, 34px);
    row-gap: 18px;
    min-height: calc(100dvh - var(--mesier-mobile-header, 64px));
    padding: clamp(22px, 4vw, 48px) var(--mesier-mobile-gutter) 96px !important;
  }

  body:has(.home-main) .home-title {
    grid-area: title;
    position: relative !important;
    top: auto !important;
    transform: none !important;
    align-self: end;
    width: 100%;
    font-size: clamp(1.75rem, 4.4vw, 2.65rem) !important;
  }

  body:has(.home-main) .home-field {
    grid-area: field;
    align-self: start;
    width: 100%;
    margin: 0 !important;
    transform: none !important;
  }

  body:has(.home-main) .home-projects-status,
  body:has(.home-main) .last-opened-project,
  body:has(.home-main) .continue-working {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    margin: 0 !important;
    transform: none !important;
  }

  body:has(.home-main) .home-projects-status { grid-area: status; align-self: end; }
  body:has(.home-main) .last-opened-project { grid-area: recent; align-self: stretch; }
  body:has(.home-main) .continue-working { grid-area: projects; }

  body:has(.home-main) .last-opened-card {
    height: 100% !important;
    min-height: 236px !important;
    grid-template-columns: minmax(178px, 43%) minmax(0, 1fr) !important;
  }

  body:has(.home-main) .last-opened-preview-frame {
    height: calc(236px / 0.32) !important;
  }

}

/* El alto de un teléfono horizontal es limitado: la primera vista debe caber
   como una app, no dejar el área de proyectos cortada bajo el borde. */
@media (max-width: 900px) and (orientation: landscape) {
  body:has(.home-main) .home-main {
    grid-template-areas:
      "title status"
      "field recent"
      "projects projects";
    column-gap: clamp(16px, 3vw, 28px);
    row-gap: 10px;
    min-height: calc(100dvh - var(--mesier-mobile-header, 58px));
    padding: 16px var(--mesier-mobile-gutter) 18px !important;
  }

  body:has(.home-main) .home-title {
    align-self: center;
    font-size: clamp(1.25rem, 4.1vw, 2rem) !important;
  }

  body:has(.home-main) .home-projects-status {
    align-self: center;
  }

  body:has(.home-main) .continue-working {
    align-self: stretch;
    min-width: 0;
  }

  body:has(.home-main) .continue-working-header {
    min-height: 0;
    gap: 8px;
  }

  body:has(.home-main) .continue-working-heading-icon {
    width: 34px;
    height: 34px;
  }

  body:has(.home-main) .continue-working-heading-icon svg {
    width: 22px;
    height: 22px;
  }

  body:has(.home-main) .continue-working-title {
    font-size: 16px;
  }

  body:has(.home-main) .continue-working-subtitle {
    font-size: 11px;
  }

  body:has(.home-main) .last-opened-card {
    height: 184px !important;
    min-height: 184px !important;
  }

  body:has(.home-main) .last-opened-preview-frame {
    height: calc(184px / 0.32) !important;
  }
}

/* Home: una sola composición de flujo para pantallas táctiles.
   Evita mezclar coordenadas de escritorio con cuadrículas experimentales. */
@media (max-width: 720px) {
  body:has(.home-main) .last-opened-card {
    grid-template-columns: 1fr !important;
    height: auto !important;
    min-height: 0 !important;
  }

  body:has(.home-main) .last-opened-preview {
    height: clamp(180px, 48vw, 230px) !important;
    min-height: 0 !important;
    margin: 10px !important;
    border: 0;
    border-radius: 16px !important;
  }

  body:has(.home-main) .last-opened-preview-frame {
    height: calc(clamp(180px, 48vw, 230px) / 0.32) !important;
  }

  body:has(.home-main) .last-opened-content {
    padding: 24px 20px !important;
  }

  body:has(.home-main) .continue-working-card {
    display: block;
    min-height: 0;
  }

  body:has(.home-main) .continue-working-preview {
    height: 164px !important;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  }

  body:has(.home-main) .continue-working-preview-frame {
    width: calc(100% / 0.32);
    height: calc(164px / 0.32);
  }

  body:has(.home-main) .continue-working-copy {
    min-height: 48px;
    padding: 12px 14px 13px !important;
  }
}

@media (min-width: 721px) and (max-width: 1100px),
       (max-width: 900px) and (orientation: landscape) {
  body:has(.home-main) {
    height: auto !important;
    min-height: 100dvh;
    overflow-y: auto !important;
  }

  body:has(.home-main) .home-main {
    display: block !important;
    min-height: calc(100dvh - 64px);
    padding: clamp(34px, 6vh, 64px) clamp(24px, 5vw, 52px) 76px !important;
  }

  body:has(.home-main) .home-title {
    position: relative !important;
    top: auto !important;
    width: 100%;
    margin: 0 !important;
    transform: none !important;
    text-align: center;
    font-size: clamp(1.8rem, 4vw, 2.7rem) !important;
  }

  body:has(.home-main) .home-field {
    width: min(100%, 760px);
    margin: 28px auto 0 !important;
    transform: none !important;
  }

  body:has(.home-main) .home-projects-status,
  body:has(.home-main) .last-opened-project,
  body:has(.home-main) .continue-working {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: min(100%, 980px) !important;
    margin: 28px auto 0 !important;
    transform: none !important;
  }

  body:has(.home-main) .last-opened-card {
    grid-template-columns: minmax(250px, 42%) minmax(0, 1fr) !important;
    height: 250px !important;
    min-height: 0 !important;
  }

  body:has(.home-main) .last-opened-preview {
    height: 100% !important;
    margin: 0 !important;
    border-right: 1px solid rgba(148, 163, 184, 0.2);
    border-bottom: 0;
    border-radius: 0;
  }

  body:has(.home-main) .last-opened-preview-frame {
    height: calc(250px / 0.32) !important;
  }
}

@media (max-width: 390px) {
  .gallery-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .home-setup-footer {
    flex-wrap: wrap;
  }

  .home-setup-primary,
  .home-setup-secondary {
    flex: 1 1 calc(50% - 6px);
  }

  .top .actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 320px) {
  body:has(.preview-panel) .logo-only-header {
    padding-inline: 8px !important;
  }

  body:has(.preview-panel) .logo-only-header-image {
    max-width: 24vw !important;
    height: 13px !important;
  }

  body:has(.preview-panel) .header-actions {
    width: 168px;
    min-width: 168px;
    max-width: 168px;
    flex-basis: 168px;
    gap: 3px !important;
  }

  body:has(.preview-panel) .header-preview-btn {
    padding-inline: 5px !important;
    font-size: 8px !important;
  }

  body:has(.preview-panel) .publish-btn .wrapper {
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
  }

  body:has(.preview-panel) .publish-btn {
    width: 60px !important;
    flex-basis: 60px;
  }

  .profile-card,
  .usage-card,
  .latest-card,
  .security-card {
    padding: 18px !important;
  }

  .profile-top {
    align-items: flex-start !important;
    flex-direction: column;
  }

  .profile-top > div {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 260px) {
  body:has(.preview-panel) .logo-only-header {
    padding-inline: 4px !important;
  }

  body:has(.preview-panel) .logo-only-header-image {
    width: 50px !important;
    max-width: 50px !important;
    height: auto !important;
  }

  body:has(.preview-panel) .header-actions {
    width: 148px;
    min-width: 148px;
    max-width: 148px;
    flex-basis: 148px;
    gap: 2px !important;
  }

  body:has(.preview-panel) .header-preview-btn {
    width: 88px !important;
    flex: 0 0 88px;
    padding-inline: 0 !important;
    font-size: 7px !important;
  }

  body:has(.preview-panel) .publish-btn,
  body:has(.preview-panel) .publish-btn .wrapper {
    width: 58px !important;
    min-width: 58px !important;
    max-width: 58px !important;
  }

  body:has(.preview-panel) .publish-btn {
    flex-basis: 58px;
    font-size: 7px !important;
  }
}

@media (max-width: 720px) and (prefers-reduced-motion: reduce) {
  .mobile-shell-toggle,
  .side-drawer[data-app-shell],
  .prompt-voice {
    transition: none !important;
    animation: none !important;
  }
}

/*
 * Panel normal de una web
 *
 * En escritorio el panel funciona como un tablero de posiciones fijas. En una
 * pantalla táctil eso termina recortando vistas largas (Galería, Sitio,
 * Almacenamiento y Analítica). Aquí las cinco vistas pasan a un flujo real de
 * documento: el encabezado y la navegación siguen anclados, pero el contenido
 * puede crecer y desplazarse de forma natural. No afecta tienda-panel.html ni
 * la composición de escritorio a partir de 1181 px.
 */
@media (max-width: 720px),
       (max-width: 900px) and (orientation: landscape),
       (min-width: 721px) and (max-width: 1180px) {
  body:has(.footer-shell) {
    --mesier-panel-gutter: clamp(14px, 3vw, 28px);
    --mesier-panel-header: 72px;
    --mesier-panel-footer: 82px;
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 100dvh;
    box-sizing: border-box;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding: calc(var(--mesier-panel-header) + 14px) var(--mesier-panel-gutter) calc(var(--mesier-panel-footer) + max(18px, env(safe-area-inset-bottom))) !important;
  }

  body:has(.footer-shell) .header-shell {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    left: 0 !important;
    height: var(--mesier-panel-header) !important;
  }

  body:has(.footer-shell) .header-outline {
    width: 100% !important;
    height: calc(var(--mesier-panel-header) - 8px) !important;
    top: -10px !important;
  }

  body:has(.footer-shell) .page-title {
    top: 17px !important;
    width: min(154px, 42vw) !important;
  }

  body:has(.footer-shell) .back-to-projects {
    top: 14px !important;
    left: var(--mesier-panel-gutter) !important;
  }

  /* Ninguna vista inactiva conserva espacio en el flujo táctil. */
  body:has(.footer-shell) .summary-overview,
  body:has(.footer-shell) .metrics-panel,
  body:has(.footer-shell) .gallery-view,
  body:has(.footer-shell) .storage-view,
  body:has(.footer-shell) .site-view,
  body:has(.footer-shell) .analytics-view {
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    max-height: none !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    overflow: visible !important;
    transform: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  body:has(.footer-shell) .summary-overview,
  body:has(.footer-shell) .metrics-panel,
  body:has(.footer-shell) .gallery-view,
  body:has(.footer-shell) .storage-view,
  body:has(.footer-shell) .site-view,
  body:has(.footer-shell) .analytics-view {
    display: none !important;
  }

  body[data-panel-view="resumen"] .summary-overview {
    display: flex !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  body[data-panel-view="resumen"] .metrics-panel {
    display: grid !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  body[data-panel-view="galeria"] .gallery-view,
  body[data-panel-view="almacenamiento"] .storage-view,
  body[data-panel-view="sitio"] .site-view,
  body[data-panel-view="analitica"] .analytics-view {
    display: grid !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  body:has(.footer-shell) .summary-overview {
    min-height: 0 !important;
    align-items: flex-start !important;
    flex-direction: column !important;
    gap: 14px !important;
    padding: clamp(17px, 3vw, 24px) !important;
    overflow: hidden !important;
  }

  /* El halo sigue visible, pero nunca amplía el ancho desplazable en táctil. */
  body:has(.footer-shell) .summary-overview::before {
    right: 0 !important;
  }

  body:has(.footer-shell) .summary-overview-title {
    max-width: 100% !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
  }

  body:has(.footer-shell) .summary-overview-status {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  body:has(.footer-shell) .metrics-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: clamp(10px, 2vw, 16px) !important;
    margin-top: 14px !important;
  }

  body:has(.footer-shell) .metrics-panel .metric-card {
    min-height: 142px !important;
  }

  body:has(.footer-shell) .metrics-panel .metric-card-inner {
    grid-template-columns: 76px minmax(0, 1fr) !important;
    gap: 10px !important;
    padding: 14px !important;
  }

  body:has(.footer-shell) .metrics-panel .metric-gauge {
    width: 74px !important;
    height: 74px !important;
  }

  body:has(.footer-shell) .metrics-panel .metric-value {
    font-size: clamp(1.45rem, 4.4vw, 2rem) !important;
  }

  body:has(.footer-shell) .gallery-view,
  body:has(.footer-shell) .site-view,
  body:has(.footer-shell) .analytics-view {
    align-content: start !important;
    gap: clamp(12px, 2vw, 18px) !important;
  }

  body:has(.footer-shell) .gallery-hud-frame,
  body:has(.footer-shell) .storage-connections {
    display: none !important;
  }

  body:has(.footer-shell) .gallery-upload-panel,
  body:has(.footer-shell) .gallery-selection-toolbar,
  body:has(.footer-shell) .site-preview-launch-card,
  body:has(.footer-shell) .site-page-manager,
  body:has(.footer-shell) .site-publish-card {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  body:has(.footer-shell) .gallery-grid {
    width: 100% !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: clamp(10px, 2vw, 16px) !important;
  }

  body:has(.footer-shell) .storage-view {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    grid-template-areas: "core core" "left right" !important;
    align-items: start !important;
    justify-items: stretch !important;
    gap: clamp(16px, 3vw, 28px) clamp(12px, 2vw, 20px) !important;
  }

  body:has(.footer-shell) .storage-core {
    grid-area: core !important;
    justify-self: center !important;
    width: min(270px, 70vw) !important;
  }

  body:has(.footer-shell) .storage-side.is-left {
    grid-area: left !important;
  }

  body:has(.footer-shell) .storage-side.is-right {
    grid-area: right !important;
  }

  body:has(.footer-shell) .storage-side,
  body:has(.footer-shell) .storage-side.is-left,
  body:has(.footer-shell) .storage-side.is-right {
    width: 100% !important;
    min-width: 0 !important;
  }

  body:has(.footer-shell) .site-view {
    justify-items: stretch !important;
    place-items: initial !important;
    padding: 0 0 12px !important;
  }

  body:has(.footer-shell) .site-preview-launch-card,
  body:has(.footer-shell) .site-page-manager-header,
  body:has(.footer-shell) .site-page-row,
  body:has(.footer-shell) .site-publish-header,
  body:has(.footer-shell) .site-publish-row,
  body:has(.footer-shell) .analytics-hero {
    align-items: stretch !important;
    flex-direction: column !important;
  }

  body:has(.footer-shell) .site-preview-launch-button,
  body:has(.footer-shell) .site-page-manager-header-actions,
  body:has(.footer-shell) .site-page-row-actions,
  body:has(.footer-shell) .site-publish-actions,
  body:has(.footer-shell) .site-publish-url-actions {
    width: 100% !important;
    flex-wrap: wrap !important;
  }

  body:has(.footer-shell) .analytics-view {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto !important;
    padding: 0 0 12px !important;
  }

  body:has(.footer-shell) .analytics-traffic-details,
  body:has(.footer-shell) .analytics-traffic-metrics,
  body:has(.footer-shell) .analytics-conversions-metrics,
  body:has(.footer-shell) .analytics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body:has(.footer-shell) .footer-shell {
    position: fixed !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 180 !important;
    height: var(--mesier-panel-footer) !important;
    background: rgba(255, 255, 255, 0.94) !important;
    border-top: 1px solid rgba(148, 163, 184, 0.24) !important;
    box-shadow: 0 -12px 32px rgba(15, 23, 42, 0.08) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  body:has(.footer-shell) .footer-outline {
    display: none !important;
  }

  body:has(.footer-shell) .footer-nav {
    position: absolute !important;
    inset: auto 0 0 !important;
    width: auto !important;
    box-sizing: border-box !important;
    justify-content: flex-start !important;
    gap: 4px !important;
    overflow-x: auto !important;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    padding: 8px 10px max(8px, env(safe-area-inset-bottom)) !important;
    scrollbar-width: none;
  }

  body:has(.footer-shell) .footer-item {
    flex: 0 0 70px !important;
    scroll-snap-align: center;
    color: #334155 !important;
  }

  body:has(.footer-shell) .footer-button {
    width: 100% !important;
    min-height: 58px !important;
    gap: 3px !important;
  }

  body:has(.footer-shell) .footer-icon-wrap {
    width: 26px !important;
    height: 26px !important;
  }

  body:has(.footer-shell) .footer-label {
    font-size: 9px !important;
  }
}

@media (max-width: 520px) {
  body:has(.footer-shell) {
    --mesier-panel-header: 64px;
  }

  body:has(.footer-shell) .page-title {
    top: 17px !important;
    width: 132px !important;
  }

  body:has(.footer-shell) .back-to-projects {
    width: 38px !important;
    height: 38px !important;
    justify-content: center !important;
    padding: 0 !important;
  }

  body:has(.footer-shell) .back-to-projects .back-label {
    display: none !important;
  }

  body:has(.footer-shell) .back-to-projects::after {
    position: static !important;
    content: "\2190" !important;
    transform: none !important;
  }

  body:has(.footer-shell) .metrics-panel,
  body:has(.footer-shell) .analytics-traffic-details,
  body:has(.footer-shell) .analytics-traffic-metrics,
  body:has(.footer-shell) .analytics-conversions-metrics,
  body:has(.footer-shell) .analytics-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body:has(.footer-shell) .summary-overview-next {
    flex-wrap: wrap !important;
    gap: 4px 8px !important;
  }

  body:has(.footer-shell) .summary-overview-next strong {
    min-width: 0 !important;
    flex: 1 1 132px !important;
    overflow-wrap: anywhere !important;
  }

  body:has(.footer-shell) .summary-overview > * {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  body:has(.footer-shell) .summary-overview-copy,
  body:has(.footer-shell) .summary-overview-status-copy {
    overflow-wrap: anywhere !important;
  }

  body:has(.footer-shell) .metrics-panel .metric-card-inner {
    grid-template-columns: 78px minmax(0, 1fr) !important;
  }

  body:has(.footer-shell) .metrics-panel .metric-gauge {
    width: 76px !important;
    height: 76px !important;
  }

  body:has(.footer-shell) .storage-view {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas: "core" "left" "right" !important;
  }

  body:has(.footer-shell) .gallery-upload-actions,
  body:has(.footer-shell) .gallery-selection-actions {
    width: 100% !important;
    flex-wrap: wrap !important;
  }

  body:has(.footer-shell) .site-window {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    height: min(420px, 68dvh) !important;
  }

  body:has(.footer-shell) .site-window-bar {
    display: grid !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    grid-template-columns: minmax(0, 1fr) !important;
    box-sizing: border-box !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    gap: 8px !important;
    padding: 10px 12px !important;
  }

  body:has(.footer-shell) .site-window-bar > span:first-child {
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
  }

  body:has(.footer-shell) .site-window-actions {
    display: grid !important;
    width: 100% !important;
    min-width: 0 !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    justify-content: stretch !important;
    gap: 6px !important;
  }

  body:has(.footer-shell) .site-preview-button {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 7px 8px !important;
    font-size: 10px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body:has(.footer-shell) .site-window-status {
    min-width: 0 !important;
    grid-column: 1 / -1 !important;
  }

  body:has(.footer-shell) .analytics-view-switch {
    display: flex !important;
    width: 100% !important;
    flex-wrap: wrap !important;
  }

  body:has(.footer-shell) .analytics-view-button {
    min-width: 0 !important;
    flex: 1 1 108px !important;
    justify-content: center !important;
    padding-inline: 8px !important;
  }
}
