/* Final mobile geometry for the management app. Field text and placeholders
   share the typography scale; headings use 16/20px. */
@media (max-width: 760px) {
  .toast {
    padding: 12px 14px !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 20px !important;
  }

  :root {
    --text-title: 1.25rem;
    --text-section: 1rem;
    --text-subtitle: 1rem;
    --text-display: 1.5rem;
  }

  .app-shell .page-content { padding: 16px !important; }
  :root body :is(.button, .file-button) {
    min-height: 44px !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    line-height: 20px !important;
  }
  :root body .icon-button {
    min-width: 44px !important;
    min-height: 44px !important;
    --icon-size: 20px;
  }
  .modal-backdrop .modal {
    padding: 20px 16px !important;
  }
  .modal-header { gap: 12px !important; margin-bottom: 16px !important; }
  .form-grid { gap: 16px !important; }

  #homeMetricsGrid { gap: 12px !important; }
  .home-quick-access-grid .home-shortcut { min-height: 72px; padding: 12px; }

  .notification-drawer .notification-item { padding: 16px !important; }
  .notification-item strong, .notification-empty strong { font-size: 16px !important; }
  .notification-item p, .notification-empty p { font-size: 12px !important; line-height: 20px !important; }

  .browser-notification-prompt {
    box-sizing: border-box !important;
    left: max(12px, env(safe-area-inset-left)) !important;
    right: max(12px, env(safe-area-inset-right)) !important;
    bottom: max(12px, env(safe-area-inset-bottom)) !important;
    width: auto !important;
    max-width: 440px !important;
    margin-inline: auto !important;
    grid-template-columns: 24px minmax(0, 1fr) !important;
    gap: 12px !important;
    padding: 16px !important;
    border-radius: 12px !important;
  }
  .browser-notification-icon {
    align-self: start !important;
    width: 24px !important;
    height: 24px !important;
    border: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
    color: var(--color-primary) !important;
    --icon-size: 24px;
  }
  .browser-notification-copy strong {
    font-size: 16px !important;
    line-height: 20px !important;
    white-space: normal !important;
  }
  .browser-notification-copy p { font-size: 12px !important; line-height: 16px !important; }
  .browser-notification-actions { grid-column: 1 / -1 !important; width: 100% !important; }
  .browser-notification-actions .button { flex: 1 1 0; min-width: 0; }
}

/* Keep password recovery consistent with the split login screen. */
.reset-password-screen:not(.hidden) {
  display: grid !important;
  grid-template-columns: minmax(0, 3fr) minmax(380px, 2fr) !important;
  align-items: stretch !important;
  min-height: 100dvh !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: #ffffff !important;
}

.reset-password-screen .auth-bg {
  display: grid !important;
  align-items: start !important;
  justify-items: start !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 100dvh !important;
  padding: clamp(44px, 8vh, 82px) clamp(44px, 6vw, 88px) !important;
  overflow: hidden !important;
  background: var(--color-primary) !important;
}

.reset-password-screen .auth-bg > img {
  width: 100% !important;
  height: 100% !important;
  min-height: 100dvh !important;
  object-fit: cover !important;
  opacity: 0.3 !important;
}

.reset-password-screen .auth-bg .auth-testimonial-avatar img {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  width: 118% !important;
  height: 118% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  transform: translate(-47%, -47%) !important;
  object-fit: cover !important;
  object-position: center !important;
  opacity: 1 !important;
}

.reset-password-screen .auth-card {
  align-self: center !important;
  justify-self: center !important;
  width: min(100%, 460px) !important;
  max-width: calc(100% - 40px) !important;
  max-height: calc(100dvh - 40px) !important;
  margin: 0 !important;
  padding: clamp(26px, 3vw, 38px) !important;
  overflow-y: auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #ffffff !important;
  box-shadow: none !important;
}

.reset-password-screen .auth-brand {
  margin-bottom: 28px !important;
}

.reset-password-screen .auth-brand img {
  width: min(180px, 72%) !important;
}

@media (max-width: 1080px) {
  .reset-password-screen:not(.hidden) {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    min-height: 100dvh !important;
    padding: 24px !important;
    place-items: center !important;
    overflow-y: auto !important;
  }

  .reset-password-screen .auth-bg {
    display: none !important;
  }

  .reset-password-screen .auth-card {
    width: min(100%, 520px) !important;
    max-width: 520px !important;
    max-height: none !important;
    margin: 0 auto !important;
    padding: 28px 24px 34px !important;
  }
}

@media (max-width: 520px) {
  .reset-password-screen:not(.hidden) {
    padding: 18px !important;
  }

  .reset-password-screen .auth-card {
    padding: 24px 18px 30px !important;
  }
}

