/* V307 — actual old mobile Legacy dock + dock-status reveal.
   Legacy is intentionally isolated from the modern Top/Bottom floating dock. */

@media (max-width: 700px) {
  /* The old phone dock did not show account identity inside the rail. */
  body[data-auth-state="authenticated"][data-mobile-dock-position="legacy"] #appSection > .card.account-bar {
    display: block !important;
    width: 100% !important;
    min-height: 70px !important;
    height: 70px !important;
    margin: 16px 0 0 !important;
    padding: 9px 12px !important;
    box-sizing: border-box !important;
    border-radius: 999px !important;
    overflow: visible !important;
    text-align: left !important;
  }

  body[data-auth-state="authenticated"][data-mobile-dock-position="legacy"] #authenticatedAccountIdentity,
  body[data-auth-state="authenticated"][data-mobile-dock-position="legacy"] #authenticatedAccountIdentity.account-identity,
  body[data-auth-state="authenticated"][data-mobile-dock-position="legacy"] .card.account-bar > .account-identity {
    display: none !important;
  }

  body[data-auth-state="authenticated"][data-mobile-dock-position="legacy"] #authenticatedAccountButtons:not(.hidden):not([hidden]),
  body[data-auth-state="authenticated"][data-mobile-dock-position="legacy"] .card.account-bar #authenticatedAccountButtons:not(.hidden):not([hidden]),
  body[data-auth-state="authenticated"][data-mobile-dock-position="legacy"] .card.account-bar .account-buttons:not(.hidden):not([hidden]) {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0 !important;
    width: 100% !important;
    height: 52px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  body[data-auth-state="authenticated"][data-mobile-dock-position="legacy"] #authenticatedAccountButtons > button,
  body[data-auth-state="authenticated"][data-mobile-dock-position="legacy"] .card.account-bar #authenticatedAccountButtons > button {
    position: relative !important;
    display: inline-flex !important;
    flex: 0 0 52px !important;
    align-items: center !important;
    justify-content: center !important;
    width: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
    border-radius: 50% !important;
    overflow: visible !important;
    line-height: 0 !important;
  }

  /* Old mask icons stay disabled; the clean SVGs are the visible icons. */
  body[data-auth-state="authenticated"][data-mobile-dock-position="legacy"] #authenticatedAccountButtons > button::before {
    content: none !important;
    display: none !important;
  }

  body[data-auth-state="authenticated"][data-mobile-dock-position="legacy"] #authenticatedAccountButtons .account-nav-icon,
  body[data-auth-state="authenticated"][data-mobile-dock-position="legacy"] #authenticatedAccountButtons #profileButton .account-nav-icon,
  body[data-auth-state="authenticated"][data-mobile-dock-position="legacy"] #authenticatedAccountButtons #directMessagesButton .account-nav-icon,
  body[data-auth-state="authenticated"][data-mobile-dock-position="legacy"] #authenticatedAccountButtons #notificationsButton .account-nav-icon,
  body[data-auth-state="authenticated"][data-mobile-dock-position="legacy"] #authenticatedAccountButtons #settingsButton .account-nav-icon {
    display: block !important;
    width: 24px !important;
    height: 24px !important;
    flex: 0 0 24px !important;
    overflow: visible !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 1.9 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
    pointer-events: none !important;
  }

  body[data-auth-state="authenticated"][data-mobile-dock-position="legacy"] #authenticatedAccountButtons #profileButton .account-nav-icon {
    width: 25px !important;
    height: 25px !important;
    flex-basis: 25px !important;
    stroke-width: 1.75 !important;
  }

  body[data-auth-state="authenticated"][data-mobile-dock-position="legacy"] #authenticatedAccountButtons > button .account-button-label {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }

  body[data-auth-state="authenticated"][data-mobile-dock-position="legacy"] #authenticatedAccountButtons #dmUnreadBadge,
  body[data-auth-state="authenticated"][data-mobile-dock-position="legacy"] #authenticatedAccountButtons #notificationUnreadBadge {
    top: 2px !important;
    right: 1px !important;
  }
}

@media (max-width: 360px) {
  body[data-auth-state="authenticated"][data-mobile-dock-position="legacy"] #appSection > .card.account-bar {
    min-height: 66px !important;
    height: 66px !important;
    padding: 8px 10px !important;
  }

  body[data-auth-state="authenticated"][data-mobile-dock-position="legacy"] #authenticatedAccountButtons:not(.hidden):not([hidden]) {
    height: 50px !important;
  }

  body[data-auth-state="authenticated"][data-mobile-dock-position="legacy"] #authenticatedAccountButtons > button,
  body[data-auth-state="authenticated"][data-mobile-dock-position="legacy"] .card.account-bar #authenticatedAccountButtons > button {
    flex-basis: 50px !important;
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
  }
}

/* Dock-position feedback grows out of the Dock position card itself.
   There is no permanent blank row. The message remains in flow while hiding,
   so the card contracts with the same motion rather than snapping. */
.mobile-dock-position-preference {
  overflow: hidden !important;
}

#dockPositionMessage,
#dockPositionMessage:empty,
#dockPositionMessage:not(:empty) {
  display: block !important;
  box-sizing: border-box !important;
  max-height: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  transform: translateY(-12px) !important;
  clip-path: inset(0 0 100% 0) !important;
  overflow: hidden !important;
  pointer-events: none !important;
  transition:
    max-height 320ms cubic-bezier(.22,.8,.22,1),
    margin-top 320ms cubic-bezier(.22,.8,.22,1),
    opacity 190ms ease,
    transform 320ms cubic-bezier(.22,.8,.22,1),
    clip-path 320ms cubic-bezier(.22,.8,.22,1) !important;
  will-change: max-height, margin-top, opacity, transform, clip-path;
}

#dockPositionMessage.dock-status-visible {
  max-height: 48px !important;
  margin-top: 14px !important;
  opacity: 1 !important;
  transform: translateY(0) !important;
  clip-path: inset(0 0 0 0) !important;
}

#dockPositionMessage.dock-status-hiding {
  max-height: 0 !important;
  margin-top: 0 !important;
  opacity: 0 !important;
  transform: translateY(-12px) !important;
  clip-path: inset(0 0 100% 0) !important;
}

@media (prefers-reduced-motion: reduce) {
  #dockPositionMessage,
  #dockPositionMessage:empty,
  #dockPositionMessage:not(:empty) {
    transition-duration: 1ms !important;
  }
}