/* Compact, consistent scale for narrow mobile screens. */
@media (max-width: 760px) {
  :root {
    --text-body: 0.875rem;
    --text-action: 0.875rem;
    --text-section: 1.125rem;
    --text-subtitle: 1rem;
    --text-title: 1.25rem;
    --text-display: 1.5rem;
  }

  .app-shell {
    height: 100dvh !important;
    min-height: 0 !important;
    padding-bottom: 0 !important;
    overflow: hidden !important;
  }
  .app-shell .main-content {
    height: 100dvh !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
  .app-shell .page-content {
    box-sizing: border-box !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 92px 12px calc(96px + env(safe-area-inset-bottom, 0px)) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain;
  }
  :root body :is(.button, .file-button) {
    min-height: 40px !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
    line-height: 20px !important;
  }
  .modal-backdrop .modal { padding: 20px 16px !important; }
  .modal-header { margin-bottom: 12px !important; }
  .form-grid { gap: 16px !important; }

  #homeMetricsGrid { gap: 16px !important; }
  #homeMetricsGrid .home-summary-card { padding: 20px !important; min-height: 168px; }
  #homeMetricsGrid .home-summary-heading { margin-bottom: 16px !important; font-size: 14px !important; }
  #homeMetricsGrid .home-summary-heading svg { width: 24px; height: 24px; }
  #homeMetricsGrid .home-summary-value { font-size: 24px !important; line-height: 28px; }
  #homeMetricsGrid .home-summary-label { margin: 8px 0 6px !important; font-size: 14px !important; line-height: 20px; }
  #homeMetricsGrid .home-summary-period { font-size: 12px !important; line-height: 18px !important; }
  .home-quick-access-grid .home-shortcut { min-height: 64px; padding: 10px; }

  .browser-notification-prompt {
    width: min(360px, calc(100vw - 24px)) !important;
    max-width: 360px !important;
    padding: 12px !important;
    gap: 8px !important;
    border-radius: 12px !important;
    box-shadow: 0 12px 32px rgba(31, 31, 31, 0.16) !important;
  }
  .browser-notification-icon { width: 20px !important; height: 20px !important; --icon-size: 20px; }
  .browser-notification-copy strong { font-size: 14px !important; line-height: 20px !important; }
  .browser-notification-copy p { margin-top: 2px !important; font-size: 12px !important; line-height: 16px !important; }
  .browser-notification-actions { gap: 8px !important; }
  .browser-notification-actions .button {
    min-height: 36px !important;
    padding: 6px 10px !important;
    font-size: 13px !important;
    line-height: 18px !important;
  }
}

@media (max-width: 980px) {
  .sidebar .brand {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    margin-top: 20px !important;
    margin-bottom: 24px !important;
    padding-top: env(safe-area-inset-top, 0px) !important;
    padding-inline: 0 !important;
    box-sizing: border-box !important;
  }
  .sidebar .brand-mark {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    overflow: visible !important;
  }
  .sidebar .brand-mark img {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin-inline: auto !important;
  }
}

/* Keep the custom browser-notification dialog centered in the viewport. */
@media (max-width: 760px) {
  body:has(.browser-notification-prompt) .browser-notification-prompt {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    width: min(360px, calc(100vw - 32px)) !important;
    max-width: 360px !important;
    margin: 0 !important;
    transform: translate(-50%, -50%) !important;
  }
}


/* Permission prompt behaves like a blocking confirmation modal. */
.browser-notification-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 8999 !important;
  display: block !important;
  background: rgba(15, 15, 24, 0.58) !important;
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
}
.browser-notification-prompt {
  position: fixed !important;
  z-index: 9000 !important;
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  width: min(520px, calc(100vw - 32px)) !important;
  max-width: 520px !important;
  margin: 0 !important;
  transform: translate(-50%, -50%) !important;
}
.browser-notification-prompt:focus { outline: none !important; }
.browser-notification-modal-open .app-shell { pointer-events: none !important; }

@media (max-width: 760px) {
  .browser-notification-prompt {
    width: min(360px, calc(100vw - 32px)) !important;
    max-width: 360px !important;
  }
}


@media (max-width: 980px) {
  .app-shell {
    height: 100dvh !important;
    min-height: 0 !important;
    padding-bottom: 0 !important;
    overflow: hidden !important;
  }
  .app-shell .main-content {
    height: 100dvh !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
  .app-shell .page-content {
    box-sizing: border-box !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 92px 16px calc(96px + env(safe-area-inset-bottom, 0px)) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain;
  }
}

/* Hide scrollbar chrome everywhere while keeping native scrolling enabled. */
html,
body,
* {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Agenda had a later ID-level rule that re-enabled its list scrollbar. */
#priorityList.agenda-list,
.agenda-column-body,
.agenda-day-schedule,
.agenda-week-schedule {
  scrollbar-width: none !important;
  scrollbar-color: transparent transparent !important;
  -ms-overflow-style: none !important;
}

#priorityList.agenda-list::-webkit-scrollbar,
.agenda-column-body::-webkit-scrollbar,
.agenda-day-schedule::-webkit-scrollbar,
.agenda-week-schedule::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
